Sha256: 53cb7bfdeed8e44ef17ff959b55fde8fd1290c7dba479146eaaa30aafcd9410d

Contents?: true

Size: 430 Bytes

Versions: 8

Compression:

Stored size: 430 Bytes

Contents

module Braintree
  class DiscountGateway
    def initialize(gateway)
      @gateway = gateway
      @config = gateway.config
      @config.assert_has_access_token_or_keys
    end

    def all
      response = @config.http.get("#{@config.base_merchant_path}/discounts")
      attributes_collection = response[:discounts]
      attributes_collection.map do |attributes|
        Discount._new(attributes)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
braintree-4.23.0 lib/braintree/discount_gateway.rb
braintree-4.22.0 lib/braintree/discount_gateway.rb
braintree-4.21.0 lib/braintree/discount_gateway.rb
braintree-4.20.0 lib/braintree/discount_gateway.rb
braintree-4.19.0 lib/braintree/discount_gateway.rb
braintree-4.18.0 lib/braintree/discount_gateway.rb
braintree-4.17.0 lib/braintree/discount_gateway.rb
braintree-4.16.0 lib/braintree/discount_gateway.rb