Sha256: 5f1b65a9daba0fe4eb4e7fdfbe7ed6f1789e72f36e2d96d09a4d84c2d2b232c1

Contents?: true

Size: 924 Bytes

Versions: 43

Compression:

Stored size: 924 Bytes

Contents

module Braintree
  class SettlementBatchSummaryGateway # :nodoc
    include BaseModule

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

    def generate(criteria)
      Util.verify_keys(_signature, criteria)
      response = @config.http.post("#{@config.base_merchant_path}/settlement_batch_summary", :settlement_batch_summary => criteria)
      if response[:settlement_batch_summary]
        SuccessfulResult.new(:settlement_batch_summary => SettlementBatchSummary._new(@gateway, response[:settlement_batch_summary]))
      elsif response[:api_error_response]
        ErrorResult.new(@gateway, response[:api_error_response])
      else
        raise UnexpectedError, "expected :settlement_batch_summary or :api_error_response"
      end
    end

    def _signature
      [:settlement_date, :group_by_custom_field]
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

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