Digital Payment (Wallet)

Digital wallets are an alternative payment method supported by 2C2P that allows customers to make seamless payments online.

🚧

How to Integrate

Please refer to the high level diagram flow of Third Party Redirection.

 

1. Prepare Payment Token Request

To prepare a payment token request, refer to the required parameters below.

📘

Please refer to: Payment Token API Request

Pre Requisite
1. MerchantID, secret code & CurrencyCode are provided by 2C2P.
2. For PaymentChannel, merchant can refer to the available payment channels for Digital Payment (E-Wallet).

Merchants who already know which specific digital payment needs to proceed may fill in Channel Code. Otherwise, merchants may also fill in Category Code or Group Code (if either parameter is known), and the corresponding payment channel will then be shown in Payment Option and Payment Option Detail APIs.
{
  "merchantID": "458458000000000",
  "invoiceNo": "220920084480",
  "description": "V4 Test",
  "amount": "120",
  "currencyCode": "MYR",
  "paymentChannel": ["DPAY"]
}

 

2. Receive Payment Token Response

To receive a payment token response, refer to the sample payment token response below.

📘

Please refer to: Payment Token API Response

{
  "paymentToken": "kSAops9Zwhos8hSTSeLTUZhBH+ZITpUoBizPNDc+wcpzY5UL2WSG9ky0YSUNT8qJGNWjmT3oMAiGqa1banJ6MGkXkxDM41GKEAw/s0yiR05aTx1QTz7946Wewm7amkCx",
  "respCode": "0000",
  "respDesc": "Success"
}

 

3. Validation of Payment Token

Proceed only when the parameter "respCode" is "0000". Otherwise, terminate the payment process. Refer to the Payment Response Code below.

🚧

Please refer to: Payment Response Code

 

4. Prepare Payment Option Request

To retrieve available payment options, send a payment option request. Refer to the sample Payment Option Request below.

For merchants who already know which payment options are available, this step is optional.

📘

Please refer to: Payment Option API Request

{
	"paymentToken": "kSAops9Zwhos8hSTSeLTUZhBH+ZITpUoBizPNDc+wcpzY5UL2WSG9ky0YSUNT8qJGNWjmT3oMAiGqa1banJ6MGkXkxDM41GKEAw/s0yiR05aTx1QTz7946Wewm7amkCx",
	"locale": "en",
	"clientID": "30c7cf51-75c4-4265-a70a-effddfbbb0ff"
}

 

5. Receive Payment Option Response

To receive a payment option response, refer to the sample payment option response below.

📘

Please refer to: Payment Option API Response

{
	"paymentToken": "kSAops9Zwhos8hSTSeLTUZhBH+ZITpUoBizPNDc+wcpzY5UL2WSG9ky0YSUNT8qJGNWjmT3oMAiGqa1banJ6MGkXkxDM41GKEAw/s0yiR05aTx1QTz7946Wewm7amkCx",
	"merchantDetails": {
		"id": "458458000000000",
		"name": "2C2P My Test",
		"address": "Unit 18-3, Level 18, Tower B, Vertical Business Suite, Avenue 3, Bangsar South, No 8 Jalan Kerinchi, 59200 Kuala Lumpur",
		"email": "",
		"logoUrl": "https://pgw-static-sandbox.s3.amazonaws.com/images/merchantlogo/458458000000000.png",
		"bannerUrl": null
	},
	"transactionDetails": {
		"amount": "120.00",
		"currencyCode": "MYR",
		"invoiceNo": "220920084480",
		"description": "V4 Test"
	},
	"channelCategories": [{
		"groups": [{
			"sequenceNo": 1,
			"name": "Wallet Payment",
			"code": "EWALLET",
			"iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/wallet.png",
			"logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/.png",
			"default": true,
			"expiration": false
		}],
		"sequenceNo": 1,
		"name": "Digital Payment",
		"code": "DPAY",
		"iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/dpay.png",
		"logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/.png",
		"default": true,
		"expiration": false
	}],
	"respCode": "0000",
	"respDesc": "Success"
}

 

6. Prepare Payment Option Details Request

To retrieve details for available payment options, send a payment option details request. Refer to the sample Payment Option Details Request below.

For merchants who already know payment option details, this step is optional.

Pre Requisite
1. Payment Token from Payment Token API
2. CategoryCode & GroupCode from Payment Option API

📘

Please refer to: Payment Option Details API Request

{
	"categoryCode": "DPAY",
	"groupCode": "EWALLET",
	"paymentToken": "kSAops9Zwhos8hSTSeLTUZhBH+ZITpUoBizPNDc+wcpzY5UL2WSG9ky0YSUNT8qJGNWjmT3oMAiGqa1banJ6MGkXkxDM41GKEAw/s0yiR05aTx1QTz7946Wewm7amkCx",
	"locale": "en",
	"clientID": "30c7cf51-75c4-4265-a70a-effddfbbb0ff"
}

 

7. Receive Payment Option Details Response

To receive a payment option details response, refer to the sample payment option details response below.

📘

Please refer to: Payment Option Details API Response

