SAQ-A Reference
Here you can find all needed methods and respective parameters to further enrich your checkout workflow for SAQ-A solution.
All methods should be called on PayEngine object (e.g PayEngine.desiredMethod(parameters)).
Init
iframesInit
Used to initialize the credit card number and credit card verification iframes in containers, provided by the integrator.
| Name | Mandatory | Type | Default Value | Description |
|---|---|---|---|---|
| creditCardContainer | YES | String or DOM Element | N/A | The id of the container html element OR DOM Element, where iframe of the credit card number input field will be rendered |
| verificationContainer | YES | String or DOM Element | N/A | The id of the container html element OR DOM Element, where iframe of the credit card verification input field will be rendered |
| options | NO | Object | N/A | Optionally appies custom UI appearance. Available settings are: cardNumberStyle / verificationStyle : a custom style ( String ) for the corresponding iframe.Custom styles can be defined in the section Custom Styles in the Merchant Center. Every custom style gets a unique ID, which should be placed as value for the corresponding parameter. Default: none cardNumberPlaceholder / verificationPlaceholder : a custom placeholder (String) for the corresponding iframe input field. Default: none |
| initCallback | YES | Function | N/A | Function with following signature - callback (error, result). Result parameter is a reference object that is to be used by the integrator with all other SAQ-A methods, indicating exactly which iframes instance is being targeted. Error parameter is an object, containing a message with the reason why the iframe were not loaded. |
CreatePaymentInstrument
ìframesCreatePaymentInstrument
Creates payment instrument
| Name | Mandatory | Type | Default Value | Description |
|---|---|---|---|---|
| iframeCoupleReference | YES | Object | N/A | iframe reference, which is received as a result parameter in the initCallback of iframesInit function |
| data | YES | Object | N/A | An object for credit card information, which should have the following key-value pairs: expiryMonth: {EXPIRY MONTH}, expiryYear: {EXPIRY YEAR}, cardHolder: {CARD HOLDER} |
| merchantPaymentInstrumentId | NO | String | N/A | |
| resultCallback | YES | Function | N/A | Function with following signature - callback (error, result) Result parameter is object, containing the paymentInstrumentId Error parameter is an object, containing a message with the reason what has failed. Please see Error object for further information. |
GetCardType
iframesGetCardType
The method will return the credit card type.
| Name | Mandatory | Type | Default Value | Description |
|---|---|---|---|---|
| iframeCoupleReference | YES | Object | N/A | iframe reference, which is received as a result parameter in the initCallback of iframesInit function |
| resultCallback | YES | Function | N/A | Function with following signature - callback (error, result) Result parameter is object, containing the credit card type (e.g. visa, mastercard, amex, etc.) Error parameter is an object, containing a message with the reason what has failed. Please see Error object for further information. |
ValidateCardNumber
iframesValidateCardNumber
This method will validate the credit card number.
| iframeCoupleReference | YES | Object | N/A | iframe reference, which is received as a result parameter in the initCallback of iframesInit function |
| resultCallback | YES | Function | N/A | Function with following signature - callback (error, result) Result parameter is true (if validation passed) Error parameter is an object, containing a message with the reason what has failed. Please see Error object for further information. |
ValidateVerification
iframesValidateVerification
This method will validate the credit card verification.
| iframeCoupleReference | YES | Object | N/A | iframe reference, which is received as a result parameter in the initCallback of iframesInit function |
| resultCallback | YES | Function | N/A | Function with following signature - callback (error, result) Result parameter is true (if validation passed) Error parameter is an object, containing a message with the reason what has failed. Please see Error object for further information. |
AddEventListener
iframesAddEventListener
This method will add event listener on the input field inside the targeted iframe, which will provide the integrator with validation result when triggered by the event chosen.
| Name | Mandatory | Object | Default Value | Description |
|---|---|---|---|---|
| iframeCoupleReference | YES | Object | N/A | iframe reference, which is received as a result parameter in the initCallback of iframesInit function |
| iframeType | YES | String | N/A | cardNumber or verification (see UserVariables) |
| eventType | YES | String | N/A | blur, enter, focus, input, mouseOver, mouseOut, shiftTab, tab (see UserVariables) |
| listener | YES | Function | N/A | Function with following signature - listener (result) Result parameter will represent an object, containing iframeType, iframeEventType and depending on the iframeType cardNumberValid, cardNumberError, cardType for cardNumber iframe and verificationValid, verificationError for verification iframe. |
RemoveEventListener
iframesRemoveEventListener
This method will remove event listener on the input field inside the targeted iframe.
| Name | Mandatory | Type | Default Value | Description |
|---|---|---|---|---|
| iframeCoupleReference | YES | Object | N/A | iframe reference, which is received as a result parameter in the initCallback of iframesInit function |
| iframeType | YES | String | N/A | cardNumber or verification (see UserVariables) |
| eventType | YES | String | N/A | blur, enter, focus, input, mouseOver, mouseOut, shiftTab, tab (see UserVariables) |
| listener | YES | Function | N/A | The previously added event listener |