Comment on page

Payment flows

This section is coming soon!
This chapter will cover the payment flows available with Hyperswitch. Please reach out to us to learn more about the payment flows supported!

Payments flow

There are multiple stages in a Payment flow depending on the payment methods that are involved. Considering an one-time payment method where there was no redirection involved, the following stages form the Payment flow:
a) Creating a Payment: When your customer wants to checkout, create a payment by hitting the payments/create endpoint. Fetch and store the payment_id and client_secret
b) Loading the SDK: After your customer checks out, load the Hyperswitch SDK by initiating it with the client_secret and publishable_key
c) SDK being rendered: After you initiate the SDK, the SDK makes several API calls involving the /sessions and /payment_methods endpoints to load relevant payment methods and any saved cards associated with the customer
d) Customer enters the payment method data: After the SDK is fully rendered, your customer would choose a payment method and enter the relevant information and click pay
e) Confirming the payment: After the customer clicks pay, the SDK calls the payments/confirm endpoint with the customer's payment method details and post response, it displays the payment status
Here's a more detailed version of the payment flow:
Payments Lifecycle

How does Payment flow vary across Payment methods?

Customer Action
Direct/Redirect flows
Payment- finalized immediately
Payment- finalized later
Customer action required before payments/confirm
Within Hyperswitch SDK
  • Non 3DS Cards
  • Bank Debits like ACH Debit, BACS Debit, SEPA Debit
Customer action required before payments/confirm
3rd party Redirect/SDK
  • Wallets like Apple Pay, Google pay, Paypal, AliPay
  • BNPL like Klarna, Afterpay, Affirm
Customer action required after payments/confirm
3rd party Redirect
  • 3DS cards
  • Bank Redirects like iDeal, giropay, eps
  • Bank Transfers like ACH Transfer, SEPA Transfer, BACS Transfer, Multibanco
  • Crypto wallets like Cryptopay

Use-cases supported by Hyperswitch's Payments flow:

Manage multiple payment gateways for your E-commerce website to enhance customer experience and reduce cart abandonment.
Place a hold on your customers’ cards by authorizing the transaction now and capturing the amount partially or fully later in one go or multiple times once you complete the shipment/service
Process payments and payouts for multiple sub-merchants on your platform by creating and managing multiple merchant_ids at Hyperswitch under your Org
Manage payments for your multiple business units seamlessly under one Hyperswitch account by distributing them across different profiles under your Hyperswitch account
Coordinate payments across various channels, including in-store, online, and mobile, for a unified shopping experience.
Handle bookings, reservations, and payments across different platforms and currencies for hotels, airlines, and travel agencies
Managing recurring payments for subscription-based businesses with various billing cycles.
Facilitate secure and efficient transactions for healthcare services, insurance claims, and medical equipment purchases.
Handle microtransactions, in-game purchases, and virtual currency exchanges across gaming platforms with ease
Manage tuition payments, course fees, and donations across different educational platforms.
Coordinate payments for mobile plans, internet services, and device purchases across diverse markets.
Facilitate donations and managing funds from various sources, including online platforms and traditional channels.

What are PaymentIntent and PaymentAttempt objects and how do they work in Hyperswitch?

Hyperswitch uses the PaymentIntent object to track the status of a payment initiated by you. Since, Hyperswitch enables retrying a single payment multiple times across different processors until a successful transaction, we track each of these payment attempts through separate PaymentAttempt objects.
While PaymentIntent and PaymentAttempt have their own state machines, the various states in PaymentAttempt are also constrained by their respective mapping to the PaymentIntent statuses.
PaymentIntent state machine:
The following is an abridged version of the PaymentIntent state machine flow that covers majority of the above payment use-cases.
PaymentAttempt state machine:
The following is an abridged version of the PaymentAttempt state machine flow that covers majority of the above payment use-cases.