lyra.com
Search
Categories
Tags
Europe (English)
France
Spain
Europe (English)
India
Home
Implementation
Embedded form
Hosted payment page
REST payment API
Webservices implementation guide
File exchange payment
Mobile payment
Marketplace
Helpers and tools
Free payment plugins
Snippets
Back Office
Back Office Expert
Back Office Merchant
Guides
Help
FAQ
Support

Obtaining payment order details

  • Use cases
  • Request
  • Response
  • Error handling

Test the Charge/PaymentOrder/Get web service using our playground: Charge/PaymentOrder/Get .

Use cases

The Merchant would like to know the status of a payment order or simply obtain its details.

The Charge/PaymentOrder/Get web service allows you to only view the payment orders created with the Charge/CreatePaymentOrder web service.

Request

Parameter Required DESCRIPTION
paymentOrderId Yes Payment order ID.

Sample request

{
    "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"];

?>

Response

The answer object will contain the parameters below:

Parameter DESCRIPTION
paymentOrderId Payment order ID.
paymentURL Payment URL.
paymentOrderStatus Status of the payment order.
creationDate Date and time of payment order creation.
updateDate Date and time of payment order update.
channelDetails.channelType Distribution channel of the payment order.
channelDetails.mailDetails.recipient Recipient's e-mail address. Present only if channelDetails.channelType is set to MAIL .
channelDetails.mailDetails.subject Subject of the e-mail. Present only if channelDetails.channelType is set to MAIL .
channelDetails.mailDetails.body Body of the e-mail. Present only if channelDetails.channelType is set to MAIL .
channelDetails.mailDetails.template Name of the used template. Present only if channelDetails.channelType is set to MAIL .
channelDetails.mailDetails.bcc Recipient list in hidden copy. Present only if channelDetails.channelType is set to MAIL .
channelDetails.smsDetails.phoneNumber Recipient's phone number with the international access code. Present only if channelDetails.channelType is set to SMS .
channelDetails.smsDetails.message Body of the sent message. Present only if channelDetails.channelType is set to SMS .
channelDetails.whatsAppDetails.phoneNumber Recipient's phone number with the international access code. Present only if channelDetails.channelType is set to WHATSAPP .
message Message with the payment link, edited in the locale.
amount Amount payable, expressed in the smallest monetary unit.
currency Payment currency. ISO 4217 alpha-3 code.
locale Code representing the name of the language and consisting of the language code (ISO 639-1) followed by the country code (ISO 3166 alpha-2), separated by the "_" character.
strongAuthentication Merchant preference for strong authentication.
orderId Order reference.
paymentReceiptEmail E-mail address that will be used to send the payment receipt to the buyer.
taxAmount Amount of taxes for the entire order, expressed in its smallest monetary unit.
taxRate Tax rate applied to the entire order.
expirationDate Expiry date of the order in ISO-8601 format.
dataCollectionForm Use of the data collection form.
merchantComment Comment.
transactionDetails.cardDetails.manualValidation Transaction validation mode.
transactionDetails.cardDetails.captureDelay Capture delay.
description Description associated with the reference transmitted in the orderId field.

Example of a response

{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.lyra.com/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": "<b>Message envoyé par DEMO STORE</b> <p>Bonjour, </p> <p>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 : </p> <p>https://secure.lyra.com/t/328zq5so</p> <p>En cas de problème, ou si ce message ne s'affiche pas correctement, merci de contacter support@demostore.com.</p>",
                "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": "<b>Message envoyé par DEMO STORE</b> <p>Bonjour, </p> <p>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 : </p> <p>https://secure.lyra.com/t/328zq5so</p> <p>En cas de problème, ou si ce message ne s'affiche pas correctement, merci de contacter support@demostore.com.</p>",
        "_type": "V4/PaymentOrder"
    },
    "ticket": null,
    "serverDate": "2020-04-01T08:20:46+00:00",
    "applicationProvider": "PAYZEN",
    "metadata": null,
    "_type": "V4/WebService/Response"
}
{
    "webService": "Charge/CreatePaymentOrder",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.lyra.com/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": "<b>Message sent by DEMO STORE</b> <p>Dear customer, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>In case of problems, or if this message is not correctly displayed, please contact support@demostore.com.</p>",
                "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": "<b>Message sent by DEMO STORE</b> <p>Dear customer, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>In case of problems, or if this message is not correctly displayed, please contact support@demostore.com.</p>",
        "_type": "V4/PaymentOrder"
    },
    "ticket": null,
    "serverDate": "2020-04-01T08:20:46+00:00",
    "applicationProvider": "PAYZEN",
    "metadata": null,
    "_type": "V4/WebService/Response"
}


}
{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.lyra.com/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": "<b>Mensaje enviado por DEMO STORE</b> <p>Hola, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.</p>",
                "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": "<b>Mensaje enviado por DEMO STORE</b> <p>Hola, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.</p>",
        "_type": "V4/PaymentOrder"
    },
    "ticket": null,
    "serverDate": "2020-04-01T08:20:46+00:00",
    "applicationProvider": "PAYZEN",
    "metadata": null,
    "_type": "V4/WebService/Response"
}


}
{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.lyra.com/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": "<b>Mensaje enviado por DEMO STORE</b> <p>Hola, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.</p>",
                "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": "<b>Mensaje enviado por DEMO STORE</b> <p>Hola, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.</p>",
        "_type": "V4/PaymentOrder"
    },
    "ticket": null,
    "serverDate": "2020-04-01T08:20:46+00:00",
    "applicationProvider": "PAYZEN",
    "metadata": null,
    "_type": "V4/WebService/Response"
}


}
{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.lyra.com/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": "<b>Mensaje enviado por DEMO STORE</b> <p>Hola, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.</p>",
                "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": "<b>Mensaje enviado por DEMO STORE</b> <p>Hola, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>En caso de problemas, o si este mensaje no se muestra correctamente, por favor contacte support@demostore.com.</p>",
        "_type": "V4/PaymentOrder"
    },
    "ticket": null,
    "serverDate": "2020-04-01T08:20:46+00:00",
    "applicationProvider": "PAYZEN",
    "metadata": null,
    "_type": "V4/WebService/Response"
}


}
{
    "webService": "Charge/PaymentOrder/Get",    
    "version": "V4",
    "applicationVersion": "5.5.0",
    "status": "SUCCESS",
    "answer": {
        "paymentOrderId": "fd8f6060f824427ba687d0161e46af8f",
        "paymentURL": "https://secure.lyra.com/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": "<b>Mensagem enviada por DEMO STORE</b> <p>Caro cliente, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>Em caso de problema ou se esta mensagem não é exibida corretamente, favor contactar support@demostore.com.</p>",
                "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": "<b>Mensagem enviada por DEMO STORE</b> <p>Caro cliente, </p> <p>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 : </p> <p>https://secure.lyra.com/t/w5izg024</p> <p>Em caso de problema ou se esta mensagem não é exibida corretamente, favor contactar support@demostore.com.</p>",
        "_type": "V4/PaymentOrder"
    },
    "ticket": null,
    "serverDate": "2020-04-01T08:20:46+00:00",
    "applicationProvider": "PAYZEN",
    "metadata": null,
    "_type": "V4/WebService/Response"
}


}

Error handling

The Charge/PaymentOrder/Get web service will return an error in the following cases:

Code DESCRIPTION
INT_902 The format of the paymentOrderId field is invalid or the field is not transmitted.
PSP_1000 The payment order does not exist.
Recruitment

Head Office :

LYRA NETWORK
109, rue de l’innovation
31670 Labège
FRANCE