0

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:

enter image description here

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:

enter image description here

Content of my .env:

PAYPAL_ENABLED=true
PAYPAL_CLIENT_ID=AQxp4QbX2hmlqHtpJ_...
PAYPAL_SECRET=EBPo6JbLQ0bt0-...
PAYPAL_SANDBOX=true

Any hints and comments welcome!

1 Answer 1

1

I had the same issue. I solved it by following the developer's guide to create an app with dedicated credentials (https://github.com/craftcms/commerce-paypal-checkout/blob/develop/README.md#creating-paypal-rest-api-credentials) and deactivating "Payouts" on PayPal app and enabling "Log in with PayPal"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.