Checkout with PayPal is a one-time payment checkout experience.

Invoking the Checkout with PayPal Flow

First, make sure you have defined your URL scheme. Then, use PayPal.requestOneTimePayment to start the process. An example integration might look like this:

Java
public void setupBraintreeAndStartExpressCheckout() {
  PayPalRequest request = new PayPalRequest("1")
    .currencyCode("USD")
    .intent(PayPalRequest.INTENT_AUTHORIZE);

  PayPal.requestOneTimePayment(mBraintreeFragment, request);
}

When you receive a callback in onPaymentMethodNonceCreated, you can query the PayPalAccountNonce object you get back for specific customer information.

Java
@Override
public void onPaymentMethodNonceCreated(PaymentMethodNonce paymentMethodNonce) {
  // Send nonce to server
  String nonce = paymentMethodNonce.getNonce();
  if (paymentMethodNonce instanceof PayPalAccountNonce) {
    PayPalAccountNonce payPalAccountNonce = (PayPalAccountNonce)paymentMethodNonce;

    // Access additional information
    String email = payPalAccountNonce.getEmail();
    String firstName = payPalAccountNonce.getFirstName();
    String lastName = payPalAccountNonce.getLastName();
    String phone = payPalAccountNonce.getPhone();

    // See PostalAddress.java for details
    PostalAddress billingAddress = payPalAccountNonce.getBillingAddress();
    PostalAddress shippingAddress = payPalAccountNonce.getShippingAddress();
  }
}

Shipping address

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

Country support

PayPal is available to merchants in all countries that we support and to customers in 140+ countries.

Currency presentment

The currency of the transaction is presented to the customer in the Checkout with PayPal flow. We support all currencies that PayPal REST APIs support.

See the server-side section for details on charging a transaction in a specific currency.

PayPal Credit

US and UK merchants can add PayPal Credit to a Checkout flow integration with a few additional lines of code. For full info on the availability and benefits of offering PayPal Credit, see the support article. For integration details, see the developer guide.

Next Page: Server-side →