Checkout Integration
Tandym is a hosted Checkout experience where you trigger the experience with the below API call. Tandym Payment’s Hosted Checkout is a standard redirection-based integration where the complete checkout is developed and managed by Tandym.
Tandym’s Hosted Checkout securely redirects customers to a branded page hosted by Tandym and carries your own branding elements. When finished, we will redirect the customer back to the URLs you specify.
Configure Payment Selector
The first step to begin is to set up the Payment Selector at your checkout page. You will integrate this into your payment selector - we recommend the below UI for integrating {YOUR PAY}
Triggering the Checkout Resource
When the customer selects COMPLETE ORDER with {YOUR PAY} as the selected payment, you need to send a request to our API with the following data for generating a token-based redirect URI.
Note :
- You can pass your own
cancelurl
/callbackurl
/redirecturl
/errorurl
- We have put placeholders for the value being sent, you should send the real orderID and customer / cart info
- All the amounts being sent to us will be in cents (as an integer)
Order Request
Example Order Request
curl -X POST https://stagingapi.platform.poweredbytandym.com/custom/checkout
-H 'content-type:application/json'
-H ‘apiKey:<YOURPAY_API_KEY>’
-d '{
"type":"sale”,
"orderid":555,
"invoice":"HT-555",
"email":"customer@test.com",
"billing":{
"firstname":"Andrew",
"lastname":"Brown",
"company":"NA",
"address":"506 Ramseur Street",
"address2":"4",
"city":"Durham",
"state":"NC",
"zip":"27701",
"country":"US",
"phone":"1231231212"
},
"shipping":{
"firstname":"Andrew",
"lastname":"Brown",
"company":"NA",
"address":"506 Ramseur Street",
"address2":"4",
"city":"Durham",
"state":"NC",
"zip":"27701",
"country":"US",
"phone":"1231231212"
},
"currency":"USD",
"amounttotal":55199,
"taxtotal":1000,
"shippingtotal":500,
"discount":1000,
"items":[
{
"itemid":"2484065QCS",
"itemname":"Your Best Seller",
"itemimageurl":"https://www.yoursite.com/files/bestsellers/2484065kcs.jpg",
"unitprice":28799,
"quantity":1
},
{
"itemid":"LA-2100-IG-20",
"itemname":"Your Best Seller",
"itemimageurl":"https://www.yoursite.com/files/bestsellers/2484065kcs.jpg",
"unitprice":26400,
"quantity":1
}
],
"cancelurl":"https://www.yoursite.com/cart",
"errorurl":"https://www.yoursite.com/cart?error=0",
"callbackurl":"https://www.yoursite.com/callback",
"redirecturl":"https://www.yoursite.com/redirect?status=success",
"testMode":true,
"_token":"439873lkjklew@!"
}'
Redirecting your customer to the Hosted Checkout
Redirect your customer to the redirectURL received from the above response.
Testing the payment checkout experience
Customer will be able to sign in with their phone number (either new or existing) and process the order payment. Post completion of Tandym’s Payment Process, the customer is redirected to the payment success url (if successful) or the declined or cancel url depending on processing status.
To test customer in Sandbox please use the below info
- Phone number : 2001001688
- OTP : 246802
Note:
- Other phone numbers will NOT work in Sandbox environment.
- Use small amounts during testing
Payment callback confirmation
When Tandym finishes processing the payment on our hosted payment experience, we will call back the URLs to confirm that payment processing is completed. The callback URL is given to us as a part of the checkout request [callbackurl].
When we do the callback to confirm, we will pass along the following info as a part of the payload : OrderID (sent by you in Checkout request), Transaction_receipt (our payment confirmation ID), gross Amount (amount that you sent), netAmount(Amount customer paid), rewardsApplied (rewards that was applied).
The transaction_receipt should be saved in your system for processing captures and refunds. We do support multiple patterns for callback confirmation, so if you have a different pattern, please let our team know.
Required attributes
- Name
orderid
- Type
- string
- Description
This is the order id which you had shared with the request
- Name
transaction_receipt
- Type
- string
- Description
This is the reference number for the transaction and required for initiating REFUND
- Name
grossAmount
- Type
- number
- Description
This is the gross amount for the order (the amount you sent to us to process)
- Name
netAmount
- Type
- number
- Description
This is the net amount for the order (net of all rewards applied)
- Name
rewardsApplied
- Type
- number
- Description
This is the rewards applied for the order
Request
curl -X POST https://www.yoursite.com/confirm?status=success \
-H 'content-type:application/json' \
-d '{
"orderid":557,
"transaction_receipt":"2c42b592-e172-4fde-8bc1-3d456008b014",
"netAmount":150,
"grossAmount":160,
"rewardsApplied":10
}'
Success Response
{
"status": 1
}
Error Response
{
"status": 0
}
Capture a Transaction
When you have enabled dual messaging, your payment will be processed by means of Auth & Capture. The payment shall be first authorized, post which capture needs to be initiated manually.
Required attributes
- Name
orderid
- Type
- string
- Description
The unique id of the order
- Name
transaction_receipt
- Type
- string
- Description
The transaction receipt of the order
- Name
currency
- Type
- string
- Description
The merchant's configured currency (USD only)
- Name
amounttotal
- Type
- number
- Description
The total amount of the order (in cents)
Request
curl -X POST https://stagingapi.platform.poweredbytandym.com/custom/capture \
-H 'content-type:application/json' \
-H 'apiKey:{YOURPAY_API_KEY}' \
-H 'secret:{YOURPAY_API_SECRET}' \
-d '{
"orderid":557,
"transaction_receipt":"2c42b592-e172-4fde-8bc1-3d456008b014",
"currency":"USD",
"amounttotal":200,
}'
Success Response
{
"captured": 1
}
Error Response
{
"captured": 0,
"errorcode": "CAPTURE_UNSUCCESSFUL",
"errormessage": "Capture is not successful!"
}
Void a Transaction
When a payment has been authorized and needs to cancelled, you can void the transaction.
Required attributes
- Name
paymentID
- Type
- string
- Description
The payment id (transaction receipt) of the order
Request
curl -X POST https://stagingapi.platform.poweredbytandym.com/custom/void \
-H 'content-type:application/json' \
-H 'apiKey:{YOURPAY_API_KEY}' \
-H 'secret:{YOURPAY_API_SECRET}' \
-d '{
"paymentID":"d0254461-7607-4d28-a0b8-accff6b1d0af"
}'
Success Response
{
"void": 1
}
Error Response
{
"void": 0,
"errorcode": "VOID_UNSUCCESSFUL",
"errormessage": "Void is not successful!"
}