{
	"totalChannel": 1,
	"name": "Wallet Payment",
	"categoryCode": "DPAY",
	"groupCode": "EWALLET",
	"iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/wallet.png",
	"channels": [{
		"sequenceNo": 10,
		"name": "GrabPay",
		"currencyCodes": null,
		"iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/grab.png",
		"logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/grab.png",
		"payment": {
			"code": {
				"channelCode": "GRAB"
			},
			"input": {
				"name": "O",
				"email": "O",
				"mobileNo": "I"
			},
			"validation": {
				"name": "^(?!\\s*$)[-a-zA-Z' ''.']{1,}$",
				"email": "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
				"mobileNo": "[0-9]+"
			}
		},
		"isDown": false
	}],
	"validation": null,
	"configuration": {
		"payment": {
			"tokenize": false,
			"tokenizeOnly": false,
			"cardTokenOnly": false,
			"immediatePayment": true
		},
		"notification": {
			"facebook": false,
			"whatsApp": false,
			"line": false
		}
	},
	"respCode": "0000",
	"respDesc": "Success"
}

 

8. Prepare Do Payment Request

Merchants must call the Do Payment API to request for payment. To prepare a payment request, refer to the sample payment request below.

Pre Requisite :
1. Payment Token from Payment Token API
2. ChannelCode from Payment Option Details API
3. For the parameter payment.data, refer to the Payment Option Details API Response parameter channels.payment.input to determine the particular data required.

📘

Please refer to: Do Payment API Request

{
	"responseReturnUrl": "https://sandbox-pgw-ui.2c2p.com/payment/4.1/#/info/",
	"payment": {
		"code": {
			"channelCode": "GRAB"
		},
		"data": {
			"name": "Terrance",
			"email": "[email protected]"
		}
	},
	"clientIP": null,
	"paymentToken": "kSAops9Zwhos8hSTSeLTUZhBH+ZITpUoBizPNDc+wcpzY5UL2WSG9ky0YSUNT8qJGNWjmT3oMAiGqa1banJ6MGkXkxDM41GKEAw/s0yiR05aTx1QTz7946Wewm7amkCx",
	"locale": "en",
	"clientID": "30c7cf51-75c4-4265-a70a-effddfbbb0ff"
}

 

9. Receive Do Payment Response

To receive a payment response, refer to the the sample payment response below.

📘

Please refer to: Do Payment API Response

{
	"data": "https://demo2.2c2p.com/2C2PFrontEnd/storedCardPaymentV2/MPaymentProcess.aspx?token=P/ybhPZgXlaCqyXnrrhW63w6/+fSi6pJjLaWR9ZQOmBiRCOf/E+DR1G2+wgpyiB0",
	"channelCode": "GRAB",
	"respCode": "1001",
	"respDesc": "Redirect to authenticate ACS bank page."
}

 

10. Redirect to Third Party Processor

Redirect to the appropriate third party processor via browser. The third party processor details are returned through the following parameters from the Do Payment API response. **Failure or rejection of the call for the respCode parameter will terminate the process.**

parameter from Do Payment ResponseDescription
dataThird party URL endpoint
respCodeIndicates redirection method. For more details, refer to Payment Process Flow

 

11. Receive Payment Response via backend API

📘

Please refer to: Payment Response - Backend API

The parameter "backendReturnUrl" that was previously sent via Payment Token Request is the merchant endpoint that will receive the backend notification. If the parameter "backendReturnUrl" is not set, the system will obtain the backend return URL from the merchant profile set in 2C2P's merchant portal by default.

{
  "merchantID": "458458000000000",
  "invoiceNo": "220920084480",
  "cardNo": "",
  "amount": 120.0,
  "userDefined1": "",
  "userDefined2": "",
  "userDefined3": "",
  "userDefined4": "",
  "userDefined5": "",
  "currencyCode": "MYR",
  "cardToken": "",
  "recurringUniqueID": "",
  "tranRef": "3257744",
  "referenceNo": "3135918",
  "approvalCode": "",
  "eci": "  ",
  "transactionDateTime": "20200922101226",
  "agentCode": "CITI",
  "channelCode": "GP",
  "issuerCountry": "",
  "installmentMerchantAbsorbRate": null,
  "respCode": "0000",
  "respDesc": "Transaction is successful."
}

 

12. Receive Payment Response via browser redirection

📘

Please refer to: Payment Response - Frontend API

The parameter "frontendReturnUrl" that was previously sent via Payment Token Request is the merchant page that customers will be redirected to. If the parameter "frontendReturnUrl" is not set, the system will obtain the front end return URL from the merchant profile set in the 2C2P merchant portal by default. Refer to the sample response returned below.

{
	"invoiceNo": "220920084480",
	"channelCode": "CC",
	"respCode": "2000",
	"respDesc": "Transaction is completed, please do payment inquiry request for full payment information."
}

 

13. Payment Inquiry to retrieve payment information

For merchants who do not implement "Receive Payment Response via backend API", you are required to call to the Payment Inquiry API to receive the payment response.

To prepare a payment inquiry request, refer to the sample payment inquiry request below.

📘

Please refer to: Payment Inquiry API Request

{
  "merchantID": "458458000000000",
  "invoiceNo": "220920084480",
  "locale": "en"
}

 

14. Receive Payment Inquiry Response

To receive a payment inquiry response, refer to the sample payment inquiry response below.

📘

Please refer to: Payment Inquiry API Response

{
  "merchantID": "458458000000000",
  "invoiceNo": "220920084480",
  "amount": 120.0,
  "userDefined1": "",
  "userDefined2": "",
  "userDefined3": "",
  "userDefined4": "",
  "userDefined5": "",
  "currencyCode": "MYR",
  "recurringUniqueID": "",
  "tranRef": "3257744",
  "referenceNo": "3135918",
  "approvalCode": "",
  "eci": "  ",
  "transactionDateTime": "20200922101226",
  "agentCode": "CITI",
  "channelCode": "GP",
  "issuerCountry": "",
  "installmentMerchantAbsorbRate": null,
  "respCode": "0000",
  "respDesc": "Transaction is successful."
}