Flutter with Node Backend
Integrate hyper SDK to your Flutter App using hyperswitch-node
Last updated
Was this helpful?
Integrate hyper SDK to your Flutter App using hyperswitch-node
Last updated
Was this helpful?
Before following these steps, please configure your payment methods .
Android 5.0 (API level 21) and above
8.5+
8.8+
iOS 13.0 and above
CocoaPods
npm
Follow the section.
flutter_hyperswitch
libraryAdd flutter_hyperswitch
to your pubspec.yaml
file
Run the following command to fetch and install the dependencies.
Initialize a Payment Session by passing the clientSecret to the initPaymentSession
To display the Payment Sheet, integrate a "Pay Now" button within the checkout page, which, when clicked, invokes the presentPaymentSheet()
method and handles the payment response.
Consider the below function, it invokes presentPaymentSheet
and handles payment results.
Please retrieve the payment status from the Hyperswitch backend to get the terminal status of the payment. Do not rely solely on the status returned by the SDK, as it may not always reflect the final state of the transaction.
Initialise Hyper
onto your app with your publishable key with the Hyper
constructor. To get a PublishableKey please find it .
Make a network request to the backend endpoint you created in the . The clientSecret returned by your endpoint is used to complete the payment.
Congratulations! Now that you have integrated the Flutter SDK, you can the payment sheet to blend with the rest of your app.