API verifyCheckout
[OPTIONAL API]
Check the status of a payment (Merchant Server > Tinaba).
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 |
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><secret>))
For more information on how to generate the integrity signature, see:
Attribute explanation – response
Name of domain | Type | Mandatory | Description |
---|---|---|---|
status | String | Yes | 000 = OK 001 = KO |
checkoutState | String | No | Valued only if status = 000 000 = completed successfully 001 = completed with error (failed payment, or payment cancelled by merchant) 002 = payment expired 003 = unfinished (pending payment) 004 = completed without payment (the user has already paid for the product previously). Used only if the paymentMode in the initCheckout = MEDIA 005 = pre-authorized payment to be confirmed. Used only if the paymentMode in the initCheckout = PREAUTH |
errorCode | String | No | Valued only if status = 001 Error code |
externalId | String | No | Payment identifier pending on the merchant's server |
merchantId | String | No | Identifier of the merchant assigned by TINABA |
amount | String | No | Amount in cents |
currency | String | No | Currency (EUR) |
userAddress | userAddress | Yes | If one-click mode is configured, it contains the shipping and billing information of the user who ended the payment |
userAddress.name | String | Yes | Name Tinaba User |
userAddress.surname | String | Yes | Last name Tinaba user |
userAddress.email | String | Yes | Email Tinaba user |
userAddress.shippingAddress | shippingAddress | No | Shipping address |
userAddress.billingAddress | billingAddress | Yes | Billing address |
shippingAddress.receiverName | String | Yes | Full name on address |
shippingAddress.address | String | Yes | Address |
shippingAddress.streetNumber | String | Yes | Number |
shippingAddress.city | String | Yes | City |
shippingAddress.cap | String | Yes | Zip Code |
shippingAddress.district | String | Yes | Province |
shippingAddress.country | String | Yes | Country |
shippingAddress.sendAt | String | No | At |
shippingAddress.phoneNumber | String | No | Phone number |
billingAddress.receiverName | String | Yes | Billing first and last name |
billingAddress.address | String | Yes | Address |
billingAddress.streetNumber | String | Yes | Number |
billingAddress.city | String | Yes | City |
billingAddress.cap | String | Yes | Zip Code |
billingAddress.district | String | Yes | Province |
billingAddress.country | String | Yes | Country |
billingAddress.fiscalCode | String | Yes | Tax code |
Request
{
"data":{
"request":{
"verifyCheckoutRequest":{
"merchantId":"12",
"externalId":"TR_1",
"signature":"AAIR12345"
}
}
}
}
Answers
200 Success
{
"response":{
"verifyCheckoutResponse":{
"status":"000",
"checkoutState":"000",
"merchantId":"12",
"externalId":"TR_1",
"amount":"100",
"currency":"EUR"
}
}
}
400 Error Validation
{
"response":{
"verifyCheckoutResponse":{
"status":"001",
"errorCode":"XXX"
}
}
}
$request = new VerifyCheckoutRequest();
$request->setExternalId('TR_01');
$response = $client->verifyCheckout($request);
echo "The checkout status is " . $response->checkoutStatus;
For the full PHP SDK visit this link
from sdk.objects import VerifyCheckoutRequest
action = factory.make('verify.checkout')
action.body_params = VerifyCheckoutRequest(externalId='TR_01')
response = action.run()
print('The checkout state is {}'.format(response.checkoutState))
For the full PHP SDK visit this link