-
Notifications
You must be signed in to change notification settings - Fork 69
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
With UPE enabled, customers are being charged multiple times for renewal order #5615
Labels
priority: critical
The issue is critical—e.g. a fatal error, security problem affecting many customers.
type: bug
The issue is a confirmed bug.
Comments
james-allan
added
type: bug
The issue is a confirmed bug.
priority: critical
The issue is critical—e.g. a fatal error, security problem affecting many customers.
labels
Feb 27, 2023
Affected merchants so far:
|
5996496-zen |
41069772-hc |
5992705-zen |
6 tasks
5996940-zen |
41098166-hc |
36540221-hc |
6 tasks
6000842-zen |
40957388-hc |
6 tasks
5999165-zd-woothemes |
37442085-hc |
6003016-zen |
6003901-zen |
40471767-hc |
41142097-hc |
This has been addressed by #5625 which released in the 5.5.1 patch. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
priority: critical
The issue is critical—e.g. a fatal error, security problem affecting many customers.
type: bug
The issue is a confirmed bug.
Describe the bug
On the latest version of WC Payments (5.5 - released last week), subscription customers are being charged multiple times for renewal orders.
The cause of this was introduced in this PR:
As part of that PR, multiple instances of the payment method classes (eg
CC_Payment_Gateway
) are instantiated in each request. Those payment method classes extendWC_Payment_Gateway_WCPay
and call that base class constructor. That class hierarchy leads to multiple calls of$this->maybe_init_subscriptions()
which hooks onto the'woocommerce_scheduled_subscription_payment_' . $this->id
hook each time (code ref).For as many
'woocommerce_scheduled_subscription_payment_' . $this->id
functions that are hooked on, there are that many charge requests for renewal orders. For example, with legacy UPE this was 2 (CC + UPE). But with UPE SPlit enabled there were like 8 renewal order charges (CC + all the UPE ones).To Reproduce
2.Enable UPE.
3. Optional. Create a subscription product if you don't have one.
Admin Process renewal action.
Actual behavior
For every payment method class that extends the
WC_Payment_Gateway_WCPay
class, there's a$this->maybe_init_subscriptions()
call and that leads to multiple instances WC Payments hooking ontowoocommerce_scheduled_subscription_payment_
.For each one of those functions hooked onto that hook, there's a renewal charge being processed.
Screenshots
Duplicate charges.
Expected behavior
A customer should only be charged once for each renewal order.
The text was updated successfully, but these errors were encountered: