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