Ruby on Rails and Paypal outside US - ruby-on-rails

I'm using Rails 3.2.13 and I need to integrate with a payment gateway (preferably Paypal).
I've seen the railscasts of Ryan using ActiveMerchant, but I can't get it to work (I'm located in Greece), the error says that the merchant is not available in my country.
I can't actually get API credentials for Greece as shown
Is there a way (activemerchant or not) that I can integrate my Ruby on Rails app with Paypal from Greece, in order to accept payments?
Thanks

There are a few railscasts about PayPal as well. Ryan uses the paypal-recurring gem which I've used successfully with an Australian account.
I think you need a Premier or Business account to use the PayPal API and IPNs.
While you're working on the payment processing you'll want to sign up for a PayPal sandbox account so that you know everything is working.
The code required is listed in the gem I linked to, so I'm not going to copy paste it here.
In order to request a single payment I think you can use the request_payment method and skip the create_recurring_profile method. Also, you should double check that the PayPal page users get taken to doesn't say anything about signing up for a subscription.

PayPals Merchant API works only on the countries listed above.

here you can find paypal integration from scratch without gem
http://blog.joshsoftware.com/2013/01/08/paypal-payflow-setup-in-rails/

Related

How to integrate multiple payment gateway ( Multiple merchant ) in ruby on rails?

As i'm new in ruby on rails so sorry for silly question if it is.
I'm developing e-commerse application like amazon. So seller needs to add their merchant account in rails application. Merchant acccount can be paypalpaylfow, authorize.net or cybersource. I want to integrate PayPal Payflow, Authorize.net, CyberSource. I realy don't know about any of these payment gateway. So can anyone help me out? Can you provide me the solutions or examples for the above payment gateway.
Thank you in advance.
To get started with PayPal Payflow gateway, you should review the guide at this website:
https://developer.paypal.com/docs/classic/payflow/integration-guide/
The link you provided in the comment on your original post is for "payouts" which is different than "Payflow".
You can look into ActiveMerchant. If you have a problem with payload and ruby versions you can browse their unit test cases and start trace from there.
https://github.com/activemerchant/active_merchant/blob/master/test/unit/gateways/cyber_source_test.rb
https://github.com/activemerchant/active_merchant/blob/master/test/unit/gateways/authorize_net_test.rb
https://github.com/activemerchant/active_merchant/blob/master/test/unit/gateways/payflow_test.rb

How can i implement payment through Paypal on Sharetribe opensource?

i'm trying to implement payment through Paypal on the opensource version of Sharetribe (https://github.com/sharetribe/sharetribe). By default Sharetribe doesn't allow people to use Paypal with the opensource code. How can i create the transaction using the Paypal API? Thank you!
Sharetribe doesn't have Paypal enabled on open source version because using Paypal as a peer-to-peer payment solution requires certain extra steps for a business to set up with Paypal. Sharetribe has done this for their hosted websites, but can't be liable for open sourced versions.
The code is all there for Paypal, however most people are implementing Stripe Connect instead, as, even with the Paypal code, Stripe Connect is a simpler solution to get your marketplace up and running.
In short, there is no 'setting' to turn on Paypal. A lot of code is required to enable payments.
If you want a marketplace ready-to-go with payments enabled, use Sharetribe's hosted version. Otherwise, you'll need someone with solid knowledge of Ruby on Rails in order to implement Stripe Connect.

Credit card payments via PayPal REST API without being PCI-compliant

Can't understand which PayPal API to use.
I have Rails app and I'd like to accept credit card recurring payments via PayPal. At first I was thinking to use Express Checkout API that supports recurring billing and can work even if a user doesn't have PayPal account. But then I saw that their official ruby gem merchant-sdk-ruby https://github.com/paypal/merchant-sdk-ruby will be deprecated:
This Classic SDK is not actively supported and will be deprecated in
the future. For full support on new integrations, please use the Ruby
Rest SDK
So I don't want to use something that will be deprecated soon. But I can't understand whether I can use REST API to accept credit cards without being PCI-compliant.
I'd like to redirect user to PayPal where he could enter his credit card info and return back to my site like in Express Checkout, but I see only examples where credit card info is collected on my site and passed to PayPal via API that implies more security headache on my site.
UPD: I found some information regarding this question in Accept a PayPal payment section of REST API documentation that is a bit odd because I expected to find it in Accept credit card payments section. They say:
Important: To receive Guest Checkout payments, which allow credit cards, ensure that PayPal Account Optional is enabled on your account
settings. For example, here is the path for US accounts:
Profile > My selling tools > Website preferences > PayPal Account Optional
But I'm still not sure whether it will work in my case. Now I have the following question:
Can I use Guest Checkout feature to accept recurring payments?
Can I test Guest Checkout in Sandbox? And if I can what credit card number to use?
Can I show by default form for entering credit card info when user gets to the PayPal site rather than for entering PayPal credentials?
Ughh... why it is so complicated?
There are couple of samples in PHP code, that could help you understand recurring payment options in REST API.
https://github.com/paypal/PayPal-PHP-SDK/tree/master/sample/billing
Or you could follow up the docs on : https://developer.paypal.com/webapps/developer/docs/api/#billing-plans-and-agreements
I will look into this specifically and get back to you
For trying it out on sandbox, you can create an account here at https://developer.paypal.com/webapps/developer/applications/myapps You need to create an app, and it would generate a valid credit card for you.
This may be very unlikely to do, but I can ask the internal team if they know of any such option.
Railscast #289 is on this. It requires that you sign up for the pro version. Looks pretty involved but he walks you through it.

How to use ActiveMerchant for Paypal website payments standard?

I'm trying to set up a rails app to use Paypal website payments standard. I'd rather have users click a button and submit their info on the Paypal site rather than on my site, but I'd like to use ActiveMerchant for it's test mode and handling of credentials.
All the info I can find on the net describes how to use ActiveMerchant to let users fill in details in a form in your site and use the Paypal API to charge their card. Ryan bates has screen casts where he walks through using the website payments standard method but he doesn't take advantage of ActiveMerchant in his method.
I think I have ActiveMerchant set up in my app correctly:
# config/environments/development.rb
config.after_initialize do
ActiveMerchant::Billing::Base.mode = :test
::GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(
login: 'dgesf_1313616880_biz_api1.gmail.com',
password: '1313616919',
signature: 'AKXgGVsxct8DAOfYpyE73guXzPo1ACa185mHcgzMcYOCJsNYSJ0NflAF'
)
end
But how do I generate a form which will use the information above to POST my details (item price, name etc) to the correct Paypal URL so that they can construct the page which will display item details to the user and allow him to enter his payment information?
Can I use ActiveMerchant to fake Paypal IPN notifications and test my apps handling of them?
ActiveMerchant is a bundle of payment gateway APIs from Shopfy and the PayPal library in there doesn't seem to be updated, line item fields are not with the APIs as per HERE, good though for payment processing only.
If you'd need a comprehensive integration of the PayPal experience, refer to the DEMO Site and obtain the Express Checkout API codes, that will better fit your need of itemization & customization on PayPal checkout pages.
IPN simulator to test your script with mock call-back messages, that's right from #SgtPooki in the comments

Sending AND Receiving Payments with Paypal on Rails

I am building a marketplace app for a client and need to be able to both send payments and receive payments. I am currently using ActiveMerchant to handle incoming payments, but I don't see anywhere in the documentation if it is possible to SEND payments. I've read elsewhere that it may in fact be possible to send payments using one of Paypal's many API's but I'm not sure which one I should be looking to use.
If anyone has ever had to SEND payments within a rails system I would appreciate some insight, where to start looking, gems, etc.
Thanks!
I would look into Adaptive Payments it seems to offer something similar to what you are looking for. There is also a gem for it over here which seems to be actively developed.
If this wont work for you for any reason let me know and I can look for something else.
PayPal supports it with MassPay. Not sure about ActiveMerchant.
(To get MassPay enabled on the live PayPal site, contact CS. For Sandbox, log a ticket at https://www.paypal.com/mts/).

Resources