Setting a shipping address donation

40 Views Asked by At

Is it possible to set a shipping address if a paypal donation is used via API? The address needs to be given to PayPal, but I haven't found a solution yet.

$param = '';
$param .= '&business=XXXX';
$param .= '&lc=DE';
$param .= '&item_name=My Company';
$param .= '&item_number=' . $spendenConfig['itemnumber'];
$param .= '&amount=' . $spendenConfig['amount'];
$param .= '&currency_code=EUR';
$param .= '&no_note=1&no_shipping=1&rm=1';
$param .= '&return=' . $paypalReturnUrl;
$param .= '&cancel_return=' . $this->PAYPAL_CANCEL_URL;
$param .= '&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted&status=success';
header('Location: https://www.paypal.com/cgi-bin/webscr?cmd=_donations' . 
$param);

Maybe it is not possible because a donation does not need a "shipping address", but I need that for a donation receipt.

1

There are 1 best solutions below

0
Michael Haephrati On

Yes, you can use this example from PayPal developer's portal. In this example, we set a request to require a confirmed address for shipping. The shipping address is in fact a piece of information that comes from the buyer, not the seller, so the ExpressCheckout parameters in this example will require the buyer to fill these fields:

[requiredSecurityParameters]
&METHOD=SetExpressCheckout
&RETURNURL=https://...
&CANCELURL=https://...
&PAYMENTREQUEST_0_AMT=10.00
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_SHIPTOSTREET=1 Main St
&PAYMENTREQUEST_0_SHIPTOCITY=San Jose
&PAYMENTREQUEST_0_SHIPTOSTATE=CA
&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=US
&PAYMENTREQUEST_0_SHIPTOZIP=95131
&PAYMENTREQUEST_0_SHIPTOPHONENUM=408-967-4444