class JeraPayment::Services::Iugu::CreditCards::Update

Public Instance Methods

call() click to toggle source
# File lib/jera_payment/services/iugu/credit_cards/update.rb, line 6
def call
  iugu_credit_card = JeraPayment::Api::Iugu::PaymentMethod.update(@resource.customer.api_id, @resource.api_id, @resource.attributes,
                                                                  @resource.customer&.sub_account&.api_token)

  add_error(iugu_credit_card[:errors]) if iugu_credit_card[:errors].present?

  @resource.errors.blank?
end