Which API should I use? - paypal-adaptive-payments

I am new with paypal.
After searching for info it seems paypal has a lot of technologies, APIs etc to be consumed and I cannot choose to right one for my case
My business case:
Simple marketplace android application with 2 main actors:
Seller
Buyer
Actions:
When buyer want to buy something via marketplace -> he pays via own paypal account to seller (buyer can see paypal page and authorize payment)
Seller automatically send fee payment to marketplace's paypal account (seller does not need any time autorize payment to marketplace, it should be automatically after buyer send money to seller)
Thanks for every help!

There are a number of ways to get that done depending on the experience you would like for all parties involved.
PayPal would recommend that you use the Adaptive Payments API for this because it's exactly the sort of thing they built it for. Specifically, you could setup a chained payment. That will automatically split the payment between the seller and the marketplace / app owner.
I personally don't like the Adaptive Payments checkout experience, so I prefer to build the same functionality with Express Checkout.
For this, though, you would need to have the sellers that sign up with your marketplace create a billing agreement with the app (marketplace) so that you can trigger payments on their behalf.
Then you would build a reference transaction payment to yourself from the seller account any time you need to. So this could be as each transaction happens, or you could tally up some number of transactions and only process the reference transaction payment to yourself when the total reaches some amount, or do it once per week / month, or whatever you want to do in that case.

I recommend Express Checkout as your payment solution.
https://developer.paypal.com/docs/classic/products/express-checkout/
EC provides mobilized checkout page, and you do not need to apply for special approvals. And by setting PAYMENTREQUEST_n_SELLERPAYPALACCOUNTID in SetExpressCheckout API, you may achieve parallel payments easily.
https://developer.paypal.com/docs/classic/express-checkout/ht_ec-parallelPayments/
https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/

Related

Setting up recurring payments with Apple Pay and Stripe - but not using Stripe subscriptions

We have our own payment processing system. This takes a customer token from Stripe's response after initially checking out, and uses it each month to charge the customers card.
We want to do similar for mobile wallets, like Apple Pay.
However, Stripe docs indicate that it only returns a token which is 'single use', so the customer would have to authenticate the payment each month:
We aren't able to integrate with Stripe's 'subscriptions' service, as we'd have to migrate across entirely to Stripe - which we can't do.
So as a result, is it possible to get a reusable token - or does the 'subscription' it's referring to mean that we can get a reusable token in the same way as a standard card payment?
And by reusable token - I mean, the customer doesn't need to authenticate the payment each month.
Hope that makes sense!
When you accept an Apple Pay payment, you can still save the underlying card for future payments. This will then work whether you use Billing (their recurring payments product) or just create one-time payments yourself.
The call out from Stripe in their docs is more around the rules coming from Apple. If your customer is checking out in your application or website, you are expected to show them the Apple Pay UI to confirm the payment again instead of using a previously saved card. On the other hand, if you are doing recurring payments, you can use the previously saved card for future payments.
The integration itself is fairly straightforward. You would create a PaymentIntent server-side and collect the card details client-side whether via Apple Pay or not. Since you want to save card details for future payments you would also pass setup_future_usage: 'off_session' on the PaymentIntent creation. After a successful payment, a PaymentMethod of type card would be attached to the customer with the id pm_123 and you could use this in future recurring payments.
This flow is covered in Stripe docs here and also applies to Apple Pay and this section covers how to make the future payments.

Stripe Connect: In Stripe Connect who will pay the Stripe Charge, how to make sure that?

We are developing an application for restaurant usage, in that we have integrated Stripe Payment Gateway. Our application is having 3 types of users, Admin, Restaurant and Customer. Admin will take a charge from Merchant for using the application in each order they place through the application.
To manage this Payment Transaction we have used Stripe Connect, for example, if Customer is paying $2 then admin will take $0.5 as an application fee, and the merchant will receive the $1.5, but here the question is who will pay the Stripe Charge. We need that, Merchant will bear the Stripe Charge.
Here is the screenshot of a successful transaction. Can anyone guide me about this make sure?
You should review the different types of charge flows available when using Connect. Based on what you've described, it sounds like you want Direct charges, with the fees paid by the connected account, but it really depends on the details of your business. You can review the fund flow diagram to see if it matches what you need.

Implementing SCA into Stripe implementation

I've making a SaaS that allows customers to subscribe to a plan, and use coupons at the checkout stage. The coupons give the customers X% off for X months, and by default, everyone gets a 7 day trial when they subscribe.
What is confusing me is the documentation. In one section it says that you should create SetupIntents to take a payment and elsewhere it says to use tokens.
I'm in the middle of coding the payment flow, but I just wanted to check to see if my logic and understanding is correct. Could anyone validate the below?
Customer enters card number and coupon
Call Stripe, get token for card
Send token and coupon to server
Create Stripe customer with token
Create Subscription with discount and pass customer ID
What has now happened is an authorisation attempt was made. If SCA is required, then the subscription status is incomplete and the latest invoice payment intent status requires action.
At this point, I can redirect my user to the SCA Flow using handleCardPayment() to prompt 3DS, and once complete the subscription status is then active.
If the invoice payment fails for any reason, then the subscription state is incomplete and the payment intent requires has a payment action required status. At this point, I should present my customer with the React Elements form again, and call the stripe.invoices.pay endpoint with the new card token
Going forwards, all subscription charges should not need further SCA approval, however if the customer changes plan or the bank requests it, then I can point my user back through the SCA Flow process
A diagram of the flow is here: Green is UI, Orange is Server, Blue is Stripe
Is there anything I have missed or misunderstood here? I've been reading about creating SetupIntents and PaymentIntents, but I'm not sure I need this?
If you are creating subscriptions using the Stripe Billing product they handle creating the PaymentIntent(if you are taking a payment immediately) or a SetupIntent (if you are setting up a trial or metered billing). All that you really have to do different is handleCardPayment (for payments) or handleCardSetup (for setting up trials and metered billing). This section in the docs is pretty good.
If you are not using billing they have a video on their Stripe Developers Youtube channel which may help clear up any confusion.
Hope this helps :)
Welcome fellow sufferer, cards and tokens are implemented in Stripe Charges API which is not SCA compilant. If you want use Stripe for payments inside the EU you should use payment intents.
Card tokens are also allowed for creating payment intents.
But if you want reduce the number of necessary authentications you should use setup intents (with usage = "off-session") for creating payment methods and not card tokens.
I have a lot of old customers who have still registered with the Charges API. I use the following strategy:
New customers always register via Setup Intents and Payment Methods.
Old customers use the Charges API until their tokens become invalid. Then they must also use setup intents and payment methods.
Of course, the customers do not notice much of it.
In summary, I would always use payment methods and setup intents for new customers and card updates. Only with the setup intents can you ensure that your customers have to authenticate themselves as rarely as possible.
EDIT: The crucial point is off-session payments that occur with subscriptions. The Stripe procedure is described here: https://stripe.com/docs/payments/cards/saving-cards#saving-card-without-payment

Can Stripe support Offline Payments?

I am using Stripe for online payments but also users can pay offline (cash or check). I want to centralize all my invoices/charges in one place (Stripe).
I am not sure if I can add offline payments (cash or check) to stripe or not. I guess I can if I created customers, invoices, charges with livemode=false for my live keys.
Is this feasible and will Stripe accept having some (customers, invoices and charges) with livemode=false and others with livemode=true?
If yes, should I fill fake credit card info or should I set it as nil?
Stripe does not allow you to create a Subscription on a Customer if you don't have a credit card setup. More accurately, it does not allow you to create a subscription if a customer does not have a way to pay for the next invoice. So for offline payments, you could update the 'account_balance' on the customer to have a negative value equal to the amount the customer wired (credits). Stripe will then allow you to create a subscription for the customer because it knows that the customer has enough account balance to pay for the next invoice. This post has more details.
We don't currently support offline payments, so you'll want to look at a separate accounting system for those payments.
That said, it's totally understandable that you'd want to keep this data in one place. You might be interested in using our webhooks system to offer live updates to your accounting system without directly touching the code that creates the charge in Stripe.

Recurring billing (variable amount and frequency)

I can find a good payment solution for my site and recurring payments. I've been looking around but can't find any great way of doing it.
On our site our customers are spending virtual credits. The charge their account with new credits when their credits are out. We want to provide them with an automatic refill functionality but we do not want to deal with all the PCI-DSS problems that comes with it.
Basically I'm looking for the following functionality:
The payment provider should expose (secure hosted pages) where the customer provides all credit card details.
My site loads the hosted pages with some customerID (to be able to map tokenID with customerID in the last step).
When the customer has registered his credit card details the payment provider sends a notification to my site that credit card details has been tokenized with a tokenID for customerID.
In the future I charge my customer with an API call:
API::charge(currency,amount, tokenID);
Is there any payment providers out there that can do this?
You can't use a normal recurring billing system if the amounts change from cycle to cycle. The best you can do is use a service like Authorize.Net's Customer Information Manager (CIM) to store the credit card and billing information for you and then you create your own scheduling engine that charges against the payment method you have stored for them using CIM. CIM also allows you to make off-cycle payments at any time as well.

Resources