Code samples
'sample' file in GitHub
For each step of the integration, we provide a simplified example in PHP (link from GitHub: sample folder )
Fill in the Test or Production REST API keys in the
config.php
file ( Example file: config.php ).If necessary, modify the payment data in the
formToken.php
file ( Example file: formToken.php ).Display the payment form in a browser according to the desired display mode:
smartForm.php
(Example file: smartForm.php)
Once the form is displayed, proceed with the payment. In Test mode, click on the Test cards tab of the debug bar and select the card type.
Retrieve IPN data during server-to-server calls using the
ipn.php
file ( Example files: ipn.php and paid.php ).Redirect the buyer to the merchant site in case of successful payment using the
paid.php
file ( Example files: ipn.php and paid.php ).
Another example in PHP
Here is a link for another Example PHP code.
Integration examples: C# / Python (Flask) / Symfony
Framework | Description |
---|---|
Angular | example of integration for Angular |
ember | example of integration for Ember |
ionic | example of integration for Ionic |
next | integration example for Next |
example of integration for React | |
server | integration example for Server |
svelte | integration example for Svelte |
vue | example of integration for Vue.js |
example of integration with RequireJS |