Process payment
1
ClearentSDK.getPaymentToken();2
ClearentSDK.getPaymentToken().then(
(result) => {
// this function is called if getting a payment token was successful
console.log("ClearentTokenSuccess");
console.log(result);
},
(error) => {
// this function is called if getting a payment token failed
console.log("ClearentTokenError");
console.log(error);
}
);3
{
"code":"200",
"status":"success",
"exchange-id":"ID-clearent-mobile-jwt-1-c32bfe39-d454-4e34-8b4f-94d850643e48",
"payload":{
"mobile-jwt":{
"jwt":"eyJhbGciOi23UzIh4iJ9.eyJsYXN0LWZvdXIiOiIxMrkP8iwid
HlwZSI6Ik1BTlVBTCIsImV4cCI6MTU0NzY0NjU2MSwidG9rZW4iOiIxMTAwMDAw
MDAwMDEzNTkyIn0.eT8c_5yUzxCxL2MEtmbG444eTFRW7OxzRF7x4uRIo-U",
"last-four":"1111"
},
"payloadType":"mobile-jwt"
}
}4
POST /rest/v2/mobile/transactions/sale
Accept:application/json
Content-Type:application/json
api-key:YOUR_API_KEY_GOES_HERE
mobilejwt:eyJhbGciOi23UzIh4iJ9.eyJsYXN0LWZvdXIiOiIxMrkP8iwid
HlwZSI6Ik1BTlVBTCIsImV4cCI6MTU0NzY0NjU2MSwidG9rZW4iOiIxMTAw
MDAwMDAwMDEzNTkyIn0.eT8c_5yUzxCxL2MEtmbG444eTFRW7OxzRF7x4uRIo-U
Body
{
"type": "SALE",
"amount": "15.55",
"software-type": "AwesomePOSSoftware",
"software-type-version":"1"
}{
"code": "200",
"status": "success",
"exchange-id": "ID-clearent-mobile-gateway-1-2a6b56d3-c660-4810-95ea-9fb9a21c6634",
"payload": {
"transaction": {
"amount": "15.55",
"id": "2586119",
"type": "SALE",
"result": "APPROVED",
"card": "XXXXXXXXXXXX1111",
"csc": "999",
"authorization-code": "TAS022",
"batch-string-id": "938",
"display-message": "Transaction approved",
"result-code": "000",
"exp-date": "1220",
"software-type": "AwesomePOSSoftware",
"card-type": "VISA",
"last-four": "1111"
},
"payloadType": "transaction"
}
}
Last updated
Was this helpful?

