Created
June 23, 2015 17:15
-
-
Save wjr1985/567445781a06e126a286 to your computer and use it in GitHub Desktop.
Braintree Ruby library - multiple merchant gateways
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "braintree" | |
transaction_attributes = { | |
:amount => "1000.00", | |
:credit_card => { | |
:number => "5105105105105100", | |
:expiration_date => "05/12" | |
} | |
} | |
Braintree::Configuration.environment = :sandbox | |
Braintree::Configuration.merchant_id = "merchant_1" | |
Braintree::Configuration.public_key = "merchant_1_public_key" | |
Braintree::Configuration.private_key = "merchant_1_private_key" | |
merchant_1_gateway = Braintree::Configuration.gateway | |
merchant_1_gateway.transaction.sale(transaction_attributes) | |
Braintree::Configuration.environment = :sandbox | |
Braintree::Configuration.merchant_id = "merchant_2" | |
Braintree::Configuration.public_key = "merchant_2_public_key" | |
Braintree::Configuration.private_key = "merchant_2_private_key" | |
merchant_2_gateway = Braintree::Configuration.gateway | |
merchant_2_gateway.transaction.sale(transaction_attributes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't appear so.