Prepares method data to be sent to the ACS before the authentication request is sent.
public func getMethodData() throws -> String
The GetMethodData method prepares data to be transmitted to the ACS via the cardholder's browser.
When a transaction begins, the card range cache should be queried to find details about the card range to which the card number belongs. If a CardRangeMethodURL is defined for the card range, this method should be used to prepare data to be sent via the cardholder's browser to the CardRangeMethodURL.
The following properties are applicable when calling this method:
- MethodNotificationURL (required)
This method returns a string which contains encoded data to be sent to the ACS. This includes ServerTransactionId and MethodNotificationURL. After calling this method, the returned string can be transmitted to the ACS via the cardholder's browser.
As per the EMVCo specification, create a hidden iframe in the browser and send a form with the field name threeDSMethodData containing the return value from this method and post the form to the CardRangeMethodURL.
The ACS will record information about the customer's environment and then POST back to the MethodNotificationURL. The page at this URL should expect a form variable with the name threeDSMethodData which will contain the original ServerTransactionId value in order to match the response with the request. The form variable value will be base64url encoded and may be passed directly to the CheckResponse method. The class will decode and parse the received value and populate ServerTransactionId with the value from the received data.
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.