简体   繁体   中英

PHP: PayPal Integration

im building a site where 2 user groups exist: sellers and buyers. The buyers buy stuff and should pay to the sellers via PayPal.

So, its not a kind of a web shop where users are paying directly to me ( as a website owner/online shop), BUT TO THE OTHER USERS (sellers). So i need to forward a PayPal transaction from one user on my site (buyer) to the other one (seller).

I read some PayPal API Descriptions, but its assumed there that i want to process the PayPal Payments to my PayPal account, what's not my case. An idea would be that sellers pay to me, and i then pay to buyers, but that's not what i want to do.

So , what I want is: the buyer should process the PayPal payment directly to the seller's PayPal account, and i should then receive the payment confirmation and inform the seller about it.

Does anyone have an idea, expirience or suggestion with this stuff? Thanks in advance!

You have a lot of options for how you can handle that.

One, you could use the Express Checkout API to build the checkout system, and you'd use the Permissions API (optional) so that users can easily grant your application permissions to make API calls on their behalf. Note that users could also do this manually through their PayPal profile until you get the Permissions part integrated.

To get your payments, you could have your users create a preapproval profile using the Preapproval API . This will allow you to submit payments on their behalf automatically at any time. As such, you could use the preapproval key within Pay calls directly in the checkout flow or within IPN (which is what I would recommend) to submit payments to yourself from the user's account.

Another option is to use a parallel payment within Express Checkout . This would handle splitting the payment for you automatically between the seller and yourself, but the buyer would see that split during checkout.

Another option would be to use the Pay API for the checkout which would allow you to create a chained payment. This is the same as a parallel payment except that it hides the split from the buyer, and you could actually delay the payment to secondary receivers if you need to for any reason.

Hope that helps.

if you have a buy now button or similar, use the sellers' email address as below

<input type="hidden" name="business" value="sellers@email.com">

and it will pay the user with that email address. If that's not their paypal address, it will prompt them to either sign up for paypal to receive or add it to a current account.

Then use PHP mail() or your CMS/Admin system to notify you when the successful payment page has been loaded after a referral back from Paypal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM