Several questions about paypal pro subscriptions flow - php

I have integrated standard paypal with one of sites and it works as follows: user selects which subscription to buy, he is redirected to paypal, paypal sends IPN response, I process it and then every X days PayPal sends a new IPN notifying site that user has been successfully charged for new subscription iteration. Now the problem is that user needs to have paypal account to sign up for such subscription.
The customer contacted PayPal and found out that it is possible to avoid having user to use their PayPal account to buy subscription when seller uses paypal pro account. Is it really so? Will I be able to gather user's card info, then send some request to PayPal API and have the subscription created. If yes, what will happen next? PayPal will be sending me IPN requests every X days notifying site that the card has been successfully charged?
Also, what is the general flow? Do I always have to gather card info and send it to paypal api or can I redirect user to paypal in a similar way as standard paypal functions?

Yes, this is possible. You would need to sign up for PayPal Website Payments Pro and Direct Payment Recurring Payments. You can then use the CreateRecurringPaymentsProfile API and specify the card details directly in a single API call.
This will create a recurring profile, which is billed every X days / months, depending on what you specified as the billing period in CreateRecurringPaymentsProfile.
Alternatively, you can also sign up for PayPal Premium Services (for the UK) or PayPal Enhanced Recurring Payments (for the US). This allows you to accept subscription payments from guest users, using the exact same integration you have at the moment, except a 'guest payment' section will be added to the PayPal checkout screen, so buyers won't be forced to create a PayPal account to sign up for your subscriptions any longer.
(Note: Enhanced Recurring Payments / Premium Services has other benefits as well, such as Installment Plans, but guest subscription payments is definitely the biggest benefit).

Related

Stripe - Payout the sellers with custom amounts (On demand)

The situation
In my e-commerce project, I'm using stripe card element to catch payments from customers to the platform's Stripe account. After my Laravel application listens to the webbook of a successful payment that is fired by Stripe, the app then fires a job to add credit on the seller's platform account. This part works perfectly fine.
The question
Is there a way to add some sort of a button in the seller's profile on the platform that allows the seller to receive exactly the amount that is on their account on the platform?
Let's say he has $100 credit on the platform, after clicking 'pay me' button, the seller will get this $100 paid out from the platform's stripe account to his bank account.
I have accomplished until now:
1- A visitor can add item to cart and checkout.
2- Uses stripe card element to take the payment.
3- When payment is successful, the amount goes to the platform's stripe account.
4- The application listens to successful payment webhook and adds credit to the seller's account on the platform (As simple as having a column on the database for each seller with the default of 0 and it increases upon each successful customer payment).
Thoughts
What do you think about this? https://stripe.com/docs/connect/add-and-pay-out-guide
I'm thinking of using this technique since I'm doing everything manual. I believe I can skip the part where I top-up my Stripe account (Since it should be having credit by default from the successful payment).
So here is what I think:
0- A customer makes a successful payment towards some products and the application catches Stripe webhooks and fires a job to add credit to the seller's platform account.
1- The seller receives a notification that he has credit on the platform's account.
2-  The seller then can click on a button that takes him to a route where I redirect him to create (stripe express account)[https://stripe.com/docs/connect/add-and-pay-out-guide?integration=with-code#with-code-create-account-link]
3- After the seller gets redirected to the platform again and I catch the webhook that account has been created, The seller then will be redirected to receive the determined amount by my platform. https://stripe.com/docs/connect/add-and-pay-out-guide?integration=with-code#with-code-pay-out-to-user
You can ask your sellers to register an express account when they onboard your platform, so that your sellers can submit all necessary documentation for account verification and make their accounts payout enabled.
When your customer is about to make a payment, you should create a destination charge so that Stripe can automatically transfer the funds from platform to a connected account, you can also opt to charge an application fee from this transaction if you wish.
Stripe will automatically perform payouts based on the account's payout schedule , if you prefer to do it manually, change the schedule's interval to manual . Visit this page to learn more about manual payouts.

Automate PayPal commission payments from Merchant when someone subscribes

I'm building a site for a client that involves a number of content creator users that other users can subscribe to with automatically recurring monthly payments (think OnlyFans). All transactions are to go through PayPal, which I thought would be the easiest solution. I'm coding in PHP (WordPress environment) using Curl to call the REST API.
I've got the content creators on-boarding fine as merchants. I originally went down the path of creating Orders, and PayPal has a great commission tool in that system so that my client will get their commission every time a user starts a subscription. I was going to take care of the recurring payments at my own end, but then I discovered PayPal's Subscription system - it seemed perfect, but it doesn't have the automatic commission facility of the orders system, which is a bummer. So I could have PayPal automate the commissions while I programmed a subscription system, or I could use their subscription system and ... what?
That's where I'm stuck. I now need to automate PayPal deducting a payment from my merchant and paying it to my client as their commission. This needs to be done whenever a subscription is started and then each month as the subscription payment comes through. I've tapped into web-hooks to get notified when these automated monthly payments are happening (at least I'm hoping I have), but how can I automate a percentage of the initial payment and each subsequent monthly payment to be automatically deducted from the merchant and paid to my client?
I've looked at orders, but that needs to be approved by the merchant. What else is available to me?
To automate sending payments from your own account to creators or affiliates, you could potentially use Payouts.
See here for information on requesting access to Payouts.

paypal Preapproval API

we are trying to add a pre-approval paypal process to our website before a user can bid on any of our items for sale. We currently accomplished this using Authorize.net but want to now integrate paypal as well.
I have been doing some research and am trying to find out if paypal even offers such a solution. The main reason for adding this verification is of course to make sure an individual actually has the money to purchase the item, some items can range from $100-$100,000. Does paypal offer a pre approval process for those types of transactions?
https://developer.paypal.com/docs/classic/api/adaptive-payments/Preapproval_API_Operation/
The Preapproval API gives your application permissions to trigger payments on a user's behalf without further approval (no login required to submit payments with a preapproval ID). There is no guarantee funds will be available when you submit this payment. A transaction with a preapproval ID could simply fail like any other transaction.
It sounds like what you're looking is the Authorization and Capture process, which is probably what you're doing with Auth.net, too.
With PayPal you can run Authorizations from credit cards directly (exactly like you do with Auth.net) and you can also do it with Express Checkout, which would be PayPal login payments.

IPN feedback for 2 people

I have a page on my site which sends out payments to more than 1 person. I've been testing this using the paypal sandbox account with a few test accounts.
I am also using ipn to get feedback from paypal when payments are complete, pending etc.
My question is, paypal sends me back info via ipn for just 1 of the payments. Why is that? When I check the payment amount in the ipn, it only shows me the payment for 1 of the people who got paid. For example:
If I pay person 1 and 2, where each person gets paid $10 each, so a total of $20. The ipn page only shows me the details for person 1 and says that the payment amount was $10, when the total payment amount is $20.
This is causing me a problem because I need to know that both payments were successful via ipn. At the moment I can only check the payment for 1 person at a time, even though I am paying 2 people at the same time.
How do I get payment for both people?
#Pete answer is a violation of the Paypal User Agreement (unless you have a separate legal entity for both accounts)
9. Restricted Activities
9.1 Restricted Activities. In connection with your use of our website, your Account, or the Services, or in the course of your interactions with PayPal, a User or a third party, you will not:
a. Breach this Agreement (including, without limitation, opening multiple PayPal accounts or breaching the Card Processing Agreement, the Acceptable Use Policy or any other agreement that you have entered into with PayPal (including a Policy));
What you are looking for is PayPal Adaptive Payments. A note about this though: one account - probably you as the application owner - must have a PayPal business account. The others that receive a payment only need a personal account.
PayPal provides an SDK with samples for the Adaptive Payments on Github. Select Adaptive Payments from the menu on the left. There are samples for multiple languages that should be able to get you started.
My hunch is that IPN is tied to the individual account, not the payment, and you have the IPN set up from just one of the accounts. I think what you need to do is configure the IPN on both accounts and then process the response from PayPal two times... once from the IPN notification of the first account, and once from the IPN notification of the second account.

Payment systems with paypal with pre authorisation and incremental use of credit

I am developing a commerce app with php/mysql. My boss wants this:
user can buy "ad credits" on our website and he wants this to be a paypal pre authorisation
then the user can use ad bundles with various costs
this costs are taken from the ad credits and he wants this to be the actual decrement of user credits in paypal
Example: John buys an ad credits pack of 30$. He pre authorises this trasaction with his paypal account. Then he buys two banner spaces for the cost of 10$. So 10$ are taken from his paypal.
Is this possible? Paypal APIs?
There are a couple of ways you could handle this.
1) You could use Express Checkout to setup a billing agreement with the buyer and then use DoReferenceTransaction to process future payments using that billing agreement.
You can do the same thing with Payments Pro, too. In your original request you would just run an Authorization of 1.00 and then immediately void that authorization. You could then use that transaction ID you get back from the authorization to process future payments with DoReferenceTransaction.
2) You could setup a Preapproval Profile with the buyer using the Preapproval API. You would then use the Pay API to process payments in the future using the preapproval key you got back from that Preapproval API. This is all explained in detail in the Adaptive Payments documentation.

Categories