PayPal pay links and button troubleshooting tips

I'm getting an error and the button isn't displaying on my website.

1. Check that your internet connection is working.

2. Visit other pages on your website and check that they're loading properly. Go the the PayPal Buttons page and check that the button is showing under Saved Buttons and the code matches what is on your website.

3. Right-click on your product page (where you have pasted the button code, and click "inspect". Go to the Console tab (upper-right corner of page). You may see Content Security Policy (CSP) errors. If you've deployed a CSP, you may see errors such as the following:

  • Refused to load the script "https://www.paypal.com/sdk/js**' because it violates the following Content Security Policy directive: "default-src 'self". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.
  • Refused to load the script "https://www.paypal.com/**' because it violates the following Content Security Policy directive: "default-src 'self". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.
  • Refused to load the script "https://www.paypal.com/sdk/js**' because it violates the following Content Security Policy directive: "default-src 'self". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.
  • Refused to load the image 'https://tracking.qa.paypal.com/webapps/tracking/ts?**' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
  • Refused to frame 'https://www.paypal.com/' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'frame-src' was not explicitly set, so 'default-src' is used as a fallback.

You can try adding the below to resolve any of the above errors:

Option-1 (HTML): If your CSP is configured in HTML file use the below code to replace your CSP code

script-src 'unsafe-inline' https://*.paypal.com https://*.paypalobjects.com;
style-src 'unsafe-inline' https://*.paypal.com; connect-src
https://*.paypal.com; frame-src https://*.paypal.com; img-src
https://*.paypal.com https://*.paypalobjects.com">

Option-2 (Server side): If your CSP is configured on the server side use the below code to replace your CSP code

Content-Security-Policy: script-src 'unsafe-inline' https://*.paypal.com https://*.paypalobjects.com
Content-Security-Policy: style-src 'unsafe-inline' https://*.paypal.com
Content-Security-Policy: connect-src https://*.paypal.com
Content-Security-Policy: frame-src https://*.paypal.com
Content-Security-Policy: img-src https://*.paypal.com https://*.paypalobjects.com


How do I change button attributes such as the layout, size, color, product name, price, or quantity?

Here's how to change the attributes of your button:

  1. Go to the Saved PayPal Buttons page.
  2. Click Open beside the saved button and select Edit.
  3. Click Customize your Buttons and make any necessary changes.

I edited some button attributes, do I need to copy and paste the button code again?

No. We take all of the information from the PayPal server. Once you've saved the changes on your account, you don't need to update the code on your site.

What is the client ID in the code?

A PayPal Client ID is a unique identifier used to authenticate a merchant's PayPal account when integrating with our REST API's.

I added multiple buttons but none are showing on my web page.

  • If you have copied/pasted the same button ID multiple times on the same web page, only the first button will show. You can’t repeat the same button ID multiple times.
  • If you have copied/pasted different button IDs but with other currencies on the same web page, only the first button will show. You can’t add foreign currencies on buttons on the same web page.
  • If you have copied/pasted different button IDs and experience latency, ensure the script tag with the client ID is only added once. The script tag line will look like this:

    <script src="https://www.paypal.com/sdk/js?client-id=XYZ&components=hosted-buttons&enable-funding=venmo¤cy=USD"></script>

What type of PayPal accounts can create pay links and buttons?

Only PayPal Business accounts may create pay links and buttons. To use this feature, upgrade or create a Business account.

How do I test this experience?

To test this experience, use our Sandbox envrionment.

How do I test the Venmo button in Sandbox?

Pay with Venmo is currently not available in Sandbox. To test, a live test will be necessary.

My customer stated that not all payment methods are available.

Specific payment methods such as PayPal, Venmo and Pay Later depend on the buyer's country eligibility.

The credit and debit card inline expansion doesn't show completely on my web page. 

Ensure that the parent container width and height are set to accommodate the inline expansion. Consult your hosting platform documentation and support for additional details.

Does Instant Payment Notification (IPN) support pay links and buttons?

Yes, IPN is supported for pay links and buttons.

Review "What is Instant Payment Notification or IPN?" for setup details.

Do pay links and buttons support Payment Data Transfer (PDT)?

Yes, PDT is supported. Please review our PDT Variable documentation. You'll receive PDT if you enable the Auto-Return setting during pay link and button configuration.

Do pay links and buttons support manually added locales in the button code?

By default, pay links and buttons use customers' browser preferences to show the button code and payment link experience.

Merchants can override this for payment links and button codes by appending “locale.x=fr_FR and country.x=” as a query parameter. The list of supported codes for locales can be found in our JavaScript SDK documentation. Any text entered by a merchant during config will not be translated.

Example: https://www.paypal.com/ncp/payment/F3YMU2ZGT49XX?locale.x=ja_JP&country.x=JP

Example: <script src="……¤cy=USD&locale.x=ja_JP"></script>

Can pay link and button labels be hidden?

We understand that you may have a different visual setup on your website. However, we don't recommend hiding the button code that we provide.

Hiding them from your website will not change how the transaction is processed. It will still use your hosted button ID configuration.

Once you're using a button type that doesn't require customer input, you can hide certain or all text around buttons. For example, the transaction will fail if your customer needs to select the quantity or multiple item select list and you've hidden those input elements.

Here's an example of how to hide the price of an item:

As an example, add this script below your button code. Replace the with <HostedButtonID> actual button id.

<style>

#paypal-form-fields-container-{<HostedButton_ID>}

#price-label { 

display: none !important;  

}  

}  

</style> 

Similar to hiding the price of an item, you can do the same for other text too: 

  • desc-label (for product name)
  • price-label (for price)

If you want to hide multiples of them, use separated ID:

<style> #paypal-container-

{ #paypal-form-fields-container-

{ #price-label, #desc-label { display: none !important; }} }

If you want to hide all text around buttons, remember that your button type shouldn't require any selections or input from your customer:

<style>

#paypal-containter-<HostedButton_ID>

{

#paypal-form-fields-container-<HostedButton_ID>

{

display: none !important;

}

}

</style>



Is it possible to override pay link and buttons to use "shipping from" settings?

Pay links and buttons won't honor bulk override of shipping from your account settings. The setting, "Use the shipping fee in the transaction instead of my calculator's settings" should be set to "No".

I changed my button currency but do not see it updated on my web page.

If you have changed the currency of a button after publishing it on your web page, you'll need to copy and paste the new button code on your web page.

I'm unable to select "Use shipping from Settings" and "Use tax from Settings" when I select "Do not collect shipping address".

While currently unavailable, we're working on enabling these options for Venmo.

Do webhooks support pay links and buttons?

Yes. Webhooks are supported for pay links and buttons.

Here is how to enable webhooks:

  1. Log into the Developer Dashboard using your PayPal merchant account credentials.
  2. Toggle the slider to Live.
  3. Click Apps and Credentials.
  4. Scroll down and select Manage Webhooks.
  5. You can now add a Webhook URL for Live. If you want to add Webhooks for Sandbox, remain on this page and toggle the slider from Live to Sandbox in the upper right corner.
  6. Add your Webhooks callback/listener URL, and select the specific events you would like to subscribe to, or all events.

More ways we can help

Resolution Center

Fix transaction and account related issues

Tax center

Get your 1099-K and other tax info here

Business Help

Get help with using any of our PayPal products

Technical Help

Find out how PayPal works for your business

Message Center

Send, receive, and view your PayPal messages