Payment-method icon

PromptPay Android Component

Add PromptPay to an existing Components integration.

This page explains how to add PromptPay to your existing Android Components integration.

Choose the server-side flow that your integration uses:

Requirements

Requirement Description
Integration type Make sure that you have built a Sessions flow Android Components integration.
The minimum required version is 5.0.0.
Setup steps Before you begin, contact our Support Team to add PromptPay in your Customer Area.

Create a payment session

This step corresponds to Create a payment session in the Components integration guide.

You do not need to include any additional parameters for PromptPay in the API request.

Set up Components

This section corresponds to Set up Components in the Components integration guide.

Import the library

This step corresponds to the Import the library step of the Components integration guide.

During this step of integrating, use the following code snippets:

With Jetpack Compose

Import the library with Compose
Expand view
Copy link to code block
Copy code
Copy code
implementation "com.adyen.checkout:instant:YOUR_VERSION"
implementation "com.adyen.checkout:components-compose:YOUR_VERSION"

Without Jetpack Compose

Import the library without Compose
Expand view
Copy link to code block
Copy code
Copy code
implementation "com.adyen.checkout:instant:YOUR_VERSION"

Configure the Component

This step corresponds to Configure components of the Components integration guide.

You do not need to add specific configuration for PromptPay.

Create the checkout session

This step corresponds to the create a payment session step in the main integration guide.

Launch and show the Component

This corresponds to the Launch and show the Component step in the main integration guide.

During this step of integrating, use the following code snippets:

With Jetpack Compose

Launch the Component with Compose
Expand view
Copy link to code block
Copy code
Copy code
Component
import com.adyen.checkout.components.compose.get
// Get the payment method.
val paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.PROMPTPAY)
@Composable
private fun ComposableInstantComponent() {
// Keep a reference to this Component in case you need to access it later.
val instantPaymentComponent = InstantPaymentComponent.PROVIDER.get(
checkoutSession = checkoutSession,
paymentMethod = paymentMethod,
configuration = configuration,
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 = instantPaymentComponent,
modifier = YOUR_MODIFIER,
)

Without Jetpack Compose

Launch the Component without Compose
Expand view
Copy link to code block
Copy code
Copy code
<com.adyen.checkout.ui.core.AdyenComponentView
android:id="@+id/YOUR_COMPONENT_VIEW_ID"
.../>
// Get the payment method.
val paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.PROMPTPAY)
val instantPaymentComponent = InstantPaymentComponent.PROVIDER.get(
activity, // Your activity or fragment.
checkoutSession,
paymentMethod,
cardConfiguration,
componentCallback,
)
binding.componentView.attach(instantPaymentComponent, viewLifecycleOwner)

Test and go live

Test PromptPay payments with real payment details and small amounts.

Check the status of your test PromptPay payments in your Customer Area > Transactions > Payments.

To accept live PromptPay payments, you must contact our Support Team to add PromptPay in your live Customer Area.

See also