Sha256: f565a3d86b0ef6b2c453b44303734274638361a683b63187417b4a711ad4a8a7

Contents?: true

Size: 439 Bytes

Versions: 84

Compression:

Stored size: 439 Bytes

Contents

module Braintree
  class DiscountGateway # :nodoc
    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

84 entries across 84 versions & 1 rubygems

Version Path
braintree-4.15.0 lib/braintree/discount_gateway.rb
braintree-4.14.0 lib/braintree/discount_gateway.rb
braintree-4.13.0 lib/braintree/discount_gateway.rb
braintree-4.12.0 lib/braintree/discount_gateway.rb
braintree-4.11.0 lib/braintree/discount_gateway.rb
braintree-4.10.0 lib/braintree/discount_gateway.rb
braintree-4.9.0 lib/braintree/discount_gateway.rb
braintree-4.8.0 lib/braintree/discount_gateway.rb
braintree-4.7.0 lib/braintree/discount_gateway.rb
braintree-4.6.0 lib/braintree/discount_gateway.rb
braintree-4.5.0 lib/braintree/discount_gateway.rb
braintree-4.4.0 lib/braintree/discount_gateway.rb
braintree-4.3.0 lib/braintree/discount_gateway.rb
braintree-4.2.0 lib/braintree/discount_gateway.rb
braintree-4.1.0 lib/braintree/discount_gateway.rb
braintree-4.0.0 lib/braintree/discount_gateway.rb
braintree-3.4.0 lib/braintree/discount_gateway.rb
braintree-3.3.0 lib/braintree/discount_gateway.rb
braintree-3.2.0 lib/braintree/discount_gateway.rb
braintree-3.1.0 lib/braintree/discount_gateway.rb