API confirmPreauthorized
Confirmation of a pre-authorized checkout (Merchant Server > Tinaba). It must be used during the "Tinaba Pay and Check" stream.
Attribute explanation
Name of domain | Type | Mandatory | Description |
---|---|---|---|
merchantId | String | Yes | Identifier of the merchant assigned by TINABA. |
externalId | String | Yes | The identifier of the pending payment on the merchant's server. It must be unique for each call. |
amount | String | Yes | Amount to be confirmed in cents. To cancel the payment, set amount : 0. |
signature | String | Yes | Authentication and data integrity signature. |
The data integrity signature, exchanged in the "signature" field, is based on a shared secret, exchanged offline, and generated using the SHA256 protocol.
signature = base64(SHA256(<merchantId><externalId><amount><secret>))
For more information on how to generate the integrity signature, see:
Request
{
"data":{
"request":{
"confirmP2PtransferByCaptureRequest":{
"confirmPreauthorizedCheckoutRequest":{
"merchantId":"12",
"externalId":"TR_1",
"amount":"100",
"signature":"AAIR12345"
}
}
}
}
}
Answers
200 Success
{
" response":{
"confirmP2PtransferByCaptureResponse":{
"confirmPreauthorizedCheckoutResponse":{
"status":"000"
}
}
}
}
400 Error Validation
{
" response":{
"confirmP2PtransferByCaptureResponse":{
"confirmPreauthorizedCheckoutResponse":{
"status":"001",
"errorCode":"XXX",
}
}
}
}
$request = new ConfirmPreauthorizedCheckoutRequest();
$request->setExternalId('TR_01')
->setAmount('100'); // Amount expressed in cents
$response = $client->confirmPreauthorizedCheckout($request);
For the full PHP SDK visit this link
from sdk.objects import ConfirmP2PtransferByCaptureRequest
action = factory.make('confirm.preauthorized.checkout')
action.body_params = ConfirmP2PtransferByCaptureRequest(externalId='TR_01',
amount='100') # expressed in cents
response = action.run()
For the full PHP SDK visit this link