Obtenir le détail d’un ordre de paiement

Testez le web service Charge/PaymentOrder/Get depuis notre playground: Charge/PaymentOrder/Get.

Cas d’utilisation

Le marchand souhaite connaitre le statut d’un ordre de paiement ou simplement obtenir le détail d’un ordre de paiement.

Le Web Service Charge/PaymentOrder/Get permet de consulter uniquement les ordres de paiement créés avec le Web Service Charge/CreatePaymentOrder.

Requête

Paramètre Requis Description
paymentOrderId Oui ID de l’ordre de paiement.

Exemple requête

{
    "paymentOrderId": "d63e7f507a6f4dfa86cb40a833ecfd85"
}
/**
 * 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"];

?>

Réponse

L’objet answer contiendra les paramètres ci-dessous:

Paramètre Description
paymentOrderId ID de l’ordre de paiement.
paymentURL URL de paiement.
paymentOrderStatus Statut de l’ordre de paiement.
creationDate Date et heure de création de l’ordre de paiement.
updateDate Date et heure de modification de l’ordre de paiement.
channelDetails.channelType Canal de transmission de l’ordre de paiement.
channelDetails.mailDetails.recipient Adresse e-mail du destinataire. Présent uniquement si channelDetails.channelType est valorisé à MAIL.
channelDetails.mailDetails.subject Objet de l’e-mail envoyé. Présent uniquement si channelDetails.channelType est valorisé à MAIL.
channelDetails.mailDetails.body Corps de l’e-mail envoyé. Présent uniquement si channelDetails.channelType est valorisé à MAIL.
channelDetails.mailDetails.template Nom du template utilisé. Présent uniquement si channelDetails.channelType est valorisé à MAIL.
channelDetails.mailDetails.bcc Liste des destinataires en copie cachée. Présent uniquement si channelDetails.channelType est valorisé à MAIL.
channelDetails.smsDetails.phoneNumber Numéro de téléphone du destinataire avec le préfixe internationnal. Présent uniquement si channelDetails.channelType est valorisé à SMS.
channelDetails.smsDetails.message Corps du message envoyé. Présent uniquement si channelDetails.channelType est valorisé à SMS.
channelDetails.whatsAppDetails.phoneNumber Numéro de téléphone du destinataire avec le préfixe internationnal. Présent uniquement si channelDetails.channelType est valorisé à WHATSAPP.
message Message comportant le lien de paiement, rédigé dans la locale.
amount Montant à payer, exprimé dans sa plus petite unité monétaire.
currency Devise du paiement. Code ISO 4217 alpha-3.
locale Code représentant le nom de la langue et composé du code de la langue (ISO 639-1) suivi du code du pays (ISO 3166 alpha-2), séparés par le caractère “_”.
strongAuthentication Préférence du marchand concernant l’authentification forte.
orderId Référence de la commande.
paymentReceiptEmail Adresse email qui sera utilisée pour l’envoi du ticket de paiement à l’acheteur.
taxAmount Montant des taxes pour l’ensemble de la commande, exprimé dans sa plus petite unité monétaire.
taxRate Taux de taxe appliqué sur l’ensemble de la commande.
expirationDate Date de validité de l’ordre au format ISO-8601.
dataCollectionForm Utilisation du formulaire de collecte de données.
merchantComment Commentaire.
transactionDetails.cardDetails.manualValidation Mode de validation de la transaction.
transactionDetails.cardDetails.captureDelay Délai de capture.
description Description associée à la référence transmise dans le champ orderId.

Exemple de réponse

{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.systempay.fr/t/328zq5so",
        "paymentOrderStatus": "RUNNING",
        "creationDate": "2020-03-31T15:06:49+00:00",
        "updateDate": null,
        "amount": 200050,
        "currency": "EUR",
        "locale": "fr_FR",
        "strongAuthentication": "AUTO",
        "orderId": "myOrderId-999999",
        "channelDetails": {
            "channelType": "MAIL",
            "mailDetails": {
                "subject": "Votre ordre de paiement",
                "body": "Message envoyé par DEMO STORE 

Bonjour,

Cet e-mail comporte un ordre de paiement d'un montant de 2000.50 EUR valable jusqu'au 20/04/2020. Pour confirmer le paiement, veuillez cliquer sur le lien suivant :

https://secure.systempay.fr/t/328zq5so

En cas de problème, ou si ce message ne s'affiche pas correctement, merci de contacter support@demostore.com.

", "template": null, "recipient": "sample@example.com", "bcc": null, "_type": "V4/MailDetails" }, "smsDetails": null, "whatsAppDetails": 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": "Message envoyé par DEMO STORE

Bonjour,

Cet e-mail comporte un ordre de paiement d'un montant de 2000.50 EUR valable jusqu'au 20/04/2020. Pour confirmer le paiement, veuillez cliquer sur le lien suivant :

https://secure.systempay.fr/t/328zq5so

En cas de problème, ou si ce message ne s'affiche pas correctement, merci de contacter support@demostore.com.

", "_type": "V4/PaymentOrder" }, "ticket": null, "serverDate": "2020-04-01T08:20:46+00:00", "applicationProvider": "NPS", "metadata": null, "_type": "V4/WebService/Response" }
{
    "webService": "Charge/CreatePaymentOrder",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.systempay.fr/t/328zq5so",
        "paymentOrderStatus": "RUNNING",
        "creationDate": "2020-03-31T15:06:49+00:00",
        "updateDate": null,
        "amount": 200050,
        "currency": "EUR",
        "locale": "en_GB",
        "strongAuthentication": "AUTO",
        "orderId": "myOrderId-999999",
        "channelDetails": {
            "channelType": "MAIL",
            "mailDetails": {
                "subject": "Your payment order",
                "body": "Message sent by DEMO STORE 

Dear customer,

This e-mail is a payment order of EUR 2,000.50 valid until 01/04/2020. To confirm, please click on the link below :

https://secure.systempay.fr/t/w5izg024

In case of problems, or if this message is not correctly displayed, please contact support@demostore.com.

", "template": null, "recipient": "sample@example.com", "bcc": null, "_type": "V4/MailDetails" }, "smsDetails": null, "whatsAppDetails": 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": "Message sent by DEMO STORE

Dear customer,

This e-mail is a payment order of EUR 2,000.50 valid until 01/04/2020. To confirm, please click on the link below :

https://secure.systempay.fr/t/w5izg024

In case of problems, or if this message is not correctly displayed, please contact support@demostore.com.

", "_type": "V4/PaymentOrder" }, "ticket": null, "serverDate": "2020-04-01T08:20:46+00:00", "applicationProvider": "NPS", "metadata": null, "_type": "V4/WebService/Response" } }
{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.systempay.fr/t/328zq5so",
        "paymentOrderStatus": "RUNNING",
        "creationDate": "2020-03-31T15:06:49+00:00",
        "updateDate": null,
        "amount": 200050,
        "currency": "EUR",
        "locale": "es_ES",
        "strongAuthentication": "AUTO",
        "orderId": "myOrderId-999999",
        "channelDetails": {
            "channelType": "MAIL",
            "mailDetails": {
                "subject": "Su solicitud de pago",
                "body": "Mensaje enviado por DEMO STORE 

Hola,

Este correo electrónico contiene una solicitud de pago por un importe de 2.000,50 PEN, válida hasta el 01/04/2020. Para confirmar el pago, haga clic en el enlace siguiente :

https://secure.systempay.fr/t/w5izg024

En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.

", "template": null, "recipient": "sample@example.com", "bcc": null, "_type": "V4/MailDetails" }, "smsDetails": null, "whatsAppDetails": 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": "Mensaje enviado por DEMO STORE

Hola,

Este correo electrónico contiene una solicitud de pago por un importe de 2.000,50 PEN, válida hasta el 01/04/2020. Para confirmar el pago, haga clic en el enlace siguiente :

https://secure.systempay.fr/t/w5izg024

En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.

", "_type": "V4/PaymentOrder" }, "ticket": null, "serverDate": "2020-04-01T08:20:46+00:00", "applicationProvider": "NPS", "metadata": null, "_type": "V4/WebService/Response" } }
{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.systempay.fr/t/328zq5so",
        "paymentOrderStatus": "RUNNING",
        "creationDate": "2020-03-31T15:06:49+00:00",
        "updateDate": null,
        "amount": 200050,
        "currency": "EUR",
        "locale": "es_ES",
        "strongAuthentication": "AUTO",
        "orderId": "myOrderId-999999",
        "channelDetails": {
            "channelType": "MAIL",
            "mailDetails": {
                "subject": "Su solicitud de pago",
                "body": "Mensaje enviado por DEMO STORE 

Hola,

Este correo electrónico contiene una solicitud de pago por un importe de 2.000,50 COP, válida hasta el 01/04/2020. Para confirmar el pago, haga clic en el enlace siguiente :

https://secure.systempay.fr/t/w5izg024

En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.

", "template": null, "recipient": "sample@example.com", "bcc": null, "_type": "V4/MailDetails" }, "smsDetails": null, "whatsAppDetails": 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": "Mensaje enviado por DEMO STORE

Hola,

Este correo electrónico contiene una solicitud de pago por un importe de 2.000,50 COP, válida hasta el 01/04/2020. Para confirmar el pago, haga clic en el enlace siguiente :

https://secure.systempay.fr/t/w5izg024

En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.

", "_type": "V4/PaymentOrder" }, "ticket": null, "serverDate": "2020-04-01T08:20:46+00:00", "applicationProvider": "NPS", "metadata": null, "_type": "V4/WebService/Response" } }
{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.systempay.fr/t/328zq5so",
        "paymentOrderStatus": "RUNNING",
        "creationDate": "2020-03-31T15:06:49+00:00",
        "updateDate": null,
        "amount": 200050,
        "currency": "EUR",
        "locale": "es_ES",
        "strongAuthentication": "AUTO",
        "orderId": "myOrderId-999999",
        "channelDetails": {
            "channelType": "MAIL",
            "mailDetails": {
                "subject": "Su solicitud de pago",
                "body": "Mensaje enviado por DEMO STORE 

Hola,

Este correo electrónico contiene una solicitud de pago por un importe de 2.000,50 ARS, válida hasta el 01/04/2020. Para confirmar el pago, haga clic en el enlace siguiente :

https://secure.systempay.fr/t/w5izg024

En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.

", "template": null, "recipient": "sample@example.com", "bcc": null, "_type": "V4/MailDetails" }, "smsDetails": null, "whatsAppDetails": 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": "Mensaje enviado por DEMO STORE

Hola,

Este correo electrónico contiene una solicitud de pago por un importe de 2.000,50 ARS, válida hasta el 01/04/2020. Para confirmar el pago, haga clic en el enlace siguiente :

https://secure.systempay.fr/t/w5izg024

En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.

", "_type": "V4/PaymentOrder" }, "ticket": null, "serverDate": "2020-04-01T08:20:46+00:00", "applicationProvider": "NPS", "metadata": null, "_type": "V4/WebService/Response" } }
{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.systempay.fr/t/328zq5so",
        "paymentOrderStatus": "RUNNING",
        "creationDate": "2020-03-31T15:06:49+00:00",
        "updateDate": null,
        "amount": 200050,
        "currency": "EUR",
        "locale": "pt_BR",
        "strongAuthentication": "AUTO",
        "orderId": "myOrderId-999999",
        "channelDetails": {
            "channelType": "MAIL",
            "mailDetails": {
                "subject": "Su solicitud de pago",
                "body": "Mensagem enviada por DEMO STORE 

Caro cliente,

Este e-mail contém uma ordem de pagamento no valor de 2.000,50 BRL válida até 01/04/2020. Para confirmar o pagamento, favor clicar sobre o link seguinte :

https://secure.systempay.fr/t/w5izg024

Em caso de problema ou se esta mensagem não é exibida corretamente, favor contactar support@demostore.com.

", "template": null, "recipient": "sample@example.com", "bcc": null, "_type": "V4/MailDetails" }, "smsDetails": null, "whatsAppDetails": 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": "Mensagem enviada por DEMO STORE

Caro cliente,

Este e-mail contém uma ordem de pagamento no valor de 2.000,50 BRL válida até 01/04/2020. Para confirmar o pagamento, favor clicar sobre o link seguinte :

https://secure.systempay.fr/t/w5izg024

Em caso de problema ou se esta mensagem não é exibida corretamente, favor contactar support@demostore.com.

", "_type": "V4/PaymentOrder" }, "ticket": null, "serverDate": "2020-04-01T08:20:46+00:00", "applicationProvider": "NPS", "metadata": null, "_type": "V4/WebService/Response" } }

Gestion des erreurs

Le Web Service Charge/PaymentOrder/Get retournera une erreur dans les cas suivants:

Code Description
INT_902 Le format du champ paymentOrderId est invalide ou le champ n’est pas transmis.
PSP_1000 L’ordre de paiement n’existe pas.