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-2.86.0 lib/braintree/discount_gateway.rb
braintree-2.85.0 lib/braintree/discount_gateway.rb
braintree-2.84.0 lib/braintree/discount_gateway.rb
braintree-2.83.0 lib/braintree/discount_gateway.rb
braintree-2.82.0 lib/braintree/discount_gateway.rb
braintree-2.81.0 lib/braintree/discount_gateway.rb
braintree-2.80.1 lib/braintree/discount_gateway.rb
braintree-2.80.0 lib/braintree/discount_gateway.rb
braintree-2.79.0 lib/braintree/discount_gateway.rb
braintree-2.78.0 lib/braintree/discount_gateway.rb
braintree-2.77.0 lib/braintree/discount_gateway.rb
braintree-2.76.0 lib/braintree/discount_gateway.rb
braintree-2.75.0 lib/braintree/discount_gateway.rb
braintree-2.74.0 lib/braintree/discount_gateway.rb
braintree-2.73.0 lib/braintree/discount_gateway.rb
braintree-2.72.0 lib/braintree/discount_gateway.rb
braintree-2.71.0 lib/braintree/discount_gateway.rb
braintree-2.70.0 lib/braintree/discount_gateway.rb
braintree-2.69.1 lib/braintree/discount_gateway.rb
braintree-2.69.0 lib/braintree/discount_gateway.rb