I am having big trouble getting the PayPal checkout plugin to work. I am using this code:
{% namespace cart.gateway.handle|commercePaymentFormNamespace %}
{{ cart.gateway.getPaymentFormHtml({
currency: cart.paymentCurrency,
'buyer-country': cart.billingAddress.countryCode,
locale: lang == 'de' ? 'de_CH' : 'en_GB',
})|raw }}
{% endnamespace %}
That displays the PayPal form correctly:
But as soon as I click on one of the buttons, I get a JS alert saying "Error: Expected an order id to be passed".
I think the Gateway is correctly set up. When I enter wrong data, the buttons don't show up. Here is my setup:
Content of my .env
:
PAYPAL_ENABLED=true
PAYPAL_CLIENT_ID=AQxp4QbX2hmlqHtpJ_...
PAYPAL_SECRET=EBPo6JbLQ0bt0-...
PAYPAL_SANDBOX=true
Any hints and comments welcome!