0
在我的信用卡處理文件,我有:ActiveMerchant對Rails項目需要什麼憑證?
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
)
在payment_gateway.rb
,我有
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
在我environments/production.rb
,我指定了很多變數的pay_pal配置,具體如下:
signature: "somesignature"
login: "my.name_api1.mysite.com"
password: "SOMEPASSWORD"
business: "[email protected]"
business_id: "BUSINESSID"
cert_id: "SOMECERTID"
private_key: |
-----BEGIN RSA PRIVATE KEY-----
MIICWwIBAA...
-----END RSA PRIVATE KEY-----
public_key: |
-----BEGIN CERTIFICATE-----
MIIDGD...
-----END CERTIFICATE-----
我在嘗試切換PayPal帳戶並創建了新的PayPal帳戶。我是否真的需要在我的環境文件中切換憑據?如果是這樣,我使用哪個憑據?登錄不是電子郵件地址,我用來登錄PayPal的是電子郵件地址。
我怎樣才能得到'cert_id'? – Shamoon