# Drop flow

Drop flow is the standard flow for Cashfree payment gateway's Flutter SDK. In this flow, SDK provides a pre-built native screen to facilitate a quick integration with our payment gateway. Your customers can fill in the necessary details here and complete the payment.

This mode handles all the business logic and UI Components to make the payment smooth and easy to use. The SDK allows the merchant to customize the UI in terms of color coding and payment modes shown.

1200


_Drop Checkout_

# Initiating the payment

To initiate the Drop checkout payment in the SDK, follow these steps

  • Create a CFSession object.

  • Create a CFPaymentComponents object.

  • Create a CFTheme object.

  • Create a Drop Checkout Payment object.

  • Set payment callback.

  • Initiate the payment using the payment object created from [step 4]

## Create a session

The **`order_token`** created is used to authenticate the payment. The SDK exposes a class **`CFSession`** class which accepts the order_token, Environment and order ID values.

Cashfree provides two environments, one being the `sandbox` environment for developers to test the payment flow and responses and the other being `production` environment which gets shipped to production. This environment can be set in this session object.

The values for environment can be either `.SANDBOX` or `.PRODUCTION`.





## Payment Components

The Cashfree's Drop checkout allows the merchant to control the payment modes shown to their customer using the payment component parameter.



If this method is not called, by default all the payment modes are enabled.

## Set a Theme



The `CFThemeBuilder` class used to create `CFTheme` used to set the theming for Drop checkout screen.

3344


_Theme options_

## Create a Drop Checkout Payment object

  • Code Snippet to create a payment object for Drop Checkout (pre-built UI SDK)





If payment component object is not provided then all the payment modes that are enabled for the merchant account is shown.

## Setup Payment Callback

Callbacks must be registered in the "init" method of the screen that invokes the SDK.

Two methods have to be declared and their instance has to be sent to the SDK. Following is the code snippet to do the same

  • Code snippet demonstrating it's usage:





Make sure to set the callback at **init** and remove the callback at **dispose** as this also handles the activity restart cases and prevents memory leaks.




# Sample Code



You can check our demo app located [here](🔗).