Payment
Overview
Payment widget allows customers to make payments using a card, bank account, Google Pay, or Apple Pay. It provides a user interface for entering card or bank account details or selecting a digital wallet via Google Pay or Apple Pay to complete the transaction.
When to use it
Payment widget is designed for scenarios where customers can perform payments. It provides a convenient way for merchants to allow customers to perform payments by entering the required payment-method details and complete the transaction seamlessly.
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.
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)
{
"payment": {
"amount": 1500,
"description": "Payment Description",
"merchantTransactionId": "e31de58d-cb20-40ff-ad58-b99d500z0001",
"authorizedCard": true,
"statementDescriptorSuffix": "AB1213",
"metaData": {
"orderId": "23178901",
"purpose": "Medicine Purchase"
}
},
"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"
}
},
"config": {
"modes": ["PAYMENT"],
"paymentMethodChannel": {
"card": [
"TEXT",
"EMAIL",
"WEBFORM",
"TELEPHONIC_ENTRY",
"GOOGLE_PAY",
"APPLE_PAY"
],
"bankAccount": [
"TEXT",
"EMAIL",
"WEBFORM"
]
}
},
"agent": {
"firstName": "First Name",
"lastName": "Last Name",
"userId": "msId",
"isAccessVerified": true
},
"consent": {
"merchantConsentText": "string",
"collectionTimestamp": "string",
"collectionDetails": {
"type": "WEB",
"web": {
"ipAddress": "string",
"userAgent": "string"
},
"tel": {
"inboundPhoneNumber": {
"countryCode": "string",
"number": "string"
}
}
}
}
}
More info
Note: Use hostedURL from the session response to launch the hosted experience.
Explanation on above Request Payload
- payment: Represents the payment object.
- amount: Defines the amount in cents
- description: A description of the payment.
- merchantTransactionId: Defines the unique transaction identifier for the payment transaction.
- authorizedCard: Indicates the card payment is authorized or not
- metadata: Represents the metadata object, which can include additional information about the payment; such as orderId, purpose etc.,.
- customer: Represents the customer object.
- A valid customer identifier (i.e., hsid or enterpriseId, rx-patientId etc.,) is must required for Payment Widget in order to save the payment methods after a successful payment transaction.
- If customer identifier is not provided or customer creation got failed, then session will be created to facilitate the payments alone, and the payment method will not be saved.
- config.modes: Defines the mode of the CCG widget, which is set to PAYMENT.
- config.paymentMethodChannel: Specifies the types of payment methods displayed on the customer's wallet screen when the session is created.
- config.paymentMethodChannel.card - Specifies the channels through which card payment can be performed. The available options are:
- TEXT: Make a payment through SMS.
- EMAIL: Make a payment through EMAIL.
- WEBFORM: Make a payment through WEBFORM.
- TELEPHONIC_ENTRY: Make a payment through telephonic entry.
- APPLE_PAY: Make a payment through APPLE_PAY.
- GOOGLE_PAY: Make a payment through GOOGLE_PAY
- config.paymentMethodChannel.bankAccount - Specifies the channels through which bank account payment can be performed. The available options are:
- TEXT: Make a payment through SMS.
- EMAIL: Make a payment through EMAIL.
- WEBFORM: Make a payment through WEBFORM.
- TEXT, EMAIL, and TELEPHONIC_ENTRY channels are available exclusively for agent-assisted sessions.
- WEBFORM channel is available for both agent-assisted and self-service sessions.
- WEBFORM channel is set to default to self-service sessions.
- APPLE_PAY, GOOGLE_PAY digital wallets are available exclusively for self-service sessions.
- Note: The channels specified in the request must be enabled during the onboarding process. If a channel is not enabled, it will not be available for use.
- config.paymentMethodChannel.card - Specifies the channels through which card payment can be performed. The available options are:
- agent: Applied for agent assisted sessions.
- Agents can assist customers in making payments through various channels, including TEXT, EMAIL, and TELEPHONIC_ENTRY.
- The agent must be part of the WS2 group (i.e., the AZU_PCI_Workstation_2 secure group) to process card payments from customers if the merchant has opted for ws2Check during onboarding as part of PCI compliance.
- consent: The consent object is mandatory to perform payments using a bank account.
- merchantConsentText: Defines the consentText to be displayed in the Widget. It is mandatory for both self-service and agent-assisted sessions.
- collectionDetails.type: Defines the type of collection details. The available options are:
- WEB: Represents the web collection details, applicable to only self-service sessions.
- TEL: Represents the telephonic collection details, applicable to only agent-assisted sessions.
- Note: Any one of the collection type must be provided along with its object
- collectionDetails.type.web: Represents the web collection details.
- ipAddress: Defines the IP address of the customer.
- userAgent: Defines the user agent of the customer.
- Note: collectionsDetails.type.web is applicable only for self-service sessions and can be captured by CCG widget while perform bank account payment
- collectionDetails.type.tel: Represents the telephonic collection details.
- inboundPhoneNumber: Defines the inbound phone number of the customer.
- countryCode: Defines the country code of the phone number.
- number: Defines the phone number of the customer.
- Note: collectionsDetails.type.tel is applicable only for agent-assisted sessions and can be provided by agent while creating the session to perform the bankAccount payment.
- inboundPhoneNumber: Defines the inbound phone number of the customer.
FAQs:
-
What is PAYMENT mode? The PAYMENT mode is a feature of the CCG widget that allows customers to make payments using credit/debit cards, bank accounts, or digital wallets such as GOOGLE_PAY and APPLE_PAY. It provides a user interface for securely entering payment method details and completing the payment.
-
When should PAYMENT mode be used? The PAYMENT mode is designed for scenarios where customers perform payments on the CCG platform, enabling quicker transactions during checkout.
-
What additional options are available for agents using PAYMENT mode? Agents can utilize additional channels to assist the customers with payment method entry, using WEBFORM for on-screen entry, EMAIL for sending a link via email, TEXT for sending a link via text, TELEPHONIC_ENTRY for capturing the PCI complaint data securely.
-
What are the prerequisites for merchants to use PAYMENT mode? Merchants are required to have an account on the CCG Platform and complete the technical integration process. Additionally, they must obtain a valid merchantId and ensure that payment methods are configured with the appropriate channels during the onboarding process.
-
What are the different integration patterns available for launching the PAYMENT widget? The PAYMENT widget can be launched in various forms of CCG’s integration patterns such as hosted, modal, inline, drawer experiences.
-
Can PAYMENT mode allows to save the payment-method details? YES. PAYMENT mode allows saving the payment method details to the customer's wallet only when the transaction is successful, provided the user selects the "Save for future use" checkbox while submitting the payment.