Closed vorasudh closed 1 year ago
@kidunot89 any thoughts here?
If I remember correctly, payment gateways are restricted by the current location of the end-user. This is determined by the shipping address saved for current user attached to the user session.
I think WooCommerce core get around this by using geolocation detection if no shipping address is set. WooGraphQL on the other hand, doesn't provided a pass-thru to use this functionality at the moment.
You'd have to do some kind geolocation detection on client and update the user shipping address with the retrieved field (typically country
, state/province
, and postcode/zip
) using the updateCustomer
mutation.
Then on the following paymentGateways
queries should have cod
in the results if the end-user is within the correct shipping zone.
@vorasudh Any updates on this?
Since there has been no response on this, I'm closing this.
Describe the bug I have set up 2 payment methods -
Cash on Delivery
andRazorPay
.RazorPay
is available for all types of shipping methods whereasCash on Delivery
is available for only 1 type of shipping method - Free shipping. Now only theRazorpay
method is returned with the below query (no matter what shipping method is used). If I remove the restriction of shipping method for Cash on Delivery, then both payment gateways are returned.Can you guide me in case I have configured something wrong? Or is this a bug?
NOTE: The shipping methods get applied automatically based on the shipping address.
To Reproduce
Expected behavior With the above query, both razor pay and Cash on Delivery methods should be returned.
Plugin Versions