0

在我的信用卡处理文件中,我有:

  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: "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-----

我正在尝试切换 PayPal 帐户并创建了一个新的 PayPal 帐户。我真的需要在我的环境文件中切换凭据吗?如果是这样,我使用哪些凭据?登录不是电子邮件地址,我用来登录 PayPal 的是电子邮件地址。

4

1 回答 1

1

在此处观看此视频:

http://railscasts.com/episodes/144-active-merchant-basics

它提供了有关如何获取和设置 ActiveMerchant 的 PayPal API 凭据的分步说明。

PayPal 还为您提供信息 MyAccount -> Profile -> API Access -> Request API Credentials

有关更多信息,另请参阅: https ://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/apicertificates

于 2012-12-14T17:04:35.903 回答