Search

Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Dotpay for Android

Learn how to add Dotpay to an existing Android Drop-in or Components integration.

Drop-in integration

Our Android Drop-in solution supports Dotpay online banking payments without any additional configuration. To know whether a payment is successful, you need to set up notifications.

Components integration

To complete a Dotpay online banking payment on your Android app, you can use the following Android Components:

  • Dotpay Component: Presents the list of issuers (banks) and collects the issuer that the shopper selected.
  • Redirect Component: Redirects the shopper to the issuer's website or to another app.

It is also possible to handle one or both of these steps on your own, without using the Component. In that case, you'd follow the corresponding steps for adding Dotpay to an API-only integration.

The steps for integrating Android Components are similar for all supported payment methods, as described on the Android Components integration page. Below you will find links to these general steps, and for each step the details that are specific for adding Dotpay to your existing Android Components integration.

Installing Android Components

Android Components are available through jcenter; you only need to add the Gradle dependency.

  1. Import the Dotpay Component by adding it to your build.gradle file.

    implementation "com.adyen.checkout:dotpay-ui:<latest-version>"
  2. To use the Redirect Component, add the following to your build.gradle file (if you haven't done so already).

    implementation "com.adyen.checkout:redirect:<latest-version>"

You can check for the latest release version on GitHub.

Step 1: Get available payment methods

  1. Refer to the general instructions for step 1.

  2. For Dotpay, use the following specifics:

    • When you make a POST request to the /paymentMethods endpoint, specify:

      • countryCode: PL.
      • amount.currency: PLN.

      The response should now include type: dotpay.

Step 2: Initialize Components

  1. Refer to the general instructions for step 2.

  2. For Dotpay, use the following specifics:

    • When you deserialize the /paymentMethods response, from the result get the object with type: dotpay.

    • Create a dotpayConfiguration object:

      val dotpayConfiguration =
       DotpayConfiguration.Builder(Locale.getDefault(), resources.displayMetrics, Environment.TEST)
       .build()

      When you're ready to go live, change the environment to LIVE and change this to a location closest to where your shoppers are, for example EUROPE. See possible environment values on GitHub.

    • Initialize the Dotpay Component by passing the payment method object dotpay and the configuration object dotpayConfiguration.

      val dotpayComponent = DotpayComponent.PROVIDER.get(this@YourActivity, dotpay, dotpayConfiguration)
    • Add the Dotpay Component view to your layout.

      <com.adyen.checkout.dotpay.DotpaySpinnerView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"/>
    • Attach the Dotpay Component to the view, to start getting your shopper's payment details.

      DotpaySpinnerView.attach(dotpayComponent, this@YourActivity)
    • Make sure the updates you receive when shoppers enter their Dotpay payment details, are passed to your server.

      dotpayComponent.observe(this@coreActivity, Observer {
       if (it?.isValid == true) {
           // Pass the `it.data` to your server to send a /payments request
       }
      })

Step 3: Make a payment

  1. Refer to the general instructions for step 3.

  2. For Dotpay, use the following specifics:

    • When you make a POST request to the /payments endpoint, specify:

      • returnUrl: URL to your website or app where the shopper should be taken back to after the redirect. Get this URL from the Component in the RedirectComponent.getReturnUrl(context).
    • In the /payments response, note the following:

      • resultCode: RedirectShopper.
      • paymentData: Keep a copy, because you will submit it later.
      • action: Object that you need to pass in the next step if you use the Redirect Component.
      • action.url: Redirect URL to the website or app of the shopper's bank. You need to specify this URL in the next step if you do not use the Redirect Component.

Step 4: Perform additional actions on your client app

  1. Refer to the general instructions for step 4.

  2. For Dotpay, use the following specifics:

Step 5: Submit additional payment details

  1. Refer to the general instructions for step 5.

  2. For Dotpay, use the following specifics:

    • When you make a POST request to the /payments/details endpoint, provide the payment details:

      • If you used the Redirect Component, pass the actionComponentData.details that the observer received.
      • If you handled the redirect on your own, pass the paymentData object you received in the /payments response, and pass details.payload containing the URL decoded payload that was appended to the return URL. Refer to step 6 of adding Dotpay to an API-only integration.

Step 6: Present the payment result

If you do not receive an action object from your last API request, this means that the payment has been completed.
Refer to Dotpay result codes to see what resultCode values you can receive for Dotpay and how you can communicate the result to the shopper.

Dotpay result codes

Dotpay is a redirect payment flow. At the end of this flow, we send you a response with a resultCode to inform you of the current state of the payment.

The resultCode values you can receive for Dotpay are:

  • Authorised: The payment was authorised. You will receive the funds in 2-3 days. Inform the shopper that the payment was successful.
  • Cancelled: The shopper cancelled the payment before it was completed, for example while on their bank's website or app. Ask the shopper whether they want to continue with the order, or request that they select a different payment method.
  • Refused: The payment was refused by the shopper's bank. Ask the shopper to try the payment again using a different payment method or card.
  • Pending: The shopper has completed the payment but the final result is not yet known. It may take minutes or hours to confirm this. Inform the shopper that you've received their order, and are waiting for the payment to be completed.

To find out more about result codes and how you can action them, see Result codes.

Dotpay notifications

Our notifications are webhooks informing you of important events related to your account. Accepting notifications is required for Dotpay online banking. In most cases, the resultCode you receive at the end of the redirect payment flow already indicates whether the payment was authorised. In other cases, we can only inform you of the outcome of a payment by means of a notification. You'll need to rely on notifications when:

  • The resultCode is Pending or Received.
  • You didn't receive a resultCode, for example because the shopper failed to return to your website or app after completing the payment.
  • The shopper cancelled the payment while on their bank's website or app, but we didn't receive this information. This happens sometimes with Dotpay.

To inform you of the outcome of a payment, we send you a notification with:

  • eventCode: AUTHORISATION.
  • pspReference: Adyen's unique reference associated with the payment request.
  • success: Indicates the outcome of the payment. Possible values:

    • true: The payment was authorised.
    • false: The payment failed.

AUTHORISATION is just one of the events that trigger a notification. Refer to Notification webhooks to accept notifications and learn about their structure and content.

Testing Dotpay payments

Before accepting live Dotpay online banking payments, test your integration using test.adyen.com endpoints. You won't need specific test credentials to do test payments.

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

See also