Vaulting a PayPal account will allow you to charge the account in the future without requiring your customer to re-authenticate with PayPal.

When the customer completes the PayPal authentication flow, the PayPal interface closes and returns the nonce to you in your Braintree.PaymentMethodNonceListener. At this point in time a PayPal pre-approved payment is created between you and the customer, displayed in the customer's account profile on PayPal.com. Send the nonce to your server where it can be used to create a transaction.

The vaulted payment flow supports the following features:

  • PayPal One Touch™
  • Two factor authentication support (currently only for US, UK, CA, DE, AT, and AU)

Typical use cases for the vaulted payment flow:

  • Faster payments for repeat customers
  • Subscriptions
  • Recurring billing (e.g. automatic top-up or usage based charges)

Collecting device data

Collecting device data from your customers is required when initiating non-recurring transactions from Vault records. Collecting and passing this data with transactions will help reduce decline rates.

BraintreeData enables you to collect data about a customer's device and correlate it with a session identifier on your server.

Gradle

In your build.gradle, add the following:

Groovy
Copy
Copied
dependencies {
  compile 'com.braintreepayments.api:data:1.+'
}

Maven

XML
Copy
Copied
<dependency>
    <groupId>com.braintreepayments.api</groupId>
    <artifactId>data</artifactId>
    <version>[1.0.0,)</version>
</dependency>

JAR

Download the latest JAR from Maven Central and include it in your project.

Android setup

If you are using Gradle, your manifest will automatically include the required permissions. There is no other setup required. For other integration methods, complete the following:

  1. Ensure your minSdk is set to 8 or higher.

    XML
    Copy
    Copied
    <uses-sdk android:minSdkVersion="8" />
  2. Specify INTERNET and ACCESS_NETWORK_STATE permissions in AndroidManifest.xml.

    XML
    Copy
    Copied
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Initializing

  1. Get an instance of BraintreeData. The second parameter should be either BraintreeEnvironment.SANDBOX for testing or BraintreeEnvironment.PRODUCTION for production.

    Java
    Copy
    Copied
    BraintreeData mBraintreeData = new BraintreeData(context, BraintreeEnvironment.PRODUCTION);
  2. When verifying a card or creating a transaction, call collectDeviceData().

    Java
    Copy
    Copied
    String deviceData = mBraintreeData.collectDeviceData();
  3. Send deviceData to your server to be included in verification or transaction requests.

Shipping address

Shipping addresses are not collected during the PayPal Vault flow. However, if you choose to collect shipping addresses yourself, it can be passed along with the server side Transaction.Sale call. Look at the Server-side page for more information.

Country and language support

Below are the supported language and country combinations. We auto-detect your customer's location when using the Vault flow on a mobile device.

Country Language
Andorra Spanish
Andorra English
Australia English
Austria German
Austria English
Belgium English
Belgium Dutch
Belgium French
Bulgaria English
Canada English
Canada French
Croatia English
Cyprus English
Czech Republic English
Denmark Danish
Denmark English
Estonia English
Finland English
France French
France English
Germany German
Germany English
Gibraltar English
Great Britain English
Greece English
Hong Kong English
Hong Kong Chinese
Hungary English
Iceland English
Ireland English
Italy Italian
Italy English
Latvia English
Liechtenstein German
Liechtenstein English
Lithuania English
Lithuania Russian
Luxembourg English
Luxembourg German
Malta English
Malaysia English
Netherlands Dutch
Netherlands English
New Zealand English
Norway Norwegian
Norway English
Poland Polish
Poland English
Portugal English
Portugal Portuguese
Romania English
San Marino Italian
San Marino English
Singapore English
Slovakia English
Slovenia English
Spain Spanish
Spain English
Sweden Swedish
Switzerland German
Switzerland French
Switzerland English
United States English

Currency presentment

In the Vault flow itself, the transaction currency and amount are not displayed to the customer. It is up to you to display these details in your checkout flow somewhere (e.g. cart page, order review page, etc.). Our Server-Side guide outlines which currencies are supported for PayPal transactions.

Still have questions?

If you can’t find an answer, contact our Support team