omise / omise-prestashop

Omise PrestaShop Plugin
https://docs.opn.ooo/prestashop-plugin
MIT License
4 stars 7 forks source link

Modifies JS on some payment templates so it works correctly even when run outside of the global context (as occurs in dynamically created script blocks) #65

Closed jonrandy closed 6 years ago

jonrandy commented 6 years ago

1. Objective

Make the "Credit Card" and "Internet Banking" methods work in "One page checkout" mode.

2. Description of change

Modified the JS in the templates for the 2 payment methods so that it works regardless of whether it is run in the global context (it appears that when JS runs in dynamically created script blocks as in the case with the one page checkout, it runs outside of the global context)

3. Quality assurance

I re-tested the affected payment methods in a PrestaShop 1.6 demo shop, with one page checkout switched on.

4. Impact of the change

All payment methods now work regardless of whether the checkout is in one or multi page mode

5. Priority of change

High - this is issue is affecting merchants who are trying to go live

6. Additional notes

I'm glad I spotted this JS context thing - my original solution was wayyyyyy more elaborate