bambora / checkout-magento-v2.x

Bambora Online - Magento 2
https://www.bambora.com/sv/se/betalningslosningar/
3 stars 13 forks source link

Enforce JSON response type for assets call #31

Closed unicoder88 closed 5 years ago

unicoder88 commented 5 years ago

Hi!

We sometimes have a situation when AJAX call to bambora/checkout/assets results in fatal error for whatever reason. HTTP response code is set like 500 or 503, and some text status is returned, e.g. "see exception logs ...".

https://prnt.sc/o3e38t

Current implementation does not check JSON format. Treats return string as success codes and iterates them, resulting in a lot of malformed images, one for each character in response.

https://prnt.sc/o3e3cl

Please review the change :)

AllanWLie commented 5 years ago

@unicoder88

Thank you for your PR. It have now been merged and will be published with the next release.

Best regards Allan - Bambora