Preauth and split payment in paypal using REST APIs in rails - ruby-on-rails

I have buyer and seller in my platform.
When the buyer purchases a product, at the same time the amount should be captured from his account, and on product delivery the seller should receive the amount and admin gets 10% as platform charge.
This implementation is very easy in stripe but I want this to implemented in Russia, France, and Germany and stripe is not supporting these countries.
So, I want to go with PayPal.
I am googled and found that adaptive payment is used for that.
But on the paypal documentation page, it is written that adaptive payment is restricted. Paypal's documentation is very confusing and limited.
I want some can help me on that or can share some links for my better understanding.

Unfortunately, there is not a "quick and easy" solution available right now.
They have added the Marketplaces API which will replace what Adaptive Payments was doing, but it's not ready for public use yet.
You might be interested in this article about PayPal split payments with Express Checkout. It outlines a few alternative methods to get this done.

Related

Use Paypal to accept payments in ASP.NET MVC

Hi I want to use Paypal to accept payments in my applications. I feel like I'm going around in circles. What I have gathered is that there is very little documentation and a lot of marketing guff that you need to wade through - no disrespect to anyone who has worked on it.
I've learned that the Restful APIs from Paypal are not full featured yet, and the classic APIs provide a richer set of features - and my merchant account is in Australia so I don't think I can use REST APIs yet.
I've got a number of questions :
What do I need to get started ? Is it essentially formatting a payload according to the documents and calling a web service or is there more to it ?
Are there any sample .net applications that use the classic API. I may have missed something but GIT repository only seems to have REST api samples - should I get this and use classic in its place or is there more to it ?
Should I be using the SDK at all ? I checked in Nuget and there are a number of SDKs - the asp.net -http://www.asp.net/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/checkout-and-payment-with-paypal and it doesn't talk about the SDKs ??
If I am to get the SDK which one should I start with for Classic, I'm assuming I only need the SDK for the respective functions I need. For example there is a Merchant SDK and Payments Pro SDK which has the same information on www.paypal.com/SDK
What I want to be able to do is the following:
Accept Credit Card and Paypal payments on my wedapp
Do Adaptive Payments
Establish Recurring Payments after a Credit Card and Paypal Payment
Do PreApproval
Provide Express Checkout as per Paypal requirement
Please help, there appears to be a lack of getting started guides for Paypal and MVC. If anyone has any samples that would be fantastic!
I can certainly help you with your Express Checkout requirement, and in shedding some light on the complexities of interfacing your application with PayPal.
This .NET SDK offers full support for Express Checkout functionality, as well as providing a concise readme that outlines how Express Checkout works at both high, and more precise levels of abstraction.
In terms of Express Checkout, there are 3 main terms that you should familiarise yourself with:
SetExpressCheckout
Establishes a PayPal session based on Merchant credentials, and returns an Access Token pertaining to that session.
GetExpresscheckoutDetails
Returns a definitive collection of metadata that describes the PayPal user (name, address, etc.).
DoExpressCheckoutPayment
Collects the payment by transferring the transaction amount from the User's account to the Merchant account.

Which PayPal SDK is best for me

I am building an MVC 5 site.
There are multiple vendors with their own product pages
The purchaser is your average consumer. (They may need to setup a PayPal account)
I need to accept payments using PayPal, Visa, etc...
I need to send funds to the respected vendor once their product has been purchased.
Question: What is the best SDK to start with?
There are several different options and I was hoping not to have to go down a road that wasn't necessary
thank you

Payment gateway API that allows transferring money to credit card

I'm looking for a way to accept money from credit cards and send money from my account to someone's credit card. Does anyone know of an API/Gateway that allows me to do this?
I'm working in Rails.
Thanks to all helpers!
Uri
First, I assume you're integrated into an online payment gateway such as Cybersource, Stripe, Braintree or anything else. You'd need that to process cards and each has its own integration documentation and gems.
Once integrated, you want to issue a REFUND to a credit card. This will send money to that card, debiting your bank account. Now the tricky part is that most processors demand a preliminary positive transaction to make a refund, which isn't your case. You're looking for something called stand alone credit or stand alone refund, which some processors require special permission for.
I've used this with Cybersource via Paymentech in the past. Have a look at page 45 in their documentation.
Alternatively, the easiest way to pay someone to his credit card is via a wallet. PayPal is the most popular wallet so you can use that, allowing users to draw their funds into a credit card.
If your comapny is big enough, it can also use Payout services such as Tipalti and Payoneer.
The standard gem for this is active_merchant.
You can transfer money to other accounts, if the gateway supports this.
See API documentation of transfer

API differences between Paypal Express Checkout and Website Payment Standard

I'm trying to understand the API differences between Paypal's Express Checkout and Website Payment Standard. I know the user-facing differences (Express Checkout forces you to have a Paypal account, while Website Payment Standard also processes credit cards), but I don't know the differences between how you can interface with them programmatically, specifically from a Rails app. Active Merchant says that it supports Express Checkout but doesn't mention Website Payment Standard. For recurring payments, I found this gem, but it only mentions Express Checkout. How does it function (if at all) with Website Payment Standard?
I realize Paypal has multiple APIs, and that while Active Merchant communicates via Paypal's SOAP endpoints, you can also communicate via their URL-based API. I'm just getting confused because there is such an overload of documentation that it's difficult to understand what works with what.
EDIT - To clarify, what I mean by accepting credit cards is not forcing the user to have a Paypal account - having Paypal function solely as a credit card gateway (like AuthNet, for example). I know that credit cards can be tied to your Paypal account, and this is not what I am talking about.
Thanks!
Rather than edit my previously edited answer, I'm going to try again.
Express Checkout was made to sit next to your existing payment solution as a "Pay with Paypal" option. It has a more full API, and only requires your customers to leave your site to enter their payment information. There is a more detailed writeup here
For clarification, YES, both Paypal's Express Checkout and Website Payment Standard allow you to accept payments from "Guest Accounts" (Customers without paypal accounts.)
I agree that the documentation is sometimes confusing. Since you mention Rails, here is how to enable "Guest Accounts" in Express Checkout with Active Merchant.
I believe express checkout is only available for business acccounts (not personal). If you have a business account, you will find a setting in your paypal profile - Profile>My selling tools>Selling Online>Website preferences Scroll down to PayPal Account Optional and select the On radio button.
Edit: Apparently this option can be found under Profile>Website Payment Preferences>Paypal Account Optional
Then using Active Merchant, call paypal with the allow_guest_checkout (This code is based on the railscast on express checkout episode)
response = EXPRESS_GATEWAY.setup_purchase(current_cart.build_order.price_in_cents,
:ip => request.remote_ip,
:return_url => new_order_url,
:cancel_return_url => products_url,
:allow_guest_checkout => true
)
Hope this helps.
Both Website Payment Standard (WPS) & Express Checkout WILL accept credit cards. Express Checkout has more features (e.g. a return POST) and now both allow credit card usage directly, so the differences are smaller.
There is a setting in your paypal profile, probably under Profile=>My selling preferences=>Selling Online section that has the return and custom landing page options.
For a sole gateway function, you need to have Website Payments Pro and/or other form of solution that allows you to do a direct POST, which might include other hurdles like PCI compliance etc.
As for activemerchant, check out the Railscast series on paypal (specifically express checkout)
The videos are a bit old, but I set up a payment solution using activemerchant and paypal express based off those videos just last year. Should work for you

Implementing our billing system in rails: Paypal, pure Merchant Account / Gateway, or something like Chargify?

I've seen a few questions related to API specifics and paypal. Generally speaking if I'm going to offer my rails app as a subscription based service, what are the pros and cons of the different payment systems available on rails?
My main concerns are:
Avoiding PCI compliance, and not storing any credit cards on our servers
Easy API with recurring payments
Looking professional (not showing someone paypal branding anywhere as an example)
Paypal seems to have some "PRO" services that meet the above criteria, but I was curious about using a gateway like Authorize.NET directly?
What does Braintree offer above and beyond these?
What about Charify? It seems to be a layer on-top of gateways like Authorize.net with added dashboards and reports.
If the gateway or payment processor is storing credit cards for me, what happens if I want to take my 10,000 customers with me to a new billing service? Do they all have to enter payment info all over again? Is there a procedure in place so that different providers can move my customer / Credit Card database between them?
We've used Chargify and it's great for a couple of reasons:
PCI compliance: Chargify handles the storing of the credit card
Auto Charging: Will auto charge the credit cards after N months and a trial period
Dunning: Will email users if the charge fails, and try several times before expiring their account
Great Gems: the chargify gem rocks.
So I highly recommend using Chargify with Authorize.net
Cons:
Chargify adds about $0.10 to each account per month in addition to your merchant fees
I recommend this write-up which will clear up many of these questions.

Resources