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

[bug] unable to sync coupons on stripe

This commit is contained in:
Sylvain 2021-06-21 10:45:13 +02:00
parent 32230c3772
commit 427ba1a74b
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class SyncObjectsOnStripeWorker
logger.debug "#{index} / #{total}"
Stripe::Coupon.retrieve(coupon.code, api_key: Setting.get('stripe_secret_key'))
rescue Stripe::InvalidRequestError
Stripe::Service.create_coupon(coupon.id)
Stripe::Service.new.create_coupon(coupon.id)
end
w = StripeWorker.new

View File

@ -37,7 +37,7 @@ namespace :fablab do
Coupon.all.each do |c|
Stripe::Coupon.retrieve(c.code, api_key: Setting.get('stripe_secret_key'))
rescue Stripe::InvalidRequestError
Stripe::Service.create_coupon(c.id)
Stripe::Service.new.create_coupon(c.id)
end
puts 'Done'
end