Payment Method Display
Overview
Payment Method Display widget provides merchants with a convenient and consistent way to present a payment method during checkout or emphasize a preferred option for future transactions.
Pre requisites
- Merchants are required to have an account on the CCG Platform and complete the technical integration process.
- After completing the onboarding process, merchants will receive a valid merchantId, which must be included in the header of all requests to CCG APIs, as outlined in the next section.
- Merchants must also obtain a valid JWT token for authentication purposes. This token should be included in the header of all request to CCG APIs, as outlined in the next section
Supported Experiences
Usage
Create a Session
- To create a session, send a request object specifying the customer details, configuration modes, and optionally, the payment method ID to be pre-selected.
Example Request
Headers required:
- Authorization: Bearer xxxxx
- Content-Type: application/json
- X-Upstream-Env: stage (Specify the env value, Only required for Non-Prod)
- X-Merchant-Id: (MerchantId obtained during onboarding)
{
"customer": {
"enterpriseId": "enterprise id",
"hsid": "hsid",
"firstName": "first name",
"lastName": "last name",
"email": "email",
"ssnLastFour": "1234",
"phoneNumber": {
"number": "1234567890",
"countryCode": "1"
},
"dateOfBirth": "dob",
"zip5": "23124",
"metadata": {
"patientId": "rx-patient-id"
}
},
"paymentMethod": {
"id": "payment-method-id"
},
"config": {
"modes": ["PAYMENT_METHOD_SELECT"]
}
}
More info
Note: Use hostedURL from the session request response to launch the hosted experience.
Explanation on above Request Payload
- customer: Represents the customer object.
- A valid customer identifier (e.g., hsid, enterpriseId, or rx-patientId) is required for the Payment Method Display widget to show the selected payment method.
- paymentMethod.id: Represents the payment method id that need to be display in widget.
- The customer must have at least one valid payment method saved in their wallet.
- A valid payment method ID stored in the wallet must be included in the request payload.
- If an invalid or random payment method ID is provided, the widget will display with message as "Payment Method Not Available.".
- config.modes: Defines the mode of the CCG widget, which is set to PAYMENT_METHOD_DISPLAY.
FAQs:
-
What is the PAYMENT_METHOD_DISPLAY mode? Payment Method Display widget display the details of provided payment method.
-
What happens if user requested to create a session without providing paymentMethod.id for PAYMENT_METHOD_DISPLAY mode ? The session will not be created and will return the error message: "Payment Method ID is required for mode - PAYMENT_METHOD_DISPLAY."
-
What happens if there are no saved payment methods in the customer's wallet? If the customer's wallet does not contain any saved payment methods, the screen will display the message "Payment Method Not Available.".
-
What happens if the customer does not provided a valid payment method id saved in their wallet? If the customer does not provide a valid payment method saved in their wallet, the widget will display the message "Payment Method Not Available.".
-
What happens if an invalid CCG customer identifier is used? If an invalid CCG customer identifier is provided, the session creation will fail and return a response stating that the customer identifier is missing.
-
What are the different integration patterns available for launching the PAYMENT_METHOD_DISPLAY widget? Payment Method Selector widget can be launched in various forms of CCG’s integration patterns only in EW - inline experience.