Add Pay Later messages
Last updated: Mar 14th, 6:16pm
Select your country or region
Australia | France | Germany | Italy | Spain | United Kingdom | United States |
Integrate Pay Later messages and buttons to show customized payment offers for your payers.
Render Pay Later messaging
Choose where you want to render the Pay Later messaging, and PayPal automatically displays the most appropriate message. You can also customize the formatting using configuration attributes. For more details, see message placement.
- Add the PayPal JavaScript SDK code to your product and checkout pages.
- Replace
YOUR_CLIENT_ID
with your client ID. - To display messaging with a different payment amount, change the
120.00
indata-pp-amount="120.00"
.
Message components, console warnings, and errors include configuration attributes and object validations. Configuration properties have distinct validation checks for input formatting and values. For a full list of accepted options, see the reference.
If validations fail, the developer console in your web browser displays warning messages that inform you which property is invalid and what you should do to resolve the issue. Depending on the message type, the library attempts to fall back to the default values.
1<script2src="https://www.paypal.com/sdk/js?client-id=YOUR-CLIENT-ID¤cy=AUD&components=messages">3</script>45<div6 data-pp-message7 data-pp-placement="product"8 data-pp-amount="120.00">9</div>
Step result
Our example renders a Pay in 4 message that displays each payment amount for $30. However, a different message could render, based on the amount passed through data-pp-amount
.
Test and go live
Save your website and publish it to start testing Pay Later messaging.
1. Test Pay Later transactions
- Log in to your payer account in your sandbox.
- On the PayPal Checkout page, choose PayPal as your payment method at the time of purchase.
- Select Pay in 4 as the payment option.
- Follow the on-screen instructions to send a payment to your merchant account in your sandbox.
- Log in to your merchant sandbox account.
- Confirm that the money successfully moved into the merchant account.
To learn more about the PayPal sandbox, see the sandbox testing guide.
2. Test Pay Later messaging
- Replace
YOUR_CLIENT_ID
with your sandbox client ID in the PayPal JavaScript SDK. - Confirm that Pay Later messaging displays in all appropriate pages.
3. Go live
- Change all references to your sandbox API credentials to live credentials. This includes changing the sandbox client ID in the PayPal JavaScript SDK to call in your HTML.
- If you created or updated pages on a website, move that code from the test environment to the live environment.
To test live Pay Later transactions using real funds and non-sandbox PayPal accounts, ensure that you:
- Aren't using the business account that is receiving the money to make the purchase.
- Don't use a personal account with the same information as the business account.
Troubleshooting
Message components, console warnings, and errors include configuration attributes and object validations. Configuration properties have distinct validation checks for input formatting and values. For a full list of accepted options, see the reference.
If validations fail, the developer console in your web browser displays warning messages that inform you which property is invalid and what you should do to resolve the issue. Depending on the message type, the library attempts to fall back to the default values.