Module: Vindi::Synchronizable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/vindi/integrations/concerns/synchronizable.rb
Instance Method Summary collapse
Instance Method Details
#sync_vindi_customer! ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/vindi/integrations/concerns/synchronizable.rb', line 12 def sync_vindi_customer! return if vindi_customer_id? params = vindi_customer_attributes customer = Vindi::Customer.create(params) update_columns(vindi_customer_id: customer.id.to_s) rescue Vindi::Error => e Rails.logger.error("Failed to sync customer to Vindi: #{e.}") end |
#update_vindi_customer! ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/vindi/integrations/concerns/synchronizable.rb', line 23 def update_vindi_customer! return unless vindi_customer_id? params = vindi_customer_attributes Vindi::Customer.update(vindi_customer_id, params) rescue Vindi::Error => e Rails.logger.error("Failed to update customer in Vindi: #{e.}") end |