Sha256: f6116c647916f597285633f2ba3d2ee747339410e166cadb92f899ae3002e282
Contents?: true
Size: 1.22 KB
Versions: 13
Compression:
Stored size: 1.22 KB
Contents
module Braintree class TestingGateway # :nodoc: def initialize(gateway) @gateway = gateway @config = gateway.config @transaction_gateway = TransactionGateway.new(gateway) end def settle(transaction_id) check_environment response = @config.http.put "/transactions/#{transaction_id}/settle" @transaction_gateway._handle_transaction_response(response) end def settlement_confirm(transaction_id) check_environment response = @config.http.put "/transactions/#{transaction_id}/settlement_confirm" @transaction_gateway._handle_transaction_response(response) end def settlement_decline(transaction_id) check_environment response = @config.http.put "/transactions/#{transaction_id}/settlement_decline" @transaction_gateway._handle_transaction_response(response) end def settlement_pending(transaction_id) check_environment response = @config.http.put "/transactions/#{transaction_id}/settlement_pending" @transaction_gateway._handle_transaction_response(response) end def check_environment raise TestOperationPerformedInProduction if Braintree::Configuration.environment == :production end end end
Version data entries
13 entries across 13 versions & 1 rubygems