In meiner Kreditkartenverarbeitungsdatei habe ich:
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
)
Im payment_gateway.rb
, Ich habe
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 meinem environments/production.rb
, Ich gebe der pay_pal-Konfiguration viel mehr Variablen, genauer gesagt:
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-----
Ich versuche PayPal-Konten zu wechseln und habehat ein neues PayPal-Konto erstellt. Muss ich die Anmeldeinformationen in meiner Umgebungsdatei buchstäblich wechseln? Wenn ja, welche Zugangsdaten verwende ich? Die Anmeldung ist keine E-Mail-Adresse und ich verwende zur Anmeldung bei PayPal eine E-Mail-Adresse.
Antworten:
1 für die Antwort № 1Schau dir dieses Video hier an:
http://railscasts.com/episodes/144-active-merchant-basics
Es enthält schrittweise Anweisungen zum Abrufen und Einrichten Ihrer PayPal-API-Anmeldeinformationen für ActiveMerchant.
Auch PayPal gibt Ihnen die Informationen MyAccount -> Profil -> API-Zugang -> Request API Credentials
Für weitere Informationen siehe auch: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/apicertificates