• France
état des services
démonstrations
assistance
FAQContacter le support
Video tutorials
Rechercher
Catégories
Tags
Français
Français
Anglais
Accueil
Cas d'usage
Créer un paiement
Créer un paiement en plusieurs fois
Proposer un paiement complémentaire
Créer un paiement par alias (token)
Créer un lien de paiement
Créer un paiement à l'expédition
Créer un abonnement
Gérer vos abonnements
Gérer vos transactions (rembourser,...)
Analyser vos journaux
Docs API
Formulaire embarqué
API REST
Formulaire en redirection
Intégration mobile
Échange de fichiers
Exemples de code
Moyens de paiement
Modules de paiement
Guides
Back Office Marchand
Guides fonctionnels

Créer un ordre de paiement par SMS

Cette fonctionnalité requiert un compte Lyra SMS. Pour plus d'informations, consultez la FAQ.

Cas d'utilisation

Le marchand crée un ordre de paiement envoyé par SMS à l'acheteur.

Tester

Testez le Web Service Charge/CreatePaymentOrder depuis notre playground : Charge/CreatePaymentOrder.

Requête

Paiement comptant

Exemple de requête
Champs obligatoires :
  • Montant : 100,00 €.
  • Canal de diffusion : SMS.
  • Numéro de téléphone de l'acheteur : "+33611111111"

Champs recommandés :

  • Référence de la commande : "myOrderId-1234"
/doc/fr-FR/rest/V4.0/api/kb/authentication.html
https://github.com/lyra/rest-php-examples/blob/master/www/minimalEmbeddedForm.php#L9-L44
https://api.scelliuspaiement.labanquepostale.fr/api-payment/V4/Charge/CreatePaymentOrder
{
    "amount": 10000,
    "currency": "EUR",
    "orderId": "myOrderId-1234",
    "channelOptions": {
      "channelType": "SMS",
      "smsOptions": {
        "phoneNumber": "+33611111111"
      }
    },
}
/**
 * I initialize the PHP SDK
 */
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/keys.php';
require_once __DIR__ . '/helpers.php';

/** 
 * Initialize the SDK 
 * see keys.php
 */
$client = new Lyra\Client();

/**
 * I create a formToken
 */
$store = array("amount" => 250, 
"currency" => "EUR", 
"orderId" => uniqid("MyOrderId"),
"customer" => array(
  "email" => "sample@example.com"
));
$response = $client->post("V4/Charge/CreatePayment", $store);

/* I check if there are some errors */
if ($response['status'] != 'SUCCESS') {
    /* an error occurs, I throw an exception */
    display_error($response);
    $error = $response['answer'];
    throw new Exception("error " . $error['errorCode'] . ": " . $error['errorMessage'] );
}

/* everything is fine, I extract the formToken */
$formToken = $response["answer"]["formToken"];

?>
/**
 * I initialize the PHP SDK
 */
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/keys.php';
require_once __DIR__ . '/helpers.php';

/** 
 * Initialize the SDK 
 * see keys.php
 */
$client = new Lyra\Client();

/**
 * I create a formToken
 */
$store = array("amount" => 250, 
"currency" => "EUR", 
"orderId" => uniqid("MyOrderId"),
"customer" => array(
  "email" => "sample@example.com"
));
$response = $client->post("V4/Charge/CreatePayment", $store);

/* I check if there are some errors */
if ($response['status'] != 'SUCCESS') {
    /* an error occurs, I throw an exception */
    display_error($response);
    $error = $response['answer'];
    throw new Exception("error " . $error['errorCode'] . ": " . $error['errorMessage'] );
}

/* everything is fine, I extract the formToken */
$formToken = $response["answer"]["formToken"];

?>

Pour connaître l'intégralité et la description des champs, consultez le playground : Charge/CreatePaymentOrder (menu à gauche).

Réponse

Exemple de réponse
{
    "webService": "Charge/CreatePaymentOrder",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://scelliuspaiement.labanquepostale.fr/t/328zq5so",
        "paymentOrderStatus": "RUNNING",
        "creationDate": "2020-03-31T15:06:49+00:00",
        "updateDate": null,
        "amount": 10000,
        "currency": "EUR",
        "locale": "en_GB",
        "strongAuthentication": "AUTO",
        "orderId": "myOrderId-1234",
        "channelDetails": {
            "channelType": "SMS",
            "mailDetails": null,
            "smsDetails": {
                "phoneNumber": "+336111111111",
                "message": "Dear customer, this is a payment order of EUR 2,000.50 valid until 23/04/2020. To confirm, please click on the link below : https://scelliuspaiement.labanquepostale.fr/t/xdt0bcmo",
                "_type": "V4/SMSDetails"
            },
            "whatsAppDetails": null,
            "ivrDetails": null,
            "_type": "V4/ChannelDetails"
        },
        "paymentReceiptEmail": "sample@example.com",
        "taxRate": null,
        "taxAmount": null,
        "expirationDate": "2020-04-20T18:13:26+00:00",
        "transactionDetails": {
            "cardDetails": {
                "manualValidation": "NO",
                "captureDelay": 0,
                "_type": "V4/CardDetails"
            },
            "_type": "V4/PaymentOrderTransactionDetails"
        },
        "dataCollectionForm": false,
        "merchantComment": null,
        "message": "Dear customer, this is a payment order of EUR 2,000.50 valid until 23/04/2020. To confirm, please click on the link below : https://scelliuspaiement.labanquepostale.fr/t/xdt0bcmo",
        "_type": "V4/PaymentOrder"
    },
    "ticket": null,
    "serverDate": "2020-03-31T15:06:49+00:00",
    "applicationProvider": "LBP",
    "metadata": null,
    "_type": "V4/WebService/Response"
}


}

L'ordre de paiement est envoyé par SMS à l'acheteur.

Retrouvez la description et l'intégralité des champs dans notre playground : PaymentOrder

Gestion des erreurs

Tableau des erreurs
| Code | Description | |--------|----------------------| | **INT_009** | Le format du champ **amount** est invalide ou le champ n'est pas transmis.| | **INT_010** | Le format du champ **currency** est invalide ou le champ n'est pas transmis.| | **INT_050** | Le paramètre **strongAuthentication** est invalide.| | **INT_856** | Le paramètre **locale** est invalide.| | **INT_858** | Le paramètre **taxRate** est invalide.| | **INT_869** | Le paramètre **taxAmount** est invalide. | | **PSP_519** | Devise inconnue.| | **PSP_606** | Devise non supportée par le contrat.| | **PSP_1007** | La date d'expiration de l'ordre de paiement ne peut etre antérieure à la date courante ni excédée 90 jours.| | **PSP_1015** | Aucun formulaire de collecte de données pour cette boutique.| | **PSP_1018** | Le formulaire de collecte de données ne peut être utilisé pour la devise demandée.| {: .lita-excluded-col1 }

Analyse du résultat du paiement

Pour connaître le résultat du paiement, implémentez l’URL de notification à la fin du paiement (également appelée IPN).

L'utilisation du champ ipnTargetUrl est déconseillée.

  1. Renseignez uniquement l'URL de notification dans la section API REST (TEST ou PRODUCTION) : Procédure.
  2. Analysez l'IPN : Procédure.
© 2025 Tous droits réservés à Scellius
25.18-1.11