mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
[bug] unable to sync users on stripe if one of them have an invalid email address
This commit is contained in:
parent
17ab75cfa5
commit
2a616125c1
@ -1,6 +1,7 @@
|
|||||||
# Changelog Fab-manager
|
# Changelog Fab-manager
|
||||||
|
|
||||||
- Fix a bug: during the upgrade, unable to detect the target when not explicitly specified
|
- Fix a bug: during the upgrade, unable to detect the target when not explicitly specified
|
||||||
|
- Fix a bug: unable to sync users on stripe if one of them have an invalid email address
|
||||||
|
|
||||||
## v5.0.4 2021 June 15
|
## v5.0.4 2021 June 15
|
||||||
|
|
||||||
|
@ -11,10 +11,14 @@ class SyncObjectsOnStripeWorker
|
|||||||
User.online_payers.each_with_index do |member, index|
|
User.online_payers.each_with_index do |member, index|
|
||||||
logger.debug "#{index} / #{total}"
|
logger.debug "#{index} / #{total}"
|
||||||
begin
|
begin
|
||||||
stp_customer = member.payment_gateway_object.gateway_object.retrieve
|
stp_customer = member.payment_gateway_object&.gateway_object&.retrieve
|
||||||
StripeWorker.new.create_stripe_customer(member.id) if stp_customer.nil? || stp_customer[:deleted]
|
StripeWorker.new.create_stripe_customer(member.id) if stp_customer.nil? || stp_customer[:deleted]
|
||||||
rescue Stripe::InvalidRequestError
|
rescue Stripe::InvalidRequestError
|
||||||
StripeWorker.new.create_stripe_customer(member.id)
|
begin
|
||||||
|
StripeWorker.new.create_stripe_customer(member.id)
|
||||||
|
rescue Stripe::InvalidRequestError => e
|
||||||
|
puts "Unable to create the customer #{member.id} do to a Stripe error: #{e}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user