Skip to content

Instantly share code, notes, and snippets.

@wjr1985
Created June 23, 2015 17:15
Show Gist options
  • Select an option

  • Save wjr1985/567445781a06e126a286 to your computer and use it in GitHub Desktop.

Select an option

Save wjr1985/567445781a06e126a286 to your computer and use it in GitHub Desktop.
Braintree Ruby library - multiple merchant gateways
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)
@geetfun
Copy link
Copy Markdown

geetfun commented Aug 16, 2017

Doesn't appear so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment