| Platforms | Role |
|---|
| Channel | The ordering platform integrating with Deliverect Pay Dpay. Initiates the tokenization and payment requests. |
| BasisTheory Proxy | Token vault proxy. Receives PCI data from the channel, encrypts it, and forwards it to Dpay. |
| Deliverect Pay (Dpay) | Deliverect's payment orchestration layer. Manages tokens, verification, and fund acquisition. |
| PSP | The underlying Payment Service Provider that verifies cards and acquires funds. |
%%{init: { "theme": "base", "themeVariables": { "fontSize": "18px", "background": "transparent", "actorBkg": "#038851", "actorTextColor": "#ffffff", "actorBorder": "#026139", "actorLineColor": "#94a3b8", "signalColor": "#64748b", "signalTextColor": "#059669", "noteBkgColor": "#e6f4ee", "noteTextColor": "#02502f", "noteBorderColor": "#038851", "activationBkgColor": "#c6ebdc", "activationBorderColor": "#026139", "sequenceNumberColor": "#ffffff" }, "sequence": { "useMaxWidth": true, "actorMargin": 70, "width": 150, "height": 60, "boxMargin": 12, "noteMargin": 14, "messageMargin": 50, "diagramMarginX": 20, "diagramMarginY": 20, "actorFontSize": 18, "actorFontWeight": 700, "noteFontSize": 15, "noteFontFamily": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", "messageFontSize": 16, "messageFontWeight": 700, "noteAlign": "left", "mirrorActors": false } }}%%
sequenceDiagram
autonumber
participant CHANNEL as Channel
participant PROXY as BasisTheory Proxy
participant DPAY as Deliverect Pay
participant PSP as PSP
Note over CHANNEL,PSP: ๐ญ โ ๐ง๐ผ๐ธ๐ฒ๐ป๐ถ๐๐ฒ ๐ฎ ๐ฐ๐ฎ๐ฟ๐ฑ<br/>โน๏ธ Deliverect uses BasisTheory as a token vault, surfacing a proxy<br/>to channels. The proxy securely receives PCI data and passes<br/>encrypted data to the PSP. Custom hostname:<br/>https://basistheory.staging.deliverect.com
CHANNEL->>+PROXY: create token
Note right of CHANNEL: POST https://basistheory.staging.deliverect.com<br/>{<br/>#160;#160;"gatewayProfileId": "gateway-1",<br/>#160;#160;"channelLinkId": "channelLink-1",<br/>#160;#160;"customerId": "customer-1",<br/>#160;#160;"payment_method": {<br/>#160;#160;#160;#160;"number": "4111111111111111",<br/>#160;#160;#160;#160;"expiration_month": 3,<br/>#160;#160;#160;#160;"expiration_year": 2030,<br/>#160;#160;#160;#160;"cvc": "737"<br/>#160;#160;}<br/>}
PROXY->>+DPAY: create token
DPAY->>+PSP: verify card
PSP-->>-DPAY: Result
DPAY-->>-CHANNEL: Token
deactivate PROXY
Note right of CHANNEL: 200 OK<br/>{<br/>#160;#160;"id": "token-1",<br/>#160;#160;"accountId": "account-1",<br/>#160;#160;"customerId": "customer-1",<br/>#160;#160;"card": {<br/>#160;#160;#160;#160;"brand": "visa",<br/>#160;#160;#160;#160;"last4": 1234,<br/>#160;#160;#160;#160;"expirationYear": 2030,<br/>#160;#160;#160;#160;"expirationMonth": 10<br/>#160;#160;},<br/>#160;#160;"provider": "basis_theory",<br/>#160;#160;"providerId": "provider-id",<br/>#160;#160;"status": "verified | failed",<br/>#160;#160;"verification": {<br/>#160;#160;#160;#160;"paymentId": "payment-1",<br/>#160;#160;#160;#160;"providerTokenIntentId": "token-intent-1"<br/>#160;#160;},<br/>#160;#160;"gateway": 1234,<br/>#160;#160;"paymentGatewayToken": "gateway-token"<br/>}
Note over CHANNEL,PSP: ๐ฎ โ ๐๐ถ๐๐ ๐ฐ๐๐๐๐ผ๐บ๐ฒ๐ฟ ๐๐ผ๐ธ๐ฒ๐ป๐<br/>โน๏ธ A customer may have multiple tokenized cards. An endpoint lists<br/>these tokens, allowing the customer to choose the card they<br/>want to use for payment.<br/>The customerId is the one sent when creating the token.
CHANNEL->>+DPAY: list customer tokens
Note right of CHANNEL: GET /pay/channel/{channelLinkId}/tokens/customer/{customerId}
DPAY-->>-CHANNEL: Tokens
Note right of CHANNEL: 200 OK<br/>{<br/>#160;#160;"total": 1,<br/>#160;#160;"page": 1,<br/>#160;#160;"size": 50,<br/>#160;#160;"items": [<br/>#160;#160;#160;#160;{<br/>#160;#160;#160;#160;#160;#160;"id": "token-1",<br/>#160;#160;#160;#160;#160;#160;"accountId": "account-1",<br/>#160;#160;#160;#160;#160;#160;"customerId": "customer-1",<br/>#160;#160;#160;#160;#160;#160;...<br/>#160;#160;#160;#160;}<br/>#160;#160;]<br/>}
Note over CHANNEL,PSP: ๐ฏ โ ๐ฅ๐ฒ๐พ๐๐ฒ๐๐ ๐ฎ ๐ฝ๐ฎ๐๐บ๐ฒ๐ป๐ ๐๐๐ถ๐ป๐ด ๐ฎ ๐๐ผ๐ธ๐ฒ๐ป<br/>โน๏ธ Deliverect Pay surfaces an endpoint for channels to request a payment.<br/>It supports various modes, one being "token", where a verified<br/>token acquires funds. Capture modes:<br/>ยท immediate โ capture funds instantly (default)<br/>ยท manual โ pre-authorize now, capture later
CHANNEL->>+DPAY: request payment
Note right of CHANNEL: POST /pay/channel/{channelLinkId}/payments/request<br/>{<br/>#160;#160;"gatewayProfileId": "gateway-1",<br/>#160;#160;"mode": {<br/>#160;#160;#160;#160;"type": "token",<br/>#160;#160;#160;#160;"tokenId": "token-1"<br/>#160;#160;},<br/>#160;#160;"captureMode": "immediate",<br/>#160;#160;"amount": 1000,<br/>#160;#160;"currency": "USD",<br/>#160;#160;"payer": {<br/>#160;#160;#160;#160;"name": "John Doe",<br/>#160;#160;#160;#160;"reference": "customer-1"<br/>#160;#160;}<br/>}
DPAY->>+PSP: acquire
PSP-->>-DPAY: Result
DPAY-->>-CHANNEL: Payment
Note right of CHANNEL: 200 OK<br/>{<br/>#160;#160;"paymentId": "payment-1",<br/>#160;#160;"paymentStatus": "authorized"<br/>}