Skip to main content
PayPal enables customers to pay using their PayPal account, credit/debit cards, Venmo, PayPal Credit, and other funding sources.

Quick reference


Button styling

Customize PayPal button appearance using the style object.

Layout

Horizontal layout displays buttons side-by-side but is limited to maximum 2 buttons. When more funding sources are eligible, the SDK prioritizes PayPal and Pay Later by default. Use enableFunding and disableFunding to control which buttons appear.

Color

Set style.color to change the button background. PayPal recommends gold for the strongest brand recognition.

Examples

Per-funding-source styling

Override styles for specific funding sources:
Card button color restriction: The card funding source only supports 'black' or 'white' colors. Other colors will fall back to 'black' with a console warning.
For complete style options, see the PayPal Button Style Guide.

Funding sources

Control which PayPal funding options are available. All sources are enabled by default.

Available sources

PayPal supports additional regional sources:

Disable funding

Hide specific payment options:
The 'paypal' funding source cannot be disabled — it is always available. Attempting to include 'paypal' in disableFunding will be ignored with a console warning.

Enable funding

Explicitly enable specific sources:
disableFunding takes precedence. If a source appears in both arrays, it will be disabled.

Examples


Vaulting

Enable vaulting to save PayPal accounts for future payments.

Requirements checklist

SDK configuration

How it works

  1. Customer authenticates with PayPal
  2. PayPal creates a Billing Agreement for recurring access
  3. Primer stores the vaulted payment method
  4. Future payments use the saved method without re-authentication
If using legacy SDK (sdkCore: false), use paymentFlow instead:

Testing

Sandbox testing

Simulate different buyer locations in sandbox:
buyerCountry only works in PayPal’s sandbox environment and is ignored in production.

Debug mode

Enable PayPal debug logging:

Integration date

Specify your integration date (affects SDK behavior):

Troubleshooting

Possible causes:
  • PayPal not configured in Primer Dashboard
  • Browser blocks third-party scripts
  • Ad blocker interfering
Debug steps:
  1. Check browser console for errors
  2. Enable debug: true in PayPal options
  3. Verify PayPal is in your enabledPaymentMethods (if specified)
Checklist:
  • vault: true in SDK options
  • vaultOnSuccess: true in client session
  • customerId provided in client session
  • PayPal Billing Agreements enabled in your PayPal account
Possible causes:
  • Source not available in buyer’s region
  • Source in disableFunding array
  • Buyer’s PayPal account doesn’t support it
Note: Some sources (Venmo, regional options) are region-locked and won’t appear for buyers outside supported areas.

Complete example


See also

SDK options reference

All configuration options

PayPal JS SDK configuration

Official PayPal documentation

PayPal button style guide

Complete style reference