Cashfree Flutter Integration

Cashfree Developers
10 Oct 202315:28

Summary

TLDRThis video guides viewers through integrating the Cashfree Flutter SDK into a Flutter application. It covers key steps such as generating API keys, setting up the SDK in Android Studio, configuring iOS permissions, and creating an order using Cashfreeโ€™s API. The tutorial demonstrates how to handle payment sessions, process payments using the SDK, and manage callback responses. It also shows how to verify payment status with API calls, ensuring a complete understanding of integrating Cashfree for seamless payment solutions in mobile applications.

Takeaways

  • ๐Ÿ˜€ Ensure you have a CashFree account to start integrating their SDK into your Flutter application.
  • ๐Ÿ˜€ Generate your API keys (app ID and secret) from the CashFree Merchant Dashboard to authenticate API requests.
  • ๐Ÿ˜€ Add the CashFree Flutter SDK to your project by updating the `pubspec.yaml` file and running `flutter pub get`.
  • ๐Ÿ˜€ Configure iOS permissions for payment methods such as PhonePe, Google Pay, and others by modifying the `Info.plist` file.
  • ๐Ÿ˜€ Whitelist your app ID in the CashFree Merchant Dashboard to ensure that your app is authorized to make payment requests.
  • ๐Ÿ˜€ Always create orders from your backend and never expose your API keys in frontend code, such as mobile or web applications.
  • ๐Ÿ˜€ Use the CashFree API to create an order, including the necessary details like order ID, amount, currency, and customer information.
  • ๐Ÿ˜€ Ensure you have a unique order ID when making the order creation request to avoid conflicts.
  • ๐Ÿ˜€ Implement payment sessions in your Flutter app using the `CFSessionBuilder` and `CFWebCheckoutPaymentBuilder` classes to handle the payment flow.
  • ๐Ÿ˜€ Configure callbacks to handle successful or failed payment attempts, ensuring that your app can respond to payment status changes.
  • ๐Ÿ˜€ Use the 'Get Order Status' API to check the payment status of your order and track all transactions associated with it.

Q & A

  • What is the first step in integrating the Cashfree Flutter SDK into a Flutter application?

    -The first step is to create a Cashfree merchant account if you don't already have one. After that, you can generate the API keys by logging into the Cashfree merchant dashboard.

  • Where can I find the API keys needed for the integration?

    -You can find the API keys in the 'API Keys' section under the 'Payment Gateway' menu on the Cashfree merchant dashboard.

  • How do I install the Cashfree Flutter SDK in my Flutter project?

    -To install the SDK, you need to add the dependency to your `pubspec.yaml` file and run the command `flutter pub get` to download the SDK.

  • What permissions must be added for iOS payment integrations?

    -For iOS payment integrations, you need to add specific permissions in the `Info.plist` file of your iOS application, which are required to access payment apps like PhonePe, Paytm, or Google Pay.

  • What does whitelisting your App ID mean and why is it necessary?

    -Whitelisting your App ID means that Cashfree allows your app to make payment transactions. This is necessary to ensure that your app is authorized to process payments through the Cashfree gateway.

  • What is the purpose of the order creation API in the Cashfree integration?

    -The order creation API allows you to create an order on Cashfree's platform, which is necessary for initiating a payment session. You will need to send the order amount, currency, customer details, and other relevant information.

  • Why is it recommended to create orders from the backend instead of directly from the Flutter app?

    -It is recommended to create orders from the backend to keep your API keys secure. Exposing your App ID and Secret Key in the frontend could lead to security vulnerabilities.

  • What is the role of Postman in the Cashfree integration?

    -Postman is used to test the order creation API. You can send a request to Cashfreeโ€™s API to create an order and check the response, which includes important details like the payment session ID and order ID.

  • How do I initiate a payment in Flutter using the Cashfree SDK?

    -To initiate a payment, you need to create a session using the `CFSessionBuilder()` and set the order ID and payment session ID. Then, use `CFPaymentGateway.doPayment()` to start the payment process.

  • What are the callback functions used for in the payment process?

    -Callback functions are used to handle the success or failure of a payment. When a payment is processed, the callback will return the order ID and an error message (if any), allowing you to take appropriate actions based on the result.

Outlines

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Mindmap

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Keywords

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Highlights

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Transcripts

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now
Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
CashfreeFlutter SDKPayment IntegrationAPI KeysMobile DevelopmentFlutterOrder CreationPayment GatewayWebhooksAPI TutorialiOS Permissions