Closed zhakamizhako closed 5 years ago
Hi,
Do you have a script tag anywhere in your html pointing to paypal's api or a tag that looks like this <script src="https://www.paypal.com/sdk/js?client-id=sb"></script>
? If you do, then delete the script tag.
If you like react-paypal-button-v2
, please give it a star! Thanks.
Hi,
Do you have a script tag anywhere in your html pointing to paypal's api or a tag that looks like this
<script src="https://www.paypal.com/sdk/js?client-id=sb"></script>
? If you do, then delete the script tag.
Hello, thanks for the component and sorry for bad English.
I did not set the mentioned script but got the same error while passing different currencies.
At first, I've tried to pass the currency through the options and it doesn't work, then I passed by currency prop listed in IPayPalButtonProps and it worked for while until suddenly stop.
My code:
<PayPalButton
amount={this.calcAmount()}
currency={symbol}
options={{
clientId
}}
onSuccess={this.onSuccess.bind(this)}
onError={this.onError.bind(this)}
/>
Error message:
"Unexpected currency: EUR passed to order.create. Please ensure you are passing /sdk/js?currency=EUR in the paypal script tag."
Stack
Error: Unexpected currency: EUR passed to order.create. Please ensure you are passing /sdk/js?currency=EUR in the paypal script tag.
at Xt.(anonymous function) (https://www.paypal.com/sdk/js?client-id=[CLIENT-ID]:1:51890)
at Object.<anonymous> (https://www.paypal.com/sdk/js?client-id=[CLIENT-ID]:1:58149)
at JSON.parse (<anonymous>)
at o (https://www.paypal.com/sdk/js?client-id=[CLIENT-ID]:1:58009)
at cr (https://www.paypal.com/sdk/js?client-id=[CLIENT-ID]:1:58160)
at u.on (https://www.paypal.com/sdk/js?client-id=[CLIENT-ID]:1:62923)
at gr (https://www.paypal.com/sdk/js?client-id=[CLIENT-ID]:1:63112)
at https://www.paypal.com/sdk/js?client-id=[CLIENT-ID]0:1:67549
at https://www.paypal.com/sdk/js?client-id=[CLIENT-ID]0:1:67595
In case someone has the same issue, you need to pass also the currency in the options:
<PayPalButton
amount={total}
currency={currency}
options={{
currency: currency.toUpperCase(),
clientId: PAYPAL_CLIENT_ID,
}}
...
Hi, Good day. I've followed your examples, but i seem to stumble across an error whenever i try to change the currency. We're using React 15.6.2 with Redux 4.4.9.
Error: Unexpected currency: JPY passed to order.create. Please ensure you are passing /sdk/js?currency=JPY in the paypal script tag.
Here's my code for our page.
Even then if i try to place it inside the
<PayPalButton>
, it returns with the same error.