0
votes

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:

  1. The web app submits a payment request to PayPal via some PayPal API (see below),
  2. 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
  3. confirm purchase on paypal's server,

  4. 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:

  1. 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?

  2. 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)?

1

1 Answers

1
votes

In short:

  1. Yes, you can set up a merchant sandbox account on Paypal from Italy. You first need to login to Paypal with some real credentials (yours or your customer's), then go to to Paypal developers' page, select applications, then sandbox accounts.

  2. I'm afraid direct payment is not part of the classic APIs, but I suggest you using the Paypal Express method. You can find docs here, and in Italian here.