Card Registration
Card Registration makes your transaction easier. Once you register your card , you don't have to enter all the payment data every time. Because the data will be stored. This makes it possilble to use the data later . Card Registration is a Stand-alone feature which means that you directly receive an object with the registration id.
Card Registration request has to be sent to our endpoint i.e. /transaction/CardRegistration
using POST method.
In our API Specifications you can find a full list of parameters that can be sent in the initial request.
Sample Request
Params params = new Params(memberId:'11344',checksum:'85b7005f7956548a50520923a2d62b',totype:'docspartner',country:'UK',city:'Aston',state:'NA',postcode:'CH5 3LJ',street:'19 Scrimshire Lane',telnocc:'+44',phone:'07730432996',email:'john.d@domain.com',merchantRedirectUrl:'https://www.merchantRedirectUrl.com',notificationUrl:'https://www.merchantNotificationUrl.com',customerId:'123456',redirectMethod:'GET/POST') <g:form method="POST" action="https://staging.caratipay.com/transaction/CardRegistration"> ${params.memberId} ${params.checksum} ${params.totype} ${params.country} ${params.city} ${params.state} ${params.postcode} ${params.street} ${params.telnocc} ${params.phone} ${params.email} ${params.merchantRedirectUrl} ${params.notificationUrl} ${params.customerId} ${params.redirectMethod} </g:form>
Sample code for reading the response
{ "resultCode": "00002", "resultDescription": "Registration successful", "timestamp": "20181219 19:36:57", "firstName": "John", "lastName": "Doe", "checksum": "74a2cda673361ad8ad396007bda30f73", "status": "Y", "registrationId": "O31j5PIfHMs6XCFgHJDkRk1xqwxo7ei8", "cardBin": "444433", "cardLast4Digits": "1111", "customerId": "12056" }
Hashing Rule For Request
Caratipay supports MD5 Cryptographic Hash for the authenticity of payment request sent to the server.
Below are the description of fields used for generating checksum.
- memberId <Merchant ID as shared by Caratipay>
- totype <Name of PSP>
- secureKey <Secure Key that can be generated through Caratipay's dashboard>
How to generate Checksum for request ?
Checksum can be calculated with the following combination and needs to be send along with the authentication parameters in each server-to-server request:
<memberId>|<toType>|<secureKey>
Sample Code
import java.security.MessageDigest def generateMD5Checksum() { String values= "11344|docspartner|secureKey"; MessageDigest digest = MessageDigest.getInstance(MD5) digest.update(values.bytes); new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0') }
Hashing Rule For Response
Caratipay supports MD5 Cryptographic Hash for the authenticity of payment response to be sent to the merchant.
Below are the description of fields used for generating checksum.
- memberId <Merchant ID as shared by Caratipay>
- status <Response status>
- secureKey <Secure Key that can be generated through Caratipay's dashboard>
How to generate Checksum for response ?
Checksum can be calculated with the following combination and needs to be send along with the authentication parameters in each server-to-server request:
<memberId>|<status>|<secureKey>