Payment-method icon

PayPal Drop-in integration

Add PayPal to an existing Android Drop-in integration.

Our Android Drop-in renders PayPal in your payment form, and redirects the shopper to complete the payment. As with other redirect payment methods, you need to check the payment result after the shopper returns to your app.

Requirements

Requirement Description
Integration type Make sure that you have built your Drop-in integration.
Setup steps Before you begin, complete the PayPal setup steps.

Show PayPal in your payment form

Drop-in uses the countryCode and the amount.currency from your /paymentMethods request to show the available payment methods to your shopper.

To show PayPal in your payment form, specify in your /paymentMethods request:

When the shopper proceeds to pay, Drop-in returns the paymentComponentData.paymentMethod. Pass the paymentComponentData.paymentMethod to your server — these are the shopper details that you need to make the payment.

Make a payment

The main optional payment request parameters to consider are lineItems and paypalRisk fields.

Amounts in Hungarian Forints (HUF)

In case of a transaction in HUF, PayPal expects the transaction amount and the line item amounts to be rounded to the nearest whole amount. For example, an amount of HUF 74499 must be rounded to HUF 74500. PayPal also expects the rounded line item amounts to add up to the rounded transaction amount.

If you do not round the amounts, Adyen will do that. However, a discrepancy can occur between the transaction amount and the total of the line item amounts. When this happens, PayPal doesn't accept the transaction. To avoid that problem, we recommend that you round all HUF amounts yourself and check that they add up.

PayPal risk fields

PayPal requires marketplaces and also merchants in specific verticals to send information about the context of the transaction, for risk mitigation purposes.

Not all businesses need to send risk fields. Contact your PayPal account manager to verify.

Common PayPal risk fields for marketplaces

As an example, the following table shows the most common paypalRisk fields that marketplaces need to send. It is possible that PayPal requires you to send more, less, or other fields.

PayPal risk field Description Data type/format Example
Sender profile fields:
sender_account_id The unique identifier of the buyer's account on the marketplace platform. String, alphanumeric A12345N343
sender_first_name The buyer's first name registered with their marketplace account. String, alphanumeric John
sender_last_name The buyer's last name registered with their marketplace account. String, alphanumeric Smith
sender_email The buyer's email address registered with their marketplace account. String in E.123 email address format john.smith@email.com
sender_phone The buyer's phone number registered with their marketplace account. String in E.123 telephone number format, national notation 0687164125
sender_address_zip US only. The buyer's postal code registered with their marketplace account. String, alphanumeric 60661
sender_country_code The buyer's country registered with their marketplace account. String in two-character ISO-3166-1 alpha-2 country code format. Exception: QZ (Kosovo). US
sender_create_date The date that the buyer's marketplace account was created. String in ISO 8601 date format 2012-12-09T19:14:55.277-0:00
sender_signup_ip The IP address that the buyer used when signing up on the marketplace platform. String in IPv4 or IPv6 format 213.52.172.120
sender_popularity_score If you need to provide this field, ask your PayPal account manager for instructions. String, possible values: high, medium, low high
Receiver profile fields:
receiver_account_id The unique identifier of the seller's account on the marketplace platform. String, alphanumeric AH00000000000000000000001
receiver_create_date The date that the seller's marketplace account was created. String in ISO 8601 date format 2012-12-09T19:14:55.277-0:00
receiver_email The seller's email address registered with their marketplace account. String in E.123 email address format john.smith@email.com
receiver_address_country_code The seller's country registered with their marketplace account. String in two-character ISO-3166-1 alpha-2 country code format. Exception: QZ (Kosovo). US
business_name The seller's business name registered with their marketplace account. String, alphanumeric
recipient_popularity_score If you need to provide this field, ask your PayPal account manager for instructions. String, possible values: high, medium, low high
Sender-Receiver interaction:
first_interaction_date The date of the first interaction between the buyer and the seller. The marketplace defines what an interaction is. For example, a payment transaction, a buyer choosing to follow a seller, and so on. String in ISO 8601 date format 2012-12-09T19:14:55.277-0:00
Transaction information:
txn_count_total The total number of transactions that the buyer has made on the platform. These can be PayPal payments, or payments using a different payment method. Number
Payment Flow/Model/Type:
vertical If the seller is active in more than one business vertical, this field indicates the vertical that applies to the transaction. String, alphanumeric Household goods
transaction_is_tangible Indicates if the transaction is for tangible goods. Boolean in string format. Possible values: 0 (false), or 1 (true) 0

Make a payment request

  1. From your server, make a POST /payments request, specifying:

    Parameter name Required Description
    paymentMethod -white_check_mark- The paymentComponentData.paymentMethod from your client app.
    channel The platform where a payment transaction takes place. Set this to Android.
    returnUrl The URL to where the shopper should be redirected back to after they complete the payment. Get this URL from the Component in the RedirectComponent.getReturnUrl(context).
    lineItems Price and product information about the purchased items. For each item, you only need to send quantity, description, itemCategory, sku, amountExcludingTax, and taxAmount.
    The allowed values for itemCategory are:
    • DIGITAL_GOODS: goods that are stored, delivered, and used in electronic format.
    • PHYSICAL_GOODS: tangible goods that can be shipped with proof of delivery.
    • DONATION: a contribution or gift for which no goods or services are exchanged, usually to a not-for-profit organization.
    additionalData.paypalPairingId Only if you use the Magnes SDK and pass the same pairing ID to Magnes and Adyen.
    A unique ID determined by you, to link a transaction to a Magnes PayPal risk session.
    PayPal refers to this ID as pairing ID, CMID, or tracking ID.
    additionalData.paypalRisk Only for marketplaces and for merchants in specific verticals.
    A stringified additional_data array with the PayPal risk fields that PayPal told you to send. Each array item consists of:
    • key: the name of the PayPal risk field.
    • value: the value of the PayPal risk field for the current transaction.
    Contact your PayPal account manager to learn which PayPal risk fields apply in your case and what happens if you do not populate a specific field. For a list of example fields, refer to the common risk fields for marketplaces.