Quick reference
Button styling
Customize PayPal button appearance using thestyle 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. UseenableFunding and disableFunding to control which buttons appear.
Color
Setstyle.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:Funding sources
Control which PayPal funding options are available. All sources are enabled by default.Available sources
Regional funding sources
Regional funding 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
- Customer authenticates with PayPal
- PayPal creates a Billing Agreement for recurring access
- Primer stores the vaulted payment method
- Future payments use the saved method without re-authentication
Legacy SDK vaulting
Legacy SDK vaulting
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
Vaulting not working
Vaulting not working
Checklist:
-
vault: truein SDK options -
vaultOnSuccess: truein client session -
customerIdprovided in client session - PayPal Billing Agreements enabled in your PayPal account
Funding source not showing
Funding source not showing
Possible causes:
- Source not available in buyer’s region
- Source in
disableFundingarray - Buyer’s PayPal account doesn’t support it
Complete example
See also
SDK options reference
All configuration options
PayPal JS SDK configuration
Official PayPal documentation
PayPal button style guide
Complete style reference