question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can no longer change currency

See original GitHub issue

Now that currency is passed as a param to the script tag, it is no longer possible to set it dynamically.

There seem to be only two workarounds, both of which are bad:

  • reload the page
    • not acceptable if you have form data on the page
  • add another script tag with the correct currency on demand
    • fails with “Can not register multiple components” errors
    • deleting the appropriate zoid objects from window seems like a brittle fix

We need to set the currency dynamically because we provide international donation forms where donors can choose the currency for paypal and other payment methods.

We are also not the only ones with this problem, see https://stackoverflow.com/questions/56142863/paypal-sdk-how-to-change-currency-dynamically-without-reinjecting-and-reinitial

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:20
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
bluepnumecommented, Apr 22, 2020

Hi all,

The currency is required in the script tag to allow the SDK to return the correct buttons for your page. Recommend reloading the script tag if it needs to change. Thanks.

5reactions
CollinHerbercommented, Oct 21, 2019

Why the hell do we have to sacrifice so much, and create horrible UX just to integrate PayPal SDK? Do they seriously not care? For the love of god why is this unnoticed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to do when the Play Store shows the wrong country or ...
Changing the language does not change the country or currency you use. You can't change your Play country temporarily. Country changes can only...
Read more >
Where to Exchange Currency Without Paying Huge Fees
Many U.S. banks will exchange USD for foreign currencies without charging a fee, but there are often stipulations. For instance, Bank of America ......
Read more >
Foreign Currency Cash Questions - Wells Fargo
We may refuse to process any request for a foreign exchange transaction. Incoming wire transfers received in a foreign currency for payment into...
Read more >
Why Pay International Invoices in Local Currencies?
There may be downsides to depending on U.S. dollars for all your international vendor payments, as opposed to local currency.
Read more >
Foreign Currency Information FAQs - Bank of America
Bank of America only accepts foreign currency bills that are in current circulation. ... No. However, you may be able to exchange many...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found