Redirect customers to a Payonify-hosted payment page. Best for quick integration with minimal frontend work.
How It Works
sequenceDiagram
participant Customer
participant YourWebsite
participant YourServer
participant Payonify
%% Initial Checkout Flow
Customer->>YourWebsite: Clicks "Checkout" button
YourWebsite->>YourServer: Request to initiate checkout
YourServer->>Payonify: POST /v1/checkout/sessions
Payonify-->>YourServer: Return session with checkout URL (and ID)
YourServer->>YourServer: **Store** initial checkout session (status: requires_payment_method)
YourServer-->>YourWebsite: Return checkout URL
YourWebsite->>Customer: Redirect to Payonify checkout
%% Payment and Webhook
Customer->>Payonify: Enter payment details & authorize
Payonify-->>Customer: Show confirmation/processing
Note right of Payonify: Payment Processing in background
Payonify->>YourServer: Send webhook (checkout.session.{status})
activate YourServer
YourServer->>YourServer: **Retrieve stored checkout session**
YourServer->>YourServer: **Update** session status (e.g., succeeded/failed)
deactivate YourServer
Payonify->>Customer: Redirect to success_url
%% Return to Your Website with alt/else logic
Customer->>YourWebsite: Return to your site
YourWebsite->>YourServer: Retrieve checkout session (ID from URL)
alt Webhook updated status received (succeeded/failed)
YourServer->>YourServer: Check stored status (it is already updated)
YourServer-->>YourWebsite: Fulfill order
YourWebsite-->>Customer: **Show final result of checkout**
else Webhook not received (Status is still requires_payment_method)
YourServer->>Payonify: GET /v1/checkout/sessions/SESSION_ID
Payonify-->>YourServer: Return session with payment_status
YourServer->>YourServer: Update stored session with new status
YourServer-->>YourWebsite: Fulfill order
YourWebsite-->>Customer: **Show final result of checkout**
end