[英]PayPal integration Ruby on Rails
I've seen posts that you should use ActiveMerchant for PayPal integration, but I also found this on the PayPal website.I'm struggling with placing what in which file, since I'm totally new to RoR. 我已经看到你应该使用ActiveMerchant进行PayPal集成的帖子,但我也在PayPal网站上找到了这个帖子。我正在努力将文件放在哪个文件中,因为我对RoR完全不熟悉。 So I was trying to integrate the PayPal , but am not sure where to place which code.
所以我试图整合PayPal ,但不知道在哪里放置哪些代码。
Should I use active merchant for PayPal integration, or is the Rest-API the best choice. 我应该使用活动商家进行PayPal集成,还是Rest-API是最佳选择。 I want people to fill out their username, pay and when successful they receive digital content.
我希望人们填写用户名,付费,并在成功时收到数字内容。 So there should be a call with a result and the username.
所以应该有一个结果和用户名的调用。
Do you have a link, step by step, at least including which code I should place in which file, so I get the basics of RoR better. 你有一个循序渐进的链接,至少包括我应该在哪个文件中放置哪些代码,所以我更好地了解了RoR的基础知识。
I found the PayPal API documentation to be quite confusing. 我发现PayPal API文档非常混乱。 Also, my application requirements were not satisfied through the API, so I ended up with a rather simple solution.
此外,通过API不满足我的应用程序要求,因此我最终得到了一个相当简单的解决方案。
The solution mainly consists of two components: 解决方案主要包括两个组成部分:
This is how the whole solution works in detail 这就是整个解决方案的详细工作方式
Here are some useful references: 以下是一些有用的参考:
-> add 'gem activemerchant' in gem file - >在gem文件中添加'gem activemerchant'
-> bundle install - >捆绑安装
-> Go to "www.developer.paypal.com" and create an account(also known as Merchant Account) with US address details. - >转到“www.developer.paypal.com”并创建一个包含美国地址详细信息的帐户(也称为商家帐户)。
-> It will create two dummy test account for buyer and seller(alias facilitator) in "sandbox.paypal.com". - >它将在“sandbox.paypal.com”中为买方和卖方(别名协调人)创建两个虚拟测试帐户。
Ex: 例如:
Seller account ---> naveengoud-facilitator@gmail.com 卖家账号---> naveengoud-facilitator@gmail.com
Buyer account ---> naveengoud-buyer@gmail.com 买家帐号---> naveengoud-buyer@gmail.com
-> To see test accounts details Click on "Dashboard -> Accounts" - >查看测试帐户详细信息单击“仪表板 - >帐户”
-> Now set the password for both test accounts by clicking on profile link - >现在通过单击配置文件链接为两个测试帐户设置密码
-> Go to seller account(ie, facilitator) profile details and copy the API Credentials ie, Username, password and signature - >转到卖家帐户(即协调人)个人资料详细信息并复制API凭据,即用户名,密码和签名
Ex: 例如:
Username: naveengoud-facilitator_api1.gamil.com 用户名:naveengoud-facilitator_api1.gamil.com
Password: VSPALJ5ALA5YY9YJ 密码:VSPALJ5ALA5YY9YJ
Signature: AVLslxW5UGzEpaDPEK4Oril7Xo4IAYjdWHD25HhS8a8kqPYO4FjFhd6A 签名:AVLslxW5UGzEpaDPEK4Oril7Xo4IAYjdWHD25HhS8a8kqPYO4FjFhd6A
-> Set these API Credentials in "config/environments/development.rb" as follows, add the below code with API credentials - >如下所示在“config / environments / development.rb”中设置这些API凭据,使用API凭据添加以下代码
config.after_initialize do
ActiveMerchant::Billing::Base.mode = :test
::GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(
login: "merchant_api1.gotealeaf.com",
password: "2PWPEUKZXAYE7ZHR",
signature: "AFcWxV21C7fd0v3bYYYRCpSSRl31A-dRI5VpyF4A9emruhNYzlM8poc0"
)
end
-> From here onward follow the Rails cast 145 episode( http://railscasts.com/episodes/145-integrating-active-merchant ) - >从这里开始关注Rails演员阵容145集( http://railscasts.com/episodes/145-integrating-active-merchant )
This link will help you to get better understanding on integration of Basic Checkout, Charge Credit Cards and Recurring Payments with paypal in Ruby On Rails application 此链接将帮助您更好地了解基本结账,充值信用卡和定期付款与Ruby On Rails应用程序中的paypal的集成
http://www.gotealeaf.com/blog/basic-paypal-checkout-processing-in-rails http://www.gotealeaf.com/blog/basic-paypal-checkout-processing-in-rails
You can find solutions for following concepts, 您可以找到以下概念的解决方案,
1) Basic Checkout 2) Charge Credit Cards 3) Recurring Payments 1)基本结账2)充值信用卡3)定期付款
Look at this for rails integration: 看看这个用于rails集成:
but also here, more in general (less related to Rails): 但也在这里,更一般(与Rails相关性较小):
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.