omise / omise-woocommerce

Omise WooCommerce Plugin
https://docs.opn.ooo/woocommerce-plugin
MIT License
47 stars 27 forks source link

[EM-1997] Added Google Pay payment method #278

Closed kan98 closed 2 years ago

kan98 commented 2 years ago

1. Objective

Explain in non-technical terms WHY this PR is required. E.g.: What feature it adds, what problem it solves...

Added GooglePay payment support feature

This section will be used in the release notes.

Related information: Related issue(s): #< GitHub ticket number > (optional)

2. Description of change

A general description of WHAT changed in the codebase, but short of an English version of the diff. Assume that people reading this will also be looking at the output of git diff and guide them to the highlights.

Additionally add the reasoning for change details if they're complex or abstract.

New payment method based off credit cards

3. Quality assurance

Specify where and how you tested this and what further testing it might need.

🔧 Environments:

Specify the details of your test environments, including, for each, the platform version (on which the plugin was run), the Omise plugin version, and the versions of your system software such as PHP or Ruby.

i.e.

✏️ Details:

Explain how to manually test this feature. For example if changes were made in the UI or in the API, explain where and if any specific access is needed.

Try paying with GooglePay on either test or live mode

4. Impact of the change

List the steps that must be taken for this PR to work. E.g.: rake yak:shave, Add "yak_key" to environment variables, ...

Be sure to include all systems that needs to be changed or which system is affected by the change (Ex: Requires Elastic search to be installed and configured in secrets.yml).

Note: Please provide a screenshot if your changed impact to UI. Screen Shot 2565-06-06 at 14 33 00 Screen Shot 2565-06-06 at 14 33 25 Screen Shot 2565-06-06 at 14 33 43

5. Priority of change

Normal, High or Immediate.

Normal

6. Additional Notes

Any further information that you would like to add.

kan98 commented 2 years ago

Is it possible to hide the Place Order button when Google Pay button is not clicked yet? 🤔

@hpariwat done here https://github.com/omise/omise-woocommerce/pull/278/commits/76a7a11b5adbaaeeb72ef963e567d1b261f34038

radiant7766 commented 2 years ago

I just tried out this feature and it is not working. The button isn't being displayed in either test or live mode. I am using Woocommerce with Elementor.

kan98 commented 2 years ago

I just tried out this feature and it is not working. The button isn't being displayed in either test or live mode. I am using Woocommerce with Elementor.

@radiant7766 thanks for informing. Can you please provide a screenshot and any console errors or server logs as well please? Woocommerce, wordpress and PHP versions will also be helpful. I will try and reproduce this issue. Thanks!

kan98 commented 2 years ago

I just tried out this feature and it is not working. The button isn't being displayed in either test or live mode. I am using Woocommerce with Elementor.

@radiant7766 just to add. Live mode wouldn't work until you add the Merchant ID (which you would have to register with Google first). Another reason might be if you haven't checked any supported card networks at all, could you please make sure you selected atleast one card brand in the admin settings?

radiant7766 commented 2 years ago

I signed up with Google and my business profile was approved and the Visa and Mastercard is checked.

radiant7766 commented 2 years ago

Woocommerce version: 6.6.0 Wordpress: 6.0 PHP: 7.4.29 image image

kan98 commented 2 years ago

Woocommerce version: 6.6.0 Wordpress: 6.0 PHP: 7.4.29 image

@radiant7766 thanks for providing the details. I've actually found a bug with live mode which I will patch. But test mode should've been working fine (we have someone who tested on Elementor too). are there any console errors you see on the browser?

Also for live mode, you will need to contact our support team to enable this payment method. I believe it will be readily available soon 🙂. So for now please use test mode and await an email from us that GooglePay is fully ready to be integrated with

radiant7766 commented 2 years ago

I am getting this error:

Uncaught ReferenceError: PaymentRequest is not defined

https://pay.google.com/gp/p/js/pay.js:264 https://pay.google.com/gp/p/js/pay.js:264 [pay.js:264:400](https://pay.google.com/gp/p/js/pay.js) https://pay.google.com/gp/p/js/pay.js:264 https://pay.google.com/gp/p/js/pay.js:264 Uncaught (in promise) Error: Parameter environment in PaymentsClientOptions can optionally be set to PRODUCTION, otherwise it defaults to TEST. Uc https://pay.google.com/gp/p/js/pay.js:160 Y https://pay.google.com/gp/p/js/pay.js:238 Z https://pay.google.com/gp/p/js/pay.js:262 updateElement https://chiangmaibabyshop.com/wp-content/plugins/omise/assets/javascripts/googlepay-button-index.umd.min.js?ver=6.6.0:15 e https://chiangmaibabyshop.com/wp-content/plugins/omise/assets/javascripts/googlepay-button-index.umd.min.js?ver=6.6.0:15 e https://chiangmaibabyshop.com/wp-content/plugins/omise/assets/javascripts/googlepay-button-index.umd.min.js?ver=6.6.0:15 updateElement https://chiangmaibabyshop.com/wp-content/plugins/omise/assets/javascripts/googlepay-button-index.umd.min.js?ver=6.6.0:15 mount https://chiangmaibabyshop.com/wp-content/plugins/omise/assets/javascripts/googlepay-button-index.umd.min.js?ver=6.6.0:15 r https://chiangmaibabyshop.com/wp-content/plugins/omise/assets/javascripts/googlepay-button-index.umd.min.js?ver=6.6.0:15 ![image](https://user-images.githubusercontent.com/95275075/173821116-334b1359-59c9-4e26-b324-faad0cce6eb2.png)
kan98 commented 2 years ago

@radiant7766 found an issue with live mode that I will patch. Your console errors were consistent with mine, thanks for sharing. However, we could not reproduce any issues with test mode. Would you kindly share any console errors or server logs you get that will be helpful for us to get more details? Thanks for your engagement here!

radiant7766 commented 2 years ago

I am getting this error in test mode and I couldn't find any console or server logs for this error.

kan98 commented 2 years ago

I am getting this error in test mode and I couldn't find any console or server logs for this error.

@radiant7766 I see. have you checked this checkbox? What I'll do is I'll release the patch by EOD and if you still face issues on test mode then I'll have another look. But I get the same error when I switch to live mode so it seems like you're on live mode. Either way, hope the patch will solve your issues.

(Note again: to use live mode on Google Pay, you'll have to contact our support team to enable it for your account first, should be available soon) Screen Shot 2565-06-16 at 11 00 31

radiant7766 commented 2 years ago

Ok thank you.

radiant7766 commented 2 years ago

I forgot to check the test mode box 😓😓. After I checked it the button is appearing. Thanks for all the help. image

kan98 commented 2 years ago

I forgot to check the test mode box 😓😓. After I checked it the button is appearing. Thanks for all the help. image

@radiant7766 happens to the best of us 😅 anyways this PR should fix the issue on live mode https://github.com/omise/omise-woocommerce/pull/280

radiant7766 commented 2 years ago

Thank you.