Class: JeraPayment::Services::Iugu::SubAccounts::Verify

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

Instance Method Summary collapse

Constructor Details

#initialize(resource, attributes) ⇒ Verify

Returns a new instance of Verify.



6
7
8
9
# File 'lib/jera_payment/services/iugu/sub_accounts/verify.rb', line 6

def initialize(resource, attributes)
  @resource = resource
  @attributes = attributes
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
# File 'lib/jera_payment/services/iugu/sub_accounts/verify.rb', line 11

def call
  iugu_marketplace = JeraPayment::Api::Iugu::SubAccount.verify(@resource., @attributes, @resource.user_token)

  add_error(iugu_marketplace[:errors]) and return @resource if iugu_marketplace[:errors].present?

  set_api_attributes(iugu_marketplace)

  @resource
end