Context: I have to implement a Ruby on Rails e-commerce website, containing a shopping cart. An option is to use PayPal as a payment gateway. The merchant (PayPal business account owner) is from Italy.
There are two different PayPal payment workflows available:
1. Express checkout:
in 4 steps:
- The web app submits a payment request to PayPal via some PayPal API (see below),
The buyer is redirected to PayPal web server and once there the buyer:
- can login (with his paypal username and password), if they already possess a PayPal Account, or
- can submit credit/debit card data, if they do not possess any PayPal ACCOUNT
confirm purchase on paypal's server,
the buyer is redirected back to the application server, "where the settlement must be done to complete payment".
2. Direct Payment:
the buyer submits credit/debit card data directly into the original web app.
I'd prefer to implement this second scenario.
About Paypal available APIs: I read something here: http://paypal.github.io/
Paypal "REST" APIs are NOT still available out of the US, so I have to use Paypal "Classic" APIs.
Using gem 'paypal-sdk-merchant' seems clear to me about how to submit a payment from a credit/debit card.
I can't find any info about the possibility to submit a Direct Payment for a buyer that have a Paypal Account.
if a buyer pays through his Paypal Account:
:payer => {
:payment_method => "paypal" }
if a buyer pays through his credit card:
:payer => {
:payment_method => "credit_card"}
So:
Can I use the Classic API for a live Italian Merchant User? I'm asking because in PayPal sandbox it seems I can't set a test merchant user with country:IT ... maybe it's a sandbox limitation?
Can I do a direct payment with the Classic API supplying PayPal username/password (for users who have a PayPal account) instead of creditcard data (all other users)?