In this article, we will learn how to implement a clearent payment gateway with a JWT Credit card token using jquery. You can use this token as a card in your Sale refund and other APIs.
And also we learn how to use existing cards for sale and other APIs Integrators may use the JavaScript SDK to incorporate payments into their websites smoothly. Iframes are used by Clearent’s JavaScript SDK to include PCI security compliance best practices for e-commerce sites.
You can learn how to use Clearent Javascript SDK and how to generate JWT Card Token from Here
we are going to learn how to use this token and use the existing cards in the future without generating tokens again.
Let’s begin.
Step 1: Get Your Card JWT Token From Javascript SDK
Step 2: Now open Your postman
https://gateway-sb.clearent.net/rest/v2/mobile/transactions/sale
{ "type": "SALE", "amount": "99", "software-type": "AwesomePOSSoftware", "software-type-version":"1", "create-token":"true" }
Now Click on Send
And you get responses that look like this :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response> <code>402</code> <status>fail</status> <exchange-id>ID-clearent-mobile-jwt-1-c166602b-2347-47c5-bc7a-779f0dc7681c</exchange-id> <links> <rel>transaction</rel> <href>/rest/v2/transactions?id=114974209</href> <id>114974209</id> </links> <links> <rel>token</rel> <href>/rest/v2/tokens/{Here is your card Token}</href> <id>{Here is your card Token}</id> </links> <payload type="errorTransaction"> <transaction> <amount>0.01</amount> <id>114974209</id> <type>SALE</type> <result>DECLINED_BY_ISSUER_REFERRED_PLEASE_CALL_CARD_ISSUER</result> <display-message>Declined by Issuer -Referred - Please call Card Issuer</display-message> <result-code>007</result-code> <card>XXXXXXXXXXXX1111</card> <exp-date>0226</exp-date> <csc>999</csc> <software-type>AwesomePOSSoftware</software-type> <card-type>VISA</card-type> <last-four>1111</last-four> <merchant-id>{here is your merchant-id}</merchant-id> <terminal-id>10011113</terminal-id> </transaction> <error> <error-message>DECLINED_BY_ISSUER_REFERRED_PLEASE_CALL_CARD_ISSUER , DECLINED_BY_ISSUER_REFERRED_PLEASE_CALL_CARD_ISSUER</error-message> <result-code>007</result-code> </error> </payload> </response>
Here you can find your following key and tokens:
That’s it you can make payment with your JWT token without giving your card details
But there is one problem JWT token is not valid for the second time you can not use this JWt token for future payment. Token will be invalid in some time.
So you can use the token that you get from the response save this token in your database and you can use that token in future payment
But using this token you can not use this API : https://gateway-sb.clearent.net/rest/v2/mobile/transactions/sale
To use the existing card(Token) you need to use this API : https://gateway-sb.clearent.net/rest/v2/transactions/sale
Open Postman and add AIP : https://gateway-sb.clearent.net/rest/v2/transactions/sale
for this time add Your API key in the header and in this API you can not pass your Any JWT token
Now Add Body
Like This :
Now Click on send and you got a response that look like this :
{ "code": "200", "status": "success", "exchange-id": "ID-clearent-cgw-2-1643310635949-0-16898478", "links": [ { "rel": "transaction", "href": "/rest/v2/transactions?id=114974234", "id": "114974234" } ], "payload": { "transaction": { "amount": "25.55", "id": "114974234", "type": "SALE", "result": "APPROVED", "card": "XXXXXXXXXXXX1111", "authorization-code": "TAS393", "batch-string-id": "38", "display-message": "Transaction approved", "result-code": "000", "exp-date": "0226", "software-type": "AwesomePOSSoftware", "card-type": "VISA", "last-four": "1111", "merchant-id": "943250857867", "terminal-id": "10011113" }, "payloadType": "transactionToken", "tokenResponse": { "token-id": "{Card Token}", "times-used": "1", "status": "Active", "created": "2022-02-12T06:28:30.946Z", "updated": "2022-02-12T06:28:30.968Z", "exp-date": "0226", "last-four-digits": "1111", "card-type": "VISA", "merchant-id": "943250857867", "token-status": "Open" } } }
That’s it.
Here we learn how to use JWT Card tokens and make payments and generate cards is for future payment
You cannot use the JWT token in the future because this token is valid for some time and you can not use it after that
So we generate a card ID with the use of JWTmobile sale API and in response and we can store this token in DB, also you can use this token any time in the future for payment.
In short, you can use this token as an existing card for customers and make Transactions.
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular