Compatibility with payment gateways
-
Hi Dev Support,
I am attempting to make my plugin compatible with yours but running in to some issues.
Here is a scenario which currently does not work:
1. Customer selects GPay on checkout page which opens the GPay wallet.
2. Customer selects a shipping address in the GPay wallet which triggers an ajax request to update the customer’s billing/shipping address.
3. The checkout page updates correctly via theupdate_order_review
ajax request but the response to the GPay wallet ajax request is the old currency.Reviewing your code, I see there are certain scenarios in which you include the frontend filters that hook in to
woocommerce_currency
etc. Do you have any docs or suggestions on how I might go about making your plugin work in this scenario?One of the issues I see is that in
WC_Product_Price_Based_Country::frontend_init
you assign thecurrent_zone
based on the customer’s current billing or shipping country. However that occurs in thewoocommerce_init
action but dictates all behavior downstream. In my scenario, the customer’s billing country is ‘US’ duringwoocommerce_init
and then ‘GB’ once the ajax request is processed andWC()->cart->caluclate_totals()
is called. But, due to how your plugin is initialized, the new country isn’t taken into consideration.Any suggestions you have are appreciated.
Kind Regards,
- The topic ‘Compatibility with payment gateways’ is closed to new replies.