Payment Flows
DMG Charge SDK manages the payment flow end-to-end. It allows users to manage charging a payment instrument for an order using a flow that is part of an orchestration. The API uses the OpenAPI 3.0 specification, and it includes various endpoints for creating, validating, authorising, and completing a charge, as well as for querying the status of a charge. Overall, the API allows users to manage the payment process for an order and to query the status of a charge at any point in its lifecycle.
The payment flow can be implemented as one of the following:
- Payment flow
- Encrypted payment method flow
Use the Charge API to create a charge and process a payment. This process includes creating a new order as an initial step.
Payment Flow
This flow is used where the payments are handled end-to-end via the SDK frontend, the merchant handles the success/failed response after payment has been processed.
Create an order as the first step using the Order Token endpoint. Please note calling this endpoint does not invoke the Charge SDK.
Process the payment via one of the following methods:
- If you are hosting your own payment page, then use the Charge API to submit the payment
- If you integrate the DMG Charge SDK, initiate the end-to-end payment flow via the SDK
The webhook leg — not the frontend event or redirect — is how your backend should confirm the payment outcome. For the complete sequence including webhooks, retries, and settlement, see the End-to-End Payment Flow guide.
Encrypted Payment Method Flow
This flow provides the merchant an encrypted blob within a pre-built Charge API payload to ensure PCI compliance.
It is used for generating an encrypted payment payload which the merchant will collect and pass through the merchant backend via the Charge API. This flow applies only to certain credit card processing configurations — DataMesh will advise during onboarding whether it applies to yours.
Launch the Charge Client SDK to collect details of payment method from customers
Client SDK will encrypt the details and return the encrypted payload
Use the Charge API directly to initiate the payment flow using the encrypted payload