class JeraPayment::Services::Iugu::Subscriptions::Update

Public Instance Methods

call() click to toggle source
# File lib/jera_payment/services/iugu/subscriptions/update.rb, line 6
def call
  iugu_subscription = JeraPayment::Api::Iugu::Subscription.update(@resource.api_id, @attributes.merge({customer_id: @resource.customer.api_id}),
                                                                  @resource&.customer&.sub_account&.api_token)

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

  @resource.errors.blank?
end