cancel
Showing results for 
Search instead for 
Did you mean: 

Set custom payee in Paypal payment button

cheeseexpert
Contributor

Set custom payee in Paypal payment button

I want to use the Paypal payment button (https://www.paypal.com/buttons/smart?flowloggingId=710a23ebb71f6) to pay someone of your choosing, rather than paying the website owner a set amount. Someone suggested I set the payee (https://developer.paypal.com/docs/checkout/integration-features/custom-payee/) as an object within the purchase_units array, but I can't figure out how to do this. Can anyone help? Thanks.

2 REPLIES 2
iFlash
Contributor

Re: Set custom payee in Paypal payment button

I have the same problem. Example code of Paypal creates an error. If I leave out the "payee" element, the code works, as soon as its in, the code breaks. 

iFlash
Contributor

Re: Set custom payee in Paypal payment button

I found the solution. The example in the Paypal documentation is wrong. The payee section needs to be part of the "purchase_units" array and not part of "amount" array. So it should look like this:

 

'purchase_units'=>[0=>[
    'payee'=>[
         'email_address'=>'some email address'
    ],
    'amount'=>[
...

 

Hope this helps.