Sometimes you may want to host the checkout page on your site or app (via webview). This way you avoid disruptive redirections to another site while retaining the look and feel of your own site.
In case you also want to accept card payments but you aren’t PCI compliant, you can use the secure form fields feature instead of regular input form fields.
This way you can seamlessly build a form hosted on your side that can collect card data in a secure way without breaking PCI rules since no actual plaintext card details will be accesible from your side.
First off, you must contact your MEO Wallet account manager and configure your e-commerce site domain so it can be whiltelisted to use this feature.
You must also take note of the wallet identifiers you want to use.
To obtain them you must log in MEO Wallet backoffice Then under My Business/My wallets choose the one you want to use and click in the edit icon. The displayed page will show the wallet id in the topmost field.
First you must include the following URL preferably inside the <head></head>
block:
Make sure you replace xxx above with the wallet id you have obtained in section 1.
Then, in the place you intend to insert the form fields for the card data use the HTML elements according to the following table:
Card data field | HTML Element |
---|---|
Number (PAN) | |
Expiry date | |
CVV/CVC | |
Holder Name |
These elements will render as input text boxes hosted at the MEO Wallet site, but that will be transparent to you and the end user.
To actually collect the card details the user has entered you need to call the function AlticePay.collectCardDataProWS
exported by the script you’ve set up in section 2.
The function is asynchronous so make sure you “await” for its reponse value.
Upon success, the response is an object with the following JSON format:
If an error occurs the response is as follows:
In case of success, you can then feed the above card
structure to the ProWS CC API in order to either:
You can customise the look of the elements referred in section 2 by passing the special attributes:
data-style
data-style-error
Both attributes take a string of inline CSS attributes. data-style
is used to style the element under normal
circunstances whereas data-style-error
will be used when the input to the field is invalid (for instance an invalid card number).
Please note that data-style-error
inherits from data-style
so that the latter is always applied by default.
The following example will create a rudimentar form. Upon clicking on the “submit” button the encrypted fields will be displayed. You can host it in your site and try it for yourself.
Please take note that it will only work in the sandbox environment without the need for your domain to be whitelisted.