Sha256: 80d83606cae26c6b991125d210afc7af0a9855ba27fdab56767a520e0ebf6710

Contents?: true

Size: 900 Bytes

Versions: 41

Compression:

Stored size: 900 Bytes

Contents

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

41 entries across 41 versions & 1 rubygems

Version Path
braintree-2.83.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.82.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.81.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.80.1 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.80.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.79.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.78.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.77.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.76.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.75.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.74.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.73.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.72.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.71.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.70.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.69.1 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.69.0 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.68.2 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.68.1 lib/braintree/settlement_batch_summary_gateway.rb
braintree-2.68.0 lib/braintree/settlement_batch_summary_gateway.rb