Creating a payment order by QR Code
Use cases
The merchant creates a QR Code payment order and a payment link. The message is sent by the merchant.
Request
Payment with a QR Code
Sample query
Required fields:
- Amount: €100,00.
- Distribution channel: URL.
. Recommended fields:
- Order reference: "myOrderId-1234".
- QR code: 250 px.
/doc/en-EN/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": "URL", "urlOptions": { "generateQRCode" : "true", "qrCodeSize" : 250 } } }
PARAMETER | required | Description |
---|---|---|
YES | Parameter to generate a QR Code (Can take the valuetrue orfalse ). | |
No | Parameter allowing you to define the size of the QR Code in pixels (value between 50 and 400). Defaults to 100. |
Response
Example of a response
Retrieve from the objectAnswer the value of channelDetails.urlDetails.qrCode
corresponding to a base64 encoded image.
(..) "channelDetails": { "channelType": "URL", (..) "urlDetails": { "qrCode": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AQAAAACgl2eQAAABZklEQVR4Xu2XUYrDMAxEBTlAjpSr+0g5gMGrp2lK4y79zoAHEWzl/UwlOW6M32oxZyYtQFqAtABpAdJzgB4od4ot06ndDWDdxnlUxAampBfQYm+Z2YaipXFTID32OPDrD2Qey5YAS3Y7I/NfyzkATHv6au9g7wZIvQbnXSbJCCBZvvKVLFftzACYtHYeUYPTNUT3Yj0f6DUsGToESHMg+AFpcDspWX4Wq1i0nx1A7DilTOk6C3e3aQHIZgEyO7fc84FR1xKqQ7/BTzYtAM1+ftmT2YrJ563lPIBWlYK8SjbZNABeWwb/gI+g8dwA2ewcv417b/Hfv8PDARnsdZRRrJPx/2w5CwCbuWRweHKklUcvQBLWdd26f9wtgI6xmpTrfpKN5wewJpltJrLXvdENKGtEvQpazhQYeMy3B4up5XyA64lTSD+Apcr0Opbr760ZEKiSLRj8r/F3AH5oAdICpAVIC5A8gD9G7EWe3QLtLAAAAABJRU5ErkJggg==", "_type": "V4/URLDetails" }, }
Insert this data into a tag img
.
<div> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AQAAAACgl2eQAAABZklEQVR4Xu2XUYrDMAxEBTlAjpSr+0g5gMGrp2lK4y79zoAHEWzl/UwlOW6M32oxZyYtQFqAtABpAdJzgB4od4ot06ndDWDdxnlUxAampBfQYm+Z2YaipXFTID32OPDrD2Qey5YAS3Y7I/NfyzkATHv6au9g7wZIvQbnXSbJCCBZvvKVLFftzACYtHYeUYPTNUT3Yj0f6DUsGToESHMg+AFpcDspWX4Wq1i0nx1A7DilTOk6C3e3aQHIZgEyO7fc84FR1xKqQ7/BTzYtAM1+ftmT2YrJ563lPIBWlYK8SjbZNABeWwb/gI+g8dwA2ewcv417b/Hfv8PDARnsdZRRrJPx/2w5CwCbuWRweHKklUcvQBLWdd26f9wtgI6xmpTrfpKN5wewJpltJrLXvdENKGtEvQpazhQYeMy3B4up5XyA64lTSD+Apcr0Opbr760ZEKiSLRj8r/F3AH5oAdICpAVIC5A8gD9G7EWe3QLtLAAAAABJRU5ErkJggg==" alt="QR Code"> </div>

The payment link can be sent using thepaymentURL
field of the objectAnswer.
View the description and all the other fields in our playground:
Error handling
Error table
Code | Description |
---|---|
The format of the amount field is invalid or the field is not transmitted. | |
The format of the currency field is invalid or the field is not transmitted. | |
The strongAuthentication parameter is invalid. | |
The locale parameter is invalid. | |
The taxRate parameter is invalid. | |
The taxAmount parameter is invalid. | |
. | |
Unknown currency. | |
Currency not supported by the MID. | |
The expiry date of the payment order cannot be earlier than the current date or exceed 90 days. | |
No data collection form for this shop. | |
The data collection form cannot be used for the requested currency. |
Analysis of payment results
To know the payment result, implement the instant payment notification (also known as IPN).