Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

murtaza1904's avatar

How to Implement Card-Based Transactions with PayPal Payouts?

Hi everyone,

I’m working on a Laravel project where I need to implement the following functionality:

The acceptor (user receiving payments) provides their card details (card number, expiry date, CVV) in the application. These card details are sent to PayPal, and I store the returned token securely for future use.

The sender (user making the payment) also provides their card details, and payments are processed as follows: 90% of the payment goes to the acceptor. 10% of the payment goes to the admin as a fee.

Initially, I considered using PayPal Payouts, as it supports splitting payments and managing multiple recipients. However, the recipient_type in PayPal Payouts only allows EMAIL, PHONE, or PAYPAL_ID. When I send the acceptor’s card details to PayPal to generate a token, PayPal doesn’t return any of these recipient types (EMAIL, PHONE, or PAYPAL_ID) that I could use to send payouts.

Is there a way to use PayPal Payouts or any other PayPal API for this functionality? If not, what would be the best approach to handle this type of payment flow where both parties provide card details, and the payment is split between the acceptor and the admin?

Any guidance or recommendations would be highly appreciated!

0 likes
7 replies
martinbean's avatar

@murtaza1904 You should be allowing “acceptors” to connect their PayPal account to your site using OAuth. You will then get an OAuth token, which you can then use to fetch that user’s PayPal account details (including ID). This is the ID you will then need to store in your database, and reference when creating payouts.

1 like
murtaza1904's avatar

@martinbean You mean like this

<a href="https://www.sandbox.paypal.com/signin/authorize?client_id=YOUR_SANDBOX_CLIENT_ID
&response_type=code
&scope=openid email https://uri.paypal.com/services/paypalattributes
&redirect_uri=MY_WEBSITE_URL" 
target="_blank">
    <button>Connect with PayPal</button>
</a>

But PayPal is returning the error page

Sorry about that

Looks like this action is not supported. Please return and report this error so that we can support it in the future. (invalid client_id or redirect_uri)
martinbean's avatar

@murtaza1904 I’m not really sure how I’m meant to know if the redirect URI is correct when you just put “MY_WEBSITE_URL”?

Go to your app’s settings in PayPal’s dashboard, check the URI, and check for any requirements (i.e. whether it needs to be HTTPS or not).

murtaza1904's avatar

@martinbean Oh! I initially created a platform app from the PayPal dashboard, which might have caused the issue. So, I created a new merchandise app, set the redirect URL and scope, and now it's working. Thank you for your assistance!

Please or to participate in this conversation.