Payen
Message Flow
For a high-level overview of HPC, see Introduction. For a hands-on integration tutorial, follow the Quick Start.
The following sequence diagram outlines the complete flow for a typical merchant payment form, from user interaction through to the Direct API response.
A more detailed description for each of the steps:
- The user indicates they wish to make a payment.
- The payment page displays the form with placeholder containers for the HPC components.
- The
OrchestratorMerchantclass is initialized with container IDs and any customization options. - HPC initializes the components into their placeholder containers, and each raises an
hpc.initializationCompleteevent. - The user interacts with the form, filling in fields.
- As HPC components are filled in, validation events are raised on their respective containers to indicate current validity. Card brand detection events may also fire for the card number field.
- The user indicates they are finished and wishes to start the transaction (e.g., clicks Pay).
- The payment page calls
startSession()on the orchestrator, triggering tokenization of all HPC component values. - The orchestrator returns a session key for each configured field as a
Map. - The payment page POSTs the session keys and any other form data to the merchant's server.
- The merchant backend calls the Payen Direct API authorization endpoint, substituting session keys in place of actual card data. See Authorization for request structure.
- The Direct API returns the transaction result to the merchant backend.
info
As this deals with PCI-sensitive data, ensure you never log or store session keys persistently, and use HTTPS transport for your payment page. See OrchestratorMerchant API for security guidance.