PayPal

Checkout with PayPalanchor

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

Invoking the Checkout with PayPal Flowanchor

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

  1. Android
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.

  1. Android
@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 addressanchor

Shipping addresses may or may not be collected during the Checkout with PayPal 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 supportanchor

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

Currency presentmentanchor

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.


Next Page: Server-side