mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-04-07 22:54:11 +02:00
(bug) unable to cancel stripe subscription canceled
This commit is contained in:
parent
097e43f32b
commit
ed261b8714
@ -2,6 +2,8 @@
|
||||
|
||||
## Next release
|
||||
|
||||
- Fix a bug: unable to cancel stripe subscription canceled
|
||||
|
||||
## v6.3.44 2025 March 20
|
||||
|
||||
- Fix a bug: event start/end date is not correct in the event list if the daylight saving time
|
||||
|
@ -16,7 +16,7 @@ class Stripe::Service < Payment::Service
|
||||
first_item = price_details[:schedule][:items].min_by(&:due_date)
|
||||
subscription = shopping_cart.items.find { |item| item.instance_of?(CartItem::Subscription) }.to_object
|
||||
reservable_stp_id = shopping_cart.items.find { |item| item.is_a?(CartItem::Reservation) }&.to_object
|
||||
&.reservable&.payment_gateway_object&.gateway_object_id
|
||||
&.reservable&.payment_gateway_object&.gateway_object_id
|
||||
|
||||
WalletService.debit_user_wallet(payment_schedule, shopping_cart.customer, transaction: false)
|
||||
handle_wallet_transaction(payment_schedule)
|
||||
@ -47,7 +47,7 @@ class Stripe::Service < Payment::Service
|
||||
|
||||
stp_subscription = payment_schedule.gateway_subscription.retrieve
|
||||
|
||||
res = Stripe::Subscription.delete(stp_subscription.id, {}, api_key: stripe_key)
|
||||
Stripe::Subscription.delete(stp_subscription.id, {}, api_key: stripe_key) if stp_subscription.status != 'canceled'
|
||||
res.status == 'canceled'
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user