Quick Reference
| Option | Type | Default | Description |
|---|---|---|---|
style.layout | string | 'vertical' | 'vertical' or 'horizontal' (max 2 buttons) |
style.color | string | 'gold' | 'gold', 'blue', 'silver', 'white', 'black' |
style.shape | string | 'rect' | 'rect' or 'pill' |
style.height | number | — | Button height (25-55 pixels) |
style.label | string | 'paypal' | 'paypal', 'checkout', 'buynow', 'pay', 'installment', 'subscribe', 'donate' |
disableFunding | string[] | [] | Funding sources to hide (cannot disable 'paypal') |
enableFunding | string[] | [] | Funding sources to explicitly enable |
vault | boolean | false | Enable payment method saving |
Button Styling
Customize PayPal button appearance using thestyle object.
| Option | Type | Default | Description |
|---|---|---|---|
style.layout | string | 'vertical' | 'vertical' for stacked buttons, 'horizontal' for side-by-side (max 2 buttons) |
style.color | string | 'gold' | Button background color (see values below) |
style.shape | string | 'rect' | 'rect' for rectangular with slight rounding, 'pill' for fully rounded ends |
style.height | number | — | Button height in pixels (25–55). If not set, PayPal uses its default. |
style.label | string | 'paypal' | Button text: 'paypal', 'checkout', 'buynow', 'pay', 'installment', 'subscribe', 'donate' |
style.tagline | boolean | false | Show tagline. When true, layout defaults to 'horizontal'. |
style.borderRadius | number | — | Corner radius in pixels (0–55). If not set, PayPal uses its default. |
style.disableMaxWidth | boolean | false | Remove max width constraint |
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.
| Value | Description |
|---|---|
'gold' | Gold background (default, recommended) |
'blue' | Blue background |
'silver' | Silver background |
'white' | White background |
'black' | Black background |
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
| Source | Description |
|---|---|
'card' | Guest card payments (no PayPal account) |
'credit' | PayPal Credit (US, UK) |
'paylater' | PayPal Pay Later |
'venmo' | Venmo (US) |
Regional funding sources
Regional funding sources
PayPal supports additional regional sources:
| Source | Region |
|---|---|
'bancontact' | Belgium |
'blik' | Poland |
'eps' | Austria |
'giropay' | Germany |
'ideal' | Netherlands |
'mybank' | Italy |
'p24' | Poland |
'sepa' | EU |
'sofort' | Germany, Austria |
'mercadopago' | Latin America |
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
| Requirement | Where | Details |
|---|---|---|
vault: true | SDK options | Enables vaulting in the checkout |
vaultOnSuccess: true | Client session (server) | Tells Primer to vault the payment method |
customerId | Client session (server) | Identifies the customer in your system |
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
PayPal button not appearing
PayPal button not appearing
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