NineBlindEyes
NineBlindEyes

Reputation: 639

How to use BN Code with Active Merchant in Rails

I am trying to figure out how to use a BN Code with Active Merchant with Rails 3.2.11. I can't figure out exactly where to put it though. Does anyone know?

Upvotes: 1

Views: 380

Answers (1)

stromee
stromee

Reputation: 11

In version 1.20.2 (current version I'm using), Active Merchant sets the bn variable to the gateway application_id. By default, this bn code is "ActiveMerchant". See the "new" method here:

http://activemerchant.rubyforge.org/classes/ActiveMerchant/Billing/Integrations/Paypal/Helper.html

All you need to do is set your own application_id in your controller by doing the following:

g = ActiveMerchant::Billing::PaypalGateway
g.application_id = 'YOUR PAYPAL BNCODE'
logger.debug g.application_id

That should send the bn code to paypal.

UPDATE: This is confirmed with Paypal too, so this does work.

Upvotes: 1

Related Questions