StoreCard

This endpoint is used to get the card holder’s details and store them in our database to generate a token. This token can be used for further transactions.

Store Card:

  • Endpoint URL: <AppURL>/cardManagement/storeCard
  • METHOD: POST
  • HEADER: You must enter the content type while submitting the request. The JSON format is used for all the requests we pass. The Authorization token is passed in the Header.
    • Content-Type : application/json
    • portal-origin: localhost
    • Authorization : <YOUR_ACCESS_TOKEN>

Store

  • BookingReqID: Provide the booking request ID. This is a String Value.

  • FormID: Provide the form ID. This is a String value.

  • CardNumber: Provide the card number. This is a String value.

  • CVVCode: Provide the CVV code. This is a String value.

  • ExpiryMonth: Provide the expiry month. This is a Numeric value.

  • ExpiryYear: Provide the expiry year. This is a Numeric value.

  • CardType: Provide the card type. This is a String value.

  • CardHolderName: Provide the card holder’s name. This is a String value.

  • CardCode: Provide the card code. This is a String value.

  • PaymentMethod: Provide the payment method. This is an optional field and a String value.

Request body:
{
   "booking_req_id": "2324SDD",
   "form_id": "2324SDD434",
   "card_number": "NDExMTExMTExMTExMTExMQ==", // Encrypted Based on base64
   "cvv_code": "MjM0",
   "expire_month": "MTI=",
   "expire_year": "MjAyNQ==",
   "card_type": "MA",
   "card_holder_name": "Karthick Test Card",
   "card_code": "CC",
   "payment_method": "pay_by_card",    // Optional
}

Update

  • BookingReqID: Provide the booking request ID. This is a String Value.

  • FormID: Provide the form ID. This is a String value.

  • CardNumber: Provide the card number. This is a String value.

  • CVVCode: Provide the CVV code. This is a String value.

  • ExpiryMonth: Provide the expiry month. This is a Numeric value.

  • ExpiryYear: Provide the expiry year. This is a Numeric value.

  • CardType: Provide the card type. This is a String value.

  • CardHolderName: Provide the card holder’s name. This is a String value.

  • CardCode: Provide the card code. This is a String value.

  • PaymentMethod: Provide the payment method. This is an optional field and a String value.

  • CardToken: Provide the card token. This is a String value.

Request body:
{
   "booking_req_id": "2324SDD",
   "form_id": "form_id_1",  // unique identifier
   "card_number": "NDExMTExMTExMTExMTExMQ==",
   "cvv_code": "MjM0",
   "expire_month": "MTI=",
   "expire_year": "MjAyNQ==",
   "card_type": "VI",
   "card_holder_name": "Karthick Test Card",
   "card_code": "CC",
   "payment_method": "pay_by_card",    // Optional
   "card_token": "a0fa704e51fd64556849c765402fbf698a9584771167d258cebc2fd4"
}

RESPONSE:

Status Code Message Description
200 Success The request is successful
303 Failed Card details validation error
  • Example:

    • Success:
{&quot;status&quot;:&quot;success&quot;,&quot;status_code&quot;:200,&quot;message&quot;:&quot;card details stored success&quot;,&quot;short_text&quot;:&quot;card_stored_success&quot;,&quot;data&quot;:{&quot;card_token&quot;:&quot;a2d4604e51fd64506959d76
5412f9d218abb84391249d21fce82279c48159f7e&quot;}}
  • Failed:
{&quot;message&quot;:&quot;The given data was invalid&quot;,&quot;errors&quot;:{&quot;card_code&quot;:[&quot;this field is
required&quot;]},&quot;status_code&quot;:303,&quot;short_text&quot;:&quot;validation_error&quot;,&quot;status&quot;:&quot;failed&quot;}

Request To Third Party:

- **Endpoint URL**:  <AppURL>/cardManagement/requestToThirdParty
- **METHOD**: POST
- **HEADER**:
	Content-Type : application/json
	portal-origin :  localhost
	Authorization :  <YOUR_ACCESS_TOKEN>
  • REQUEST:
{
   "post_data": "post Data with masked card Information",
   "post_headers": ["portal-origin: localhost:8080"] ,
   "post_url": "http://localhost:8080/PCI-DSS/public/api/cardManagement/storeCard",
   "token_to_replace": ["testToken"],
   "post_data_type": "json",
   "method_type": "post"
}
  • RESPONSE:
Status Code Message Description
200 Success This message confirms that the card details passed have been successfully validated.
303 Failed This is a validation error for the card details that have been passed.
  • Example:
    • Success:
{"message":"third party api success","status_code":200,"short_text":"third_party_success","status":"success","data":”GDS Response data”}
  • Failed:
{"message":"The given data was invalid","errors":{"token_to_replace":["this field is required"]},"status_code":303,"short_text":"validation_error","status":"failed"}