Code samples
'sample' file in GitHub
For each integration step, we provide a simplified example in PHP.
Renseignez les clés d'API REST de Test ou de Production dans le fichier
config.php
(Fichier d'exemple : config.php).Si besoin, modifiez les données du paiement dans le fichier
formToken.php
(Fichier d'exemple : formToken.php).Display the payment form in a browser according to the desired display mode:
embedded.php
(Sample files: embedded.php and popin.php)popin.php
(Sample files: embedded.php and popin.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.
Récupérez les données de l'IPN, lors de l'appel de serveur à serveur grâce au fichier
ipn.php
(Fichiers d'exemple : ipn.php et paid.php).Redirigez l'acheteur en cas de paiement réussi vers le site marchand grâce au fichier
paid.php
(Fichiers d'exemple : ipn.php et paid.php).
Server SDKs
You do not need an SDK to use the REST API, but it can facilitate the work process.
PHP
Installation | https://github.com/lyra/rest-php-sdk |
Source code (ZIP) | https://github.com/lyra/rest-php-sdk/archive/latest.zip |
Package manager | https://packagist.org/packages/lyracom/rest-php-sdk |
Examples of use | https://github.com/lyra/rest-php-examples |
Java
Installation | https://github.com/lyra/rest-api-server-java-sdk |
Package manager | https://search.maven.org/artifact/com.lyra/server-rest-sdk/ |
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 |
React | example of integration for React |
server | integration example for Server |
svelte | integration example for Svelte |
vue | example of integration for Vue.js |
require.js | example of integration with RequireJS |
Other integration examples: C# / Python (Flask) / Symfony
Framework | Description |
---|---|
C# | example of integration for C# (.NET) |
python/flask | example in Python using the Flask framework |
php/symfony | example in python in PHP with symfony |