Dynamic Paypal Payee with direct checkout - php

I'd like to have different Paypal payees depending on the URL being viewed and using direct checkout so the user never leaves my site. So for example at example.com/brandA someone could buy a product that brandA is selling and brandA gets paid, and at example.com/brandB someone could buy a product that brandB is selling and brandB gets paid. Can I do this all through an API where all I need to specify is the payee email address? Or does each payee need to set up a Paypal Payments Pro account?

If you're processing the payments using Payments Pro (PayFlow or DoDirectPayment) then each seller would need Pro enabled on their own account, and you'd need to have them setup Permissions or use the Permissions API to make API calls on their behalf.
If you go with Express Checkout you can just set the PAYMENTREQUEST_n_SELLERPAYPALACCOUNTID parameter to the email address of the PayPal account you'd like the money to fall to. That will work without any permissions necessary.
Note: the n in the parameter name would be a 0,1,2,etc. depending on how many payments were included on the order. With a single payment you would just use PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID=some#emailaddress.com

Related

Marketplace using Paypal

Hi we are creating a mobile app for marketplace where we are hoping to get eBay model implemented. Where buyer will pay the seller and we will take our cut from the seller. We actually don't want to get payment ourself for the sale and handle the disputes for order shipping or chargebacks.
When a sale is done on our app, the buyer should send the payment to the sellers paypal and then Paypal will handle all the other stuff regarding that like disputes or chargebacks.
I want seller to link his paypal account to our app and we will take permissions for future payments and maintain a record where we can calculate his fee regarding sales made on our platform. Paypal Mobile SDK support this feature.
But my question here is how can we automate the original purchase process? One option is when a sale is done, we will send invoice from seller side to the buyer (possible using Paypal REST API) and open invoice pay link on the buyer side. Once the buyer pay the invoice and transfer the funds to the seller we will know that sale is approved successfully because as a Paypal facilitator we have access to that invoice (we actually sent that invoice to the buyer as we have permissions of invoicing of seller account).
But what if we don't want invoicing system? Can we implement anything where buyer will send the funds to the seller without generating an invoice from our app. Like when a sale initiated, we will present buyer a page where he will pay directly to the seller (without us involved) and we will track that transaction and make outstanding cut on that sale?
My Research so far
Payapl mobile SDK for iOS don't allow us to take permissions for invoicing, we can take single, future or profile sharing permissions in app
Paypal Rest API allow us to take permissions for invoicing but not for future payments (that is necessary to take our cut from the seller's account)
If we use Paypal Mobile SDK, we can take funds in our account but not directly to our sellers account
Adaptive payments is an option where can take funds from buyers and after deducting our cut send the rest to the buyer but in that case we will be primary recipient and seller will be secondary, being a primary recipient we are responsible for shipping the product which at this stage we don't want. Want want to be seller as primary recipient
Any help regarding our situation would be greatly appreciated. We just want to automate the system somehow with the APIs and SDKs without being the primary recipient. Please give us suggestion to make this a reality. Thanks
Using any other payment gateway like Stripe or Braintree will not help here because in that case we will be taking money as registered merchants. We would really like to work with Paypal for handling all order related stuff
The Express Checkout API supports Parallel Payments, in which case you specify the SELLERPAYPALACCOUNTID in the request. This is where the money for that particular payment would be sent.
You can use this functionality even with a single payment on the order, though. So you can just setup a single payment and include that SELLERPAYPALACCOUNTID parameter, and the money will go directly to that account.
When doing this you can use your own API credentials and no permissions or anything are required from the 3rd party account to send the funds directly to them.
This PayPal PHP SDK will make the Express Checkout API calls very quick and easy for you, so you could just setup some simple PHP services to hit from your mobile app(s).

Paypal Chained Payments, pass shipping address

On my e-commerce website I'm using paypal for checkout. The flow is like this:
Buyer can select one or more products from one or more sellers. When paying I use chained payments. My paypal app account( primary) receives all the money and then I take my fee and send the rest to sellers(one or more). Everything is fine but I need to activate seller protection.
So far I implemented setPaymentsOption, but since I'm the primary receiver I cannot pass the shipping address from buyer to seller(s). I spoked with paypal support and they said that I shoud consider implementing IPN but I'm not sure how to do that.
So for any ideas I will be grateful

Set shipping address in PayPal Adaptive Payment call

For a marketplace project, I use the PayPal Adaptive Payment to make parallels payments between the buyer, products salers and the website Paypal account for fees.
In order to apply the Seller Protection, I need the buyer to select a shipping address but I can't find any option to send it.
It seems that I can set the option "requireShippingAddressSelection" to true only with embedded payment flow but is there any way to send a custom address with? And above all, does this option make the payment available for the PP seller protection which is what my client really looking for?
You'll need to use SetPaymentOptions to include details like shipping address, order items, shipping amount, tax amount, etc.
Your Pay request action will be set to CREATE and then you'll pass that PayKey into SetPaymentOptions to set all of the other details prior to redirecting the user to PayPal to complete the checkout.

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.

Put my logo on Paypal page when my sellers sells some product from my website

I am doing paypal integration in my website in a section called stores where an user can sell his products from my store. And i am storing the paypal accounts of my sellers to pay him directly when customer purchase something from his store in my website. Is it possible to put my logo on the paypal checkout page where the seller email id i'm passing will not be mine(Since each sellers will have their own Paypal Business email id)?
Yes, you can make it using PayPal Express Checkout. No need for upgrading to Pro, and paying a fixed monthly fee.
When setting up the express checkout transaction, you have a parameter that tells PayPal which images to show for branding.
https://www.paypalobjects.com/en_US/ebook/PP_APIReference/expresscheckout.html#1144280
The parameter name is called cpp-header-image which make sure it's delivered through HTTPS otherwise the browser may ask the user is he/she want to see only the securely delivered content.
There is something called "PayPal Payments Pro", which allows you to have many options over a typical PayPal account. From X.com (a great resource for learning about the Paypal API Stack), I was able to pull the following link for you (which explains what you are wanting to do)
https://www.x.com/developers/paypal/products/paypal-payments-pro

Categories