Skip to main content

PayPal Payments

Quick Answer

PayPal support is optional and mainly applies to commerce apps that include the cart and checkout modules. The current checkout flow treats PayPal as one selectable payment method, but the app still needs a secure backend to create client tokens, charge nonces, and persist orders.

If your product does not specifically need PayPal, start with the Stripe payment docs and keep PayPal disabled.

Source Map

PayPal-related logic is usually connected across:

src/core/payments
src/core/cart
src/core/delivery

The checkout screen branches on the payment method key:

if (selectedPaymentMethod.key === 'paypal') {
handlePaypalPayment()
return
}

The cart manager is expected to provide methods such as:

fetchPaypalToken()
chargePaypalCustomer()
checkoutWithPaypal()
placeOrder()

Backend Requirements

Do not place PayPal or Braintree secrets in React Native source code. A production PayPal flow needs an authenticated backend that can:

  • create a client token for the signed-in user;
  • accept a nonce returned by the mobile payment UI;
  • create the PayPal/Braintree transaction server-side;
  • validate amount, currency, cart items, shipping address, and vendor/order context;
  • persist the order only after payment succeeds;
  • handle failure, cancellation, refund, and duplicate submission cases.

Firebase Functions, Cloud Run, Render, Heroku, or another HTTPS backend can be used. The important part is that secrets stay server-side and the app calls only your public authenticated endpoints.

Payment Method Configuration

Apps that support PayPal usually expose a payment method object similar to:

{
key: 'paypal',
title: 'PayPal',
last4: 'PayPal',
}

Keep PayPal out of the payment method list until the backend is configured and tested.

Production Checklist

Before enabling PayPal:

  1. Create and verify your PayPal/Braintree account.
  2. Configure sandbox credentials on the backend.
  3. Implement token, charge, and checkout endpoints.
  4. Make sure the app points to your backend, not a demo endpoint.
  5. Test user cancellation.
  6. Test payment failure.
  7. Test duplicate tap/order submission.
  8. Test successful payment and order persistence.
  9. Switch backend credentials to production only after sandbox testing passes.

Troubleshooting

ProblemFix
PayPal option appears but payment failsDisable the method until fetchPaypalToken, chargePaypalCustomer, and checkoutWithPaypal point to your backend.
Token request failsCheck backend environment variables, account mode, HTTPS, and authenticated user context.
Payment succeeds but order is missingPersist the order only after the backend confirms the transaction.
User is charged twiceAdd idempotency/order locking on the backend and disable repeated submit while payment is processing.
Store review asks about paymentsConfirm digital goods use in-app purchases and physical goods/services use external payment methods appropriately.