SwedbankPay / swedbank-pay-woocommerce-core

Swedbank Pay WooCommerce Core
https://packagist.org/packages/swedbank-pay/swedbank-pay-woocommerce-core
Apache License 2.0
0 stars 5 forks source link

Card payments not working after PR #54 #56

Closed lakrisgubben closed 3 years ago

lakrisgubben commented 3 years ago

Hey,

the changes to the WC_Adapter class in #54 have had the unfortunate consequence of breaking card payments for us (I haven't deployed it to production yet so no worries. :) ), we use the Swedbank Pay WooCommerce Payments plugin. The problematic change are these lines https://github.com/SwedbankPay/swedbank-pay-woocommerce-core/pull/54/files#diff-89a77008217563f17d3a6fe6a0152dda195c02c398465b7c5d879a94144ab877R148-R159.

The issue here is the boolean check $this->gateway->reject_credit_cards (and you can replace reject_credit_cards with any of the other properties) which will always be true since the value of reject_credit_cards is either (string) 'yes' or (string) 'no'. So no matter what one has choosen for these options they will always be set to true when posting to the swedbank pay api which means that the card payment will fail in swedbank pay with the error ACCOUNTHOLDERTYPEREJECTED or CARDTYPEREJECTED. Of course I don't know the reasoning behind this change, or if it's just for us it breaks, but reverting these lines (or changing them to use the same logic as the save_cc property) makes the card payments work again.

aait commented 3 years ago

@lakrisgubben Thank you! We will fix it

aait commented 3 years ago

@lakrisgubben It has been fixed in the Wordpress Plugins directory https://profiles.wordpress.org/swedbankpay/#content-plugins. We will merge the fix after review there

lakrisgubben commented 3 years ago

Thanks for the quick response @aait! :)

It looks like ConfigurationInterface::USE_PAYER_INFO is declared twice now in https://github.com/SwedbankPay/swedbank-pay-woocommerce-core/commit/ded00f763e1a5d7d8300332854b1636734779661

I use the plugin from github so I'll test this out once #57 is merged and a 4.0.1 is released in this repo.

best