Sha256: a5e7d7356d1952dccb31352bf151376e4b096a23e10137b8dc44214d486a4b8a

Contents?: true

Size: 485 Bytes

Versions: 3

Compression:

Stored size: 485 Bytes

Contents

module Cardflex
  class SubscriptionGateway
    attr_reader :config

    def initialize(gateway)
      @gateway = gateway
      @config = gateway.config
    end

    def request(attributes)
      @config.http.post(attributes)
    end

    def _handle_response(res)
      if res[:response][:result] == '1'
        SuccessResponse.new(:subscription => Subscription.new(@gateway, res[:response]))
      else
        ErrorResponse.new(@gateway, res[:response])
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cardflex-ruby-0.1.2 lib/cardflex/subscription_gateway.rb
cardflex-ruby-0.1.1 lib/cardflex/subscription_gateway.rb
cardflex-ruby-0.0.1 lib/cardflex/subscription_gateway.rb