BubbaLovesCheese
Active member
If you only sell User Upgrades, and you do NOT sell physical items, then you can prevent the newest Paypal Rest API from asking for a shipping address.
Just add this code
Just add this code
'shipping_preference' => 'NO_SHIPPING'
just after Line 237 in your /src/XF/Payment/PayPalRest.php
file on your server.
PHP:
protected function getSubscriptionParams(string $planId, PurchaseRequest $purchaseRequest, Purchase $purchase): array
{
return [
'plan_id' => $planId,
'quantity' => '1',
'custom_id' => $purchaseRequest->request_key,
'application_context' => [
'return_url' => $purchase->returnUrl,
'cancel_url' => $purchase->cancelUrl,
'shipping_preference' => 'NO_SHIPPING', // Prevents Paypal asking for shipping address. Add to line 238
],
];
}