1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

[bug] unable to sync coupons on stripe

This commit is contained in:
Sylvain 2021-06-16 15:48:45 +02:00
parent 209a2f4acf
commit f5126084b9
2 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@
- Fix a bug: unable to book a free event
- Fix a bug: can't see the dates for the next booked training session, when the user is reserving a machine without the appropriate training
- Fix a bug: invalid link to the user's manual
- Fix a bug: unable to sync coupons on stripe
## v5.0.4 2021 June 15

View File

@ -26,9 +26,9 @@ class SyncObjectsOnStripeWorker
total = Coupon.all.count
Coupon.all.each_with_index do |coupon, index|
logger.debug "#{index} / #{total}"
Stripe::Coupon.retrieve(c.code, api_key: Setting.get('stripe_secret_key'))
Stripe::Coupon.retrieve(coupon.code, api_key: Setting.get('stripe_secret_key'))
rescue Stripe::InvalidRequestError
Stripe::Service.create_coupon(c.id)
Stripe::Service.create_coupon(coupon.id)
end
w = StripeWorker.new