Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate wc_ajax_wcpay_add_to_cart endpoint is being overriden by WooPay #7801

Closed
gpressutto5 opened this issue Nov 28, 2023 · 1 comment · Fixed by #7926
Closed

Duplicate wc_ajax_wcpay_add_to_cart endpoint is being overriden by WooPay #7801

gpressutto5 opened this issue Nov 28, 2023 · 1 comment · Fixed by #7926
Assignees
Labels
category: core WC Payments core related issues, where it’s obvious. component: payment request button Apple Pay, Google Pay, etc component: WooPay WooPay related issues priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.

Comments

@gpressutto5
Copy link
Contributor

Describe the bug

WooPay button's wc_ajax_wcpay_add_to_cart endpoint is taking precedence and overriding the endpoint that was meant to be used by Apple Pay. Currently this is not causing any bugs because both methods are identical, but it is confusing. These endpoints should be merged or one of them should be renamed to avoid conflicts.

To Reproduce

  1. Enable WooPay in your store.
  2. Add throw new \Exception('test'); as the first line of WC_Payments_Payment_Request_Button_Handler::ajax_add_to_cart().
  3. Check the network tab of your browser's devtools, use the Apple Pay button and notice the call to wc_ajax_wcpay_add_to_cart was succesfull.
  4. Add the same exception to WC_Payments_WooPay_Button_Handler::ajax_add_to_cart().
  5. Repeat step 3 and notice the request fails.
@gpressutto5 gpressutto5 added type: bug The issue is a confirmed bug. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. component: payment request button Apple Pay, Google Pay, etc component: WooPay WooPay related issues labels Nov 28, 2023
@RadoslavGeorgiev
Copy link
Contributor

Might be related to #7588.

This issue impacts "Additional Payment Methods (including Apple Pay / Google Pay)", so assigning to Heisenberg (based on team responsibilities Pc2DNy-3z-p2) cc team lead @frosso, similar to the related issue.

Assigning as part of Gamma Triage process PcreKM-yM-p2.

@RadoslavGeorgiev RadoslavGeorgiev added the category: core WC Payments core related issues, where it’s obvious. label Nov 30, 2023
@frosso frosso linked a pull request Dec 19, 2023 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: core WC Payments core related issues, where it’s obvious. component: payment request button Apple Pay, Google Pay, etc component: WooPay WooPay related issues priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants