API getCheckoutList

[OPTIONAL API]

Recovery list of payments and refunds made at a merchant (Merchant Server > Tinaba).

Attribute explanation

Name of domainTypeMandatoryDescription
merchantIdStringYesIdentifier of the merchant assigned by TINABA
dateFromStringYesThe Start date of the search. Format 'yyyy-MM-dd'
dateToStringYesThe end date of the search. Format 'yyyy-MM-dd'
signatureStringYesAuthentication 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><secret>))

For more information on how to generate the integrity signature, see:

Data integrity >

Attribute explanation – response

Name of domain

Type

Mandatory

Description

statusStringYes000 = OK





001 = KO
errorCodeStringNoValued only if status = 001







Error code
checkoutListListNoList of completed payments and refunds
merchantIdcheckoutYesIdentifier of the merchant assigned by TINABA
externalIdcheckoutYesPayment identifier pending on the merchant's server
amountcheckoutYesAmount of payment in cents
currencycheckoutYesCurrency of the payment
authTimecheckoutYesDate of payment. Format 'yyyy-MM-dd-HH.mm.ss'
transactionTypecheckoutYesPAYMENT = payment





REFUND = refund
statecheckoutYesEXECUTED = completed successfully



FAILED = completed with error (payment failed, or cancelled by merchant)



PENDING = unfinished (pending payment)



PREAUTH = pre-authorized payment to be confirmed
internalTransactionIdcheckoutNoTinaba internal operation id in case of payment made

Request


{  
   "data":{  
      "request":{  
         "getCheckoutListRequest":{  
            "merchantId":"4198",
            "dateFrom":"2018-02-05",
            "dateTo":"2018-02-06",
            "signature":"AAIR12345"
         }
      }
   }
}

Answers

200 Success


{  
   " response":{  
      "getCheckoutListResponse":{  
         "status":"000",
         "checkoutList":[  
            {  
               "externalId":"xWTGDUVrZB",
               "merchantId":"4198",
               "amount":"15",
               "currency":"EUR",
               "authTime":"2018-02-05-15.26.35",
               "transactionType":"PAYMENT",
               "state":"PENDING"
            },
            {  
               "externalId":"EP_29",
               "merchantId":"4198",
               "amount":"10",
               "currency":"EUR",
               "authTime":"2018-02-05-15.24.15",
               "transactionType":"PAYMENT",
               "state":"PREAUTH",
               "internalTransactionId":"46284"
            },
            {  
               "externalId":"DetelVp520",
               "merchantId":"4198",
               "amount":"15",
               "currency":"EUR",
               "authTime":"2018-02-05-15.08.17",
               "transactionType":"REFUND",
               "state":"EXECUTED",
               "internalTransactionId":"45603"
            },
            {  
               "externalId":"DetelVp520",
               "merchantId":"4198",
               "amount":"15",
               "currency":"EUR",
               "authTime":"2018-02-05-15.06.48",
               "transactionType":"PAYMENT",
               "state":"EXECUTED",
               "internalTransactionId":"45599"
            }
         ]
      }
   }
}

400 Error Validation


{  
   " response":{  
      "getCheckoutListResponse":{  
         "status":"001",
         "errorCode":"XXX"
      }
   }
}

$request = new GetCheckoutListRequest();

$request->setDateFrom('2018', '01', '01');
$request->setDateTo('2018', '02', '01');

$response = $client->getCheckoutList($request);

$checkoutList = $request->checkoutList;

foreach($checkoutList as $checkout) {
    echo "Found checkout with ID " . $checkout->externalId;
}

For the full PHP SDK visit this link


from sdk.objects import GetCheckoutListRequest
from datetime import datetime
action = factory.make('get.checkout.list')
action.body_arams = GetCheckoutListRequest(dateFrom=datetime(year=2018,
                                                             month=1,
                                                             second=28).strftime('%Y-%m-%d'),
                                           dateTo=datetime(year=2018,
                                                           month=2,
                                                           second=28).strftime('%Y-%m-%d'))
response = action.run()
checkout_list = response.checkoutList

for checkout in checkout_list:
    print('Found checkout with ID {}'.format(checkout.externalId))

For the full PHP SDK visit this link