{"id":3442,"date":"2021-03-09T20:09:09","date_gmt":"2021-03-09T20:09:09","guid":{"rendered":"https:\/\/documents.openpay.mx\/?p=3442"},"modified":"2021-03-10T19:41:16","modified_gmt":"2021-03-10T19:41:16","slug":"store-remote","status":"publish","type":"post","link":"https:\/\/documents-mx-dev.opdevhm.com\/en\/docs\/store-remote.html","title":{"rendered":"Online Authorizator"},"content":{"rendered":"
In payments via stores we have the option to define our own references (Offline References), which we can handle the format of references that you want to use. This references allows to validate These references are valid for certain data according to the format that we define.\n\nHowever, if we want to use more complex rules to validate our payments, we can request that the references be authorized by a service in our application, prior to being accepted by the store<\/p>
The authorization process of reference follows the following steps:<\/p>
<\/p>
In case the store has a problem when registering an authorized payment, a cancellation process occurs:<\/p>
<\/p>
To validate your own references you must implement two Web service in your application, which will be called by Openpay via HTTPS:<\/p>
The authorization service will be called by Openpay when a customer tries to pay a valid reference of merchant, in your response must contain a code identifing the authorization result with the authorization number in case of successful authorization, or an optional description of error in case of failure.<\/p>
If a customer tries to pay a reference with an invalid format, it will be rejected without calling the authorization service.<\/span><\/em><\/p> Openpay will call this service using an HTTP POST method, using HTTP Basic authentication to identify itself. The content of the request will be type application\/json, encoded in UTF-8.<\/p> The request body will contain a JSON object with the following properties:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t HTTP request example:<\/p> Example using curl:<\/p> Is required that service production environment can be acceced via HTTPS<\/em><\/span><\/p> The service expects an answer HTTP 200 OK, with request body type application\/json that contains the following fields:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\u00a0Request send by Openpay<\/h3>
Name<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Type<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Length<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Description<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
folio<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Alfanumeric<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
8 - 35<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
The reference that is being authorized. This reference is always in upper case.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
local_date<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Date<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
25<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
The date and time of payment made, in ISO 8601 format. (ej. \"2015-10-01T13:00:00-05:00\")<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
amount <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Numeric<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
1 - 15<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
\tThe amount for which the payment is being made.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
trx_no<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Numeric<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
1 - 12<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Point of sale transaction id.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
POST <\/span>\/openpay\/authorizer<\/span> HTTP<\/span>\/<\/span><\/strong>1.1<\/span>\nHost<\/span>:<\/span> example.com<\/span>\nAuthorization<\/span>:<\/span> Basic VEVTVDp0ZXN0<\/span>\nContent-Type<\/span>:<\/span> application\/json<\/span>\nCache-Control<\/span>:<\/span> no-cache<\/span><\/code>
{<\/span>\n \"folio\"<\/span> :<\/span> \"TESTSTABC123456782\"<\/span>,<\/span>\n \"local_date\"<\/span> :<\/span> \"2015-08-07T10:00:00-05:00\"<\/span>,<\/span>\n \"amount\"<\/span> :<\/span> 100.00<\/span>,<\/span>\n \"trx_no\"<\/span> :<\/span> 1234567890<\/span>,<\/span>\n}<\/span><\/code><\/pre><\/figure>
curl https:\/\/example.com\/openpay\/authorizer \\<\/span>\n -H \"Content-type: application\/json\"<\/span> \\<\/span>\n -d '{<\/span>\n \"folio\" : \"TESTSTABC123456782\",<\/span>\n \"local_date\" :\"2015-08-07T10:00:00-05:00\",<\/span>\n \"amount\" : 100.00,<\/span>\n \"trx_no\" : 1234567890<\/span>\n }'<\/span> \\<\/span><\/span>\n -u TEST:test \\<\/span>\n -X POST <\/code><\/pre><\/figure>
Service response<\/h3>
Name<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Type<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Length<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Description<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
response_code <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Numeric<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
\t1-2 <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
The response code indicating the authorization result.<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t
authorization_number \t<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
Numeric<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t
6 <\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t