Adyen / adyen-web

Adyen Web Drop-in and Components
https://docs.adyen.com/online-payments
MIT License
185 stars 131 forks source link

Klarna/HPP button click does nothing #565

Closed brightonmike closed 3 years ago

brightonmike commented 3 years ago

I'm having a lot of trouble getting Klarna to work (same with Drop in) with the Magento 2 module.

hppCheckout.create('klarna_account', {
    countryCode: 'en_GB',
    visibility: {
        personalDetails: 'editable',
    },
    onSubmit(state) {
        handleOnSubmit(state);
    },
    onChange(state) {
        console.log(state);
    },
}).mount(HPPPayEl);

So when you click the button, I'm seeing logs from the onSubmit, but nothing happens.

One difference between my code and the Magento JS is the details element:

details: self.filterOutOpenInvoiceComponentDetails(value.details),

However, I don't seem to get any details to pass from the Payment Methods endpoint. On the Magento 2 documentation it does not suggest this is required: https://docs.adyen.com/plugins/magento-2/magento-pwa-storefront#collect-shopper-details

I'm completely at a loss as to how to get this to work correctly. If I need to add the submit behaviour myself, what am I submitting to and what data? This information seems absent from the documentation, and I'm also finding it difficult to cross reference the Adyen Web documentation with the documentation for the Magento module.

brightonmike commented 3 years ago

This appears to be due to the following issue: https://github.com/Adyen/adyen-magento2/issues/787

marcperez commented 3 years ago

Hi @brightonmike

I would advise to open an issue on the Adyen/adyen-magento2 repository for this specific question.

Thanks!