In my credit card processing file, I have:
response = PaymentGateway.pay_pal.authorize(
foreign_currency_amount_in_cents,
credit_card,
:email => email_address,
:order_id => invoice_number,
:description => item_id,
:ip => ip_address,
:currency => foreign_currency.name,
:custom_code => credit_card.type
)
In payment_gateway.rb
, I have
class PaymentGateway
class << self
def pay_pal
@pay_pal ||= ActiveMerchant::Billing::PaypalGateway.new(:login => AppConfig.pay_pal[:login], :password => AppConfig.pay_pal[:password])
end
end
In my environments/production.rb
, I'm assigning a lot more variables to the pay_pal config, specifically:
signature: "somesignature"
login: "my.name_api1.mysite.com"
password: "SOMEPASSWORD"
business: "my.name@mysite.com"
business_id: "BUSINESSID"
cert_id: "SOMECERTID"
private_key: |
-----BEGIN RSA PRIVATE KEY-----
MIICWwIBAA...
-----END RSA PRIVATE KEY-----
public_key: |
-----BEGIN CERTIFICATE-----
MIIDGD...
-----END CERTIFICATE-----
I'm trying to switch PayPal accounts and have created a new PayPal account. Do I literally need to just switch the credentials in my environment file? If so, which credentials do I use? The login is not an email address and what I use to login to PayPal is an email address.
Watch this video here:
http://railscasts.com/episodes/144-active-merchant-basics
It provides step by step instructions on how to get and setup your PayPal API credentials for ActiveMerchant.
Also PayPal gives you the information MyAccount -> Profile -> API Access -> Request API Credentials
For more info also see: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/apicertificates