mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-06 01:08:21 +01:00
[bug] unable to sync coupons on stripe
This commit is contained in:
parent
32230c3772
commit
427ba1a74b
@ -29,7 +29,7 @@ class SyncObjectsOnStripeWorker
|
|||||||
logger.debug "#{index} / #{total}"
|
logger.debug "#{index} / #{total}"
|
||||||
Stripe::Coupon.retrieve(coupon.code, api_key: Setting.get('stripe_secret_key'))
|
Stripe::Coupon.retrieve(coupon.code, api_key: Setting.get('stripe_secret_key'))
|
||||||
rescue Stripe::InvalidRequestError
|
rescue Stripe::InvalidRequestError
|
||||||
Stripe::Service.create_coupon(coupon.id)
|
Stripe::Service.new.create_coupon(coupon.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
w = StripeWorker.new
|
w = StripeWorker.new
|
||||||
|
@ -37,7 +37,7 @@ namespace :fablab do
|
|||||||
Coupon.all.each do |c|
|
Coupon.all.each do |c|
|
||||||
Stripe::Coupon.retrieve(c.code, api_key: Setting.get('stripe_secret_key'))
|
Stripe::Coupon.retrieve(c.code, api_key: Setting.get('stripe_secret_key'))
|
||||||
rescue Stripe::InvalidRequestError
|
rescue Stripe::InvalidRequestError
|
||||||
Stripe::Service.create_coupon(c.id)
|
Stripe::Service.new.create_coupon(c.id)
|
||||||
end
|
end
|
||||||
puts 'Done'
|
puts 'Done'
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user