Static Payment Requests contain only information about the payee, the receiver of payment and lack the information about exact amounts and payment reference. Example of Static Payment Requests are QR codes exposed at Merchant stores. Payer use this Payment Request to initiate the payment flow, yet needs to add additional information about the exact amount and reference of payment.
Dynamic Payment Requests contain both complete information about the payee and the information about exact amounts and payment reference. Example of Dynamic Payment Requests are QR codes generated at checkout process on e-commerce platforms or printed on POS devices. Payer use this Payment Request to initiate the payment flow with known total amount and reference of payment.
Direct Payment Requests contain complete information about the payee, payer and the information about exact amounts and payment reference. Example of Direct Payment Requests are subscriptions and recurring payments. Payer receives notification about Payment Request and initiates the payment flow with known total amount and reference of payment.
You can encode URL as QR code. Use it to generate code with link for conversational channels like WhatsApp or custom URL for your mobile application.
Use endpoint GET /v1/apps/payment/qr/:format/:width/:data to get image of QR code form Orangepill platform.
Supported formats are png and base64.
Use parameter width to define the size of QR code.
Use parameter data to provide URL you want to encode.
Use encodeUrl method for data parameter. For example URL https://wa.me/447860034005?text=payment code q0YR6lzpXJiNo5GMjwXkshould be encoded like https%3A%2F%2Fwa.me%2F447860034005%3Ftext%3Dpayment%2520code%2520q0YR6lzpXJiNo5GMjwXk.
PNG format of QR Code
echo 'Generate 200x200px PNG QR code for WhatsApp URL https://wa.me/447860034005?text=payment code q0YR6lzpXJiNo5GMjwXk'
curl --location --request GET 'https://api.orangepill.cloud/v1/apps/payment/qr/png/200/https%3A%2F%2Fwa.me%2F447860034005%3Ftext%3Dpayment%2520code%2520q0YR6lzpXJiNo5GMjwXk' \
--header'x-api-key: AXVubzpwQDU1dzByYM==' \--header 'Content-Type: application/json'
In response we get QR code in PNG format.
base64 format of QR code
echo 'Generate 200x200px base64 QR code for WhatsApp URL https://wa.me/447860034005?text=payment code q0YR6lzpXJiNo5GMjwXk'
curl--location--requestGET'https://api.orangepill.cloud/v1/apps/payment/BJgJVrqEnQIpYpQpLxrY/qr/base64/200' \--header 'x-api-key: AXVubzpwQDU1dzByYM==' \--header 'Content-Type: application/json'
In response we get base64 format of QR code PNG image.
You can use Orangepill API to reveal the image of QR code and decode the Payment Request Unique Code.
You must provide QR code in base64 format.
echo'Reveal Payment Request Unique Code from QR image'curl--location--requestPOST'https://api.orangepill.cloud/v1/apps/payment/qr/reveal' \--header 'x-api-key: AXVubzpwQDU1dzByYM==' \--header 'Content-Type: application/json' \--data-raw '{ "base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAklEQVR4AewaftIAAAXiSURBVO3BUW4j0REEwawG73/l9H4/TwMDDElJdkXEf6iqS0NVrYaqWg1VtRqqajVU1WqoqtVQVauhqlZDVa2GqloNVbUaqmo1VNVqqKrVUFWroapWQ1WthqpaDVW1GqpqNVTV6sWHJOE3UrkrCXep3JGET1A5JeEulbuS8BupvNtQVauhqlZDVa2GqloNVbV68WUq35KEO5Jwl8oTKncl4QmVK0l4N5VvScK3DFW1GqpqNVTVaqiq1YtfIAlPqHyCyrsl4S6VK0k4JeGkckXlW5LwhMpPGqpqNVTVaqiq1VBVqxf1MUk4qVxJwikJV1ROSTgl4S6V+m9DVa2GqloNVbUaqmo1VNXqRa2S8ITKXSrvpnIlCXXPUFWroapWQ1WthqpavfgFVH4jlbuScErCt6jcpXJKwhWVJ1T+sqGqVkNVrYaqWg1VtRqqavXiy5LwlyXhisopCSeVK0k4qVxJwh1JuKLybkn4XzRU1WqoqtVQVauhqlYvPkTlr1C5koSTypUknFTuUvlJKnep/L8Yqmo1VNVqqKrVUFWr+A8/LAknlbuS8AkqpyRcUbkjCVdUTkn4FpUrSTipnJLwLSrfMlTVaqiq1VBVq6GqVkNVrV58WRJOKqck3KXyCUk4qVxJwhNJeELllIQrKk8k4S6Vv2yoqtVQVauhqlZDVa1e/DEqdyXhpHJKwhWVUxKuqJyScJfKXUl4IgknlU9IwhMqpyRcUXm3oapWQ1WthqpaDVW1Gqpq9eLLVO5QuZKEu1ROSTipfILKE0m4KwknladUTkk4qVxJwl0qv81QVauhqlZDVa2Gqlq9+LIkPKFySsKVJJxUnlC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qloNVbUaqmo1VNVqqKrVUFWroapWQ1WthqpaDVW1GqpqNVTVaqiq1VBVq6GqVkNVrYaqWg1VtRqqavUfaQVIm0GP+0MAAAAASUVORK5CYII="
}'
In response we get Payment Request Unique Code.
"BJgJVrqEnQIpYpQpLxrY"
Make payment
To make payment and change status of the Payment Request, you must create transaction of type payment and reference Payment Request in related object.
Transaction can be in any currency. After the transaction is processed, amount in transaction asset is calculated and compared to amount in Payment Request currency. If transaction amount is equal or greater than the amount of Payment Request, status will be changed to DONE. If amount of transaction is less then amount in Payment Request, status will be changed to INCOMPLETE.
After the Payment Request status is changed, Orangepill core will call callback URL.