How you add UPI depends on your integration.
Choose the server-side flow that your integration uses:
Start integrating with Sessions flow Component
Choose your versionRequirements
Requirement | Description | |
---|---|---|
Integration type | Make sure that you have an existing Sessions flow Android Components integration. | |
Checkout API | Make sure that you use Checkout API v68 or later. | |
Setup steps | Before you begin, add UPI in your Customer Area. |
Add additional parameters to your /sessions request
You do not need to add any parameters when you create a payment session.
Import the Component for UPI
To import the library and include the module for UPI.
implementation "com.adyen.checkout:upi:YOUR_VERSION" implementation "com.adyen.checkout:components-compose:YOUR_VERSION"
Add additional configuration for UPI
Add a configuration object with the following parameters:
Parameter | Required | Description |
---|---|---|
setSubmitButtonVisible | Set if you want the submit button to be visible. |
{ .setSubmitButtonVisible(value) }
Launch and show the Component for UPI
To create the Component for UPI, use the UPIComponent
class.
import com.adyen.checkout.components.compose.get // Get the payment method. val paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.SCHEME) @Composable private fun ComposableUPIComponent() { // Keep a reference to this Component in case you need to access it later. val upiComponent = UPIComponent.PROVIDER.get( checkoutSession = checkoutSession, paymentMethod = paymentMethod, configuration = checkoutConfiguration, componentCallback = callback, // This key is required to ensure a new Component gets created for each different screen or payment session. // Generate a new value for this key every time you need to reset the Component. key = "YOUR_UNIQUE_KEY_FOR_THIS_COMPONENT", ) // This is your composable, a wrapper around our xml view. AdyenComponent( component = upiComponent, modifier = YOUR_MODIFIER, ) }
Test and go live
Depending on your account setup, you may have access to the UPI simulator which you can use to test your UPI integration. Contact your Account Manager or our Support Team if you have questions about the simulator.
You can also use your personal account on a UPI app to test your integration by making live payments with a low value.