I have the following issue with Paypal and ApplePay.
I need to add possibility to pay with credit card and Paypal and Apple Pay on my website.
I’m using paypal.Buttons(buttonsConfig).render(‘myDivId’) function to show Paypal and Pay with Credit card buttons. That all works like a charm.
Issue starts when I want to add possibility to use ApplePay. I was following the docs, added &components=applepay to the paypal script src, also added a new button once I have an ApplePay Session.
And I added &components=applepay only if the target device is iOS device.
Testing on the MAC, I can use the Apple Pay button and it also works without issues.
BUT, I’m getting issue initializing my other buttons, which is Paypal and ‘Debit or Credit Card’ buttons.
Console error says:
TypeError: paypal.Buttons is not a function. (In 'paypal.Buttons(a)', 'paypal.Buttons' is undefined)
That started happening after adding &components=applepay to the paypal script src.
I even tried using 2 paypal scripts on the iOS device. One with and one without &components=applepay. Buttons showed up, but when clicked on ‘Debit or Credit Card’ button, I’m getting HTTP 400 from card-fields request.
Any advise what else to try to make ApplePay and Credit card payment work on MAC?
Just one note on ApplePay. From ApplePay I’m retrieving token, that I’m later sending to paypal confirmOrder. Exactly as on their examples.
Thanks for any help!
Marian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.