Sha256: 5de6d13ee933a2adc8ffd215317d90887a037b7a91cfd4cf64f8d2ffbcb52396

Contents?: true

Size: 518 Bytes

Versions: 61

Compression:

Stored size: 518 Bytes

Contents

module CatarsePagarme
  class SubscriptionsController < CreditCardBaseController
    def create
      charge_with_class SaveCreditCardTransaction
    end

    def update
      charge_with_class SubscriptionTransaction
    end

    protected

    def credit_card_attributes
      attributes = super

      if has_subscription?
        attributes.update({subscription_id: params[:subscription_id]})
      end

      attributes
    end

    def has_subscription?
      params[:subscription_id].present?
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
catarse_pagarme-2.4.10 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.9 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.8 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.7 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.6 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.5 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.4 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.3 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.2 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-1.5.3 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-1.5.2 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.1 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-1.5.1 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-1.5.0 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.4.0 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.3.10 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-1.4.9 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.3.9 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-1.4.8 app/controllers/catarse_pagarme/subscriptions_controller.rb
catarse_pagarme-2.3.8 app/controllers/catarse_pagarme/subscriptions_controller.rb