Class: JeraPayment::Services::Iugu::Customers::Create

Inherits:
Base
  • Object
show all
Defined in:
lib/jera_payment/services/iugu/customers/create.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from JeraPayment::Services::Iugu::Base

Instance Method Details

#callObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/jera_payment/services/iugu/customers/create.rb', line 6

def call
  iugu_customer = JeraPayment::Api::Iugu::Customer.create(@attributes, @resource&.&.api_token)

  if iugu_customer[:errors].present?
    add_error(iugu_customer[:errors])
  else
    set_api_attributes(iugu_customer)
  end

  @resource.errors.blank?
end