1. Structure of the content
field
The content
field contains a detailed arrangement of each element of the order, below we will show the fields of each element:
Field | Worth | Validation | Description |
title * |
Short text | Required, min:3, max:60 | Product/invoice title |
code |
[A-z][0-9] | Optional | Product/invoice code or number |
price * |
0.00 | Required, double | Unit price |
qty * |
1 ... n | Required, int, unsigned | Number of elements |
tax |
0.00 | Optional, double | Total product tax in currency |
total * |
0.00 | Required, double | Total without tax of the product x amount in currency |
*
Campos requeridos
Example • Elements of an order
[
{
"code" : "0000123",
"title" : "Camiseta Roja",
"description" : "Talla: XS",
"tax" : 9.99,
"price" : 99.99,
"qty" : 1,
"total" : 9.99
},
{
"code" : "0000123",
"title" : "Jeans Pepe",
"description" : "Talla: 32",
"tax" : 0.00,
"price" : 123.99,
"qty" : 1,
"total" : 123.99
},
...
]
2. Webhook URL Success
The Success URL will be executed every time a collection has been successfully paid, the request
is of type POST
and its content is
content-type: application/json
.
The remote URL should return a code 200
response to indicate that the content was captured.
In case of a different response code or no response from the remote URL, the data sending will be rescheduled with a delay of 5 min and a maximum of 3 attempts per sending.
The format of the extra
field is optional and can be scalable in structure.
Example • Success URL JSON Object
{
"ref": "REF-0001-0006350867",
"uuid": "1dab5ed0",
"status": "paid",
"description": null,
"note": null,
"currency": "USD",
"tax_amount": 9.99,
"amount": 99.99,
"items": [{
"code" : "0000123",
"title" : "Camiseta Roja",
"description" : "Talla: XS",
"tax" : 9.99,
"price" : 99.99,
"qty" : 1,
"total" : 9.99
}],
"customer_name": "PEDRO PEREZ",
"customer_email": "pedro.perez@gmail.com",
"customer_phone": null,
"client_ip": "180.125.81.220",
"client_device": "android",
"created_at": "2017-09-25 03:09:47",
"paid_at": "2017-10-30 04:10:13",
"transaction_id": "7398009601",
"card_account": "4234 •••• •••• 1234",
"card_brand": "visa",
"card_type": "debit",
"company_name": "My Company",
"company_slug": "my_company",
"company_key": "7812290000",
"is_overdue": false,
"payment_url": "https://www.pixelpay.app/my_company/1dab5ed0/checkout",
"attach_url": null,
"extra": {
"codigoCliente" : "4782164",
"codigoNegocio" : "ATGSH-6712",
}
}
3. Webhook URL Error
The Error URL will be executed every time a charge fails or there is an Exception
in the code, returning a message with the technical detail ready to be reported to PixelPay technical support.
Returns a json
type structure as follows:
Example • Error URL JSON Object
{
"success": false,
"message": "Fatal error: Maximum execution time of 30 seconds exceeded"
}
Comments
0 comments
Please sign in to leave a comment.