You’re not the only person experiencing it so I wouldn’t assume it’s a bug. I haven’t looked into it yet though.
For now I recommend using the Legacy handler for PayPal.
Thanks for the linking @Old Nick as I'm having the same issue with user upgrades and recurring payment.Two things:
1. The user requested it to be deleted so we complied
2. The issue being reported is also mentioned in this thread so a further thread is not needed
We’re aiming for a fix in the next release.
Does this mean if I upgrade all will be fine as long as I do nothing and just stick with the legacy Paypal leaving everything the way it is and not set up the new Paypal profile?For now I recommend using the Legacy handler for PayPal.
There may be a delay before changes are rolled out to the XenForo Community.Ensure PayPal products are created with a unique ID.
src/XF/Payment/PayPalRest.php
$planDetails = $this->makePayPalRequest('get', 'v1/billing/plans', [
'json' => [
$planDetails = $this->makePayPalRequest('get', 'v1/billing/plans', [
'query' => [
query
instead of json
). 'name' => substr($purchase->title, 0, 127),
'name' => substr($purchase->purchasableTitle, 0, 127),
Good,I drew some conclusions as to what I thought the issue was and it turns out that, while that was a bug, it was not the bug you were running into.
You can patch this yourself.
You will need to open the file:src/XF/Payment/PayPalRest.php
Find:
PHP:$planDetails = $this->makePayPalRequest('get', 'v1/billing/plans', [ 'json' => [
And change to:
PHP:$planDetails = $this->makePayPalRequest('get', 'v1/billing/plans', [ 'query' => [
(Change this one line to readquery
instead ofjson
).
in the same file, we are also changing this line:
PHP:'name' => substr($purchase->title, 0, 127),
To:
PHP:'name' => substr($purchase->purchasableTitle, 0, 127),
$productDetails = $this->makePayPalRequest('post', 'v1/catalogs/products', [
'json' => [
'id' => $productId,
'name' => $purchase->title,
'type' => 'DIGITAL',
'category' => 'MISCELLANEOUS_GENERAL_SERVICES',
],
], $accessToken, $errors);
is there any function for the api to indicate that it is a product that does not require shipping ?This is how we create the PayPal products:
PHP:$productDetails = $this->makePayPalRequest('post', 'v1/catalogs/products', [ 'json' => [ 'id' => $productId, 'name' => $purchase->title, 'type' => 'DIGITAL', 'category' => 'MISCELLANEOUS_GENERAL_SERVICES', ], ], $accessToken, $errors);
o resolve the issue, please follow the below detailed steps & instructions based on your website integration.
1. For REST API integration : You can pass value "NO_SHIPPING" to disable shipping address during checkout.
For digital goods, the payment API request call should be correct value under "Shipping_Preference" field.
shipping_preference :
Default: GET_FROM_FILE.
- GET_FROM_FILE. Get the customer-provided shipping address on the PayPal site.
- NO_SHIPPING. Redacts the shipping address from the PayPal site. Recommended for digital goods.
- SET_PROVIDED_ADDRESS. Get the merchant-provided address. The customer cannot change this address on the PayPal site. If merchant does not pass an address, customer can choose the address on PayPal pages.
Guide link - https://developer.paypal.com/docs/api/orders/v2/#definition-application_context
2. For NVP API integration, pass the "no_shipping" as "1" in your SetExpressCheckoutRequest API call to disable shipping address during checkout.
NOSHIPPING : Determines whether PayPal displays shipping address fields on the PayPal pages. For digital goods, this field is required, and you must set it to 1.
Value is:
• 0 — PayPal displays the shipping address on the PayPal pages. But do not require one.
• 1 — PayPal does not display shipping address fields and removes shipping information from the transaction.
• 2 — If you do not pass the shipping address, PayPal obtains it from the buyer's account profile. require one.
Guide link - https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout-API-Operation-NVP/
3. For "PayPal Payments Standard" legacy button integration, pass the "no_shipping" as "1" to disable shipping address during checkout.
I drew some conclusions as to what I thought the issue was and it turns out that, while that was a bug, it was not the bug you were running into.
You can patch this yourself.
You will need to open the file:src/XF/Payment/PayPalRest.php
Find:
PHP:$planDetails = $this->makePayPalRequest('get', 'v1/billing/plans', [ 'json' => [
And change to:
PHP:$planDetails = $this->makePayPalRequest('get', 'v1/billing/plans', [ 'query' => [
(Change this one line to readquery
instead ofjson
).
in the same file, we are also changing this line:
PHP:'name' => substr($purchase->title, 0, 127),
To:
PHP:'name' => substr($purchase->purchasableTitle, 0, 127),
$planDetails = $this->makePayPalRequest('get', 'v1/billing/plans', [
'json' => [
'name' => substr($purchase->title, 0, 127),
src/XF/Payment/PayPal.php
'no_shipping' => !empty($paymentProfile->options['require_address']) ? 2 : 1,
'no_shipping' => 1,
'no_shipping' => 0,
'no_shipping' = 2
into the request? Or is it just skipping the 'no_shipping'
parameter all together?These kinds of things should be fully integrated from a tick to mark in the administration control panel.How to stop PayPal asking for Shipping Address
You can change the setting in your XenForo code. Specifically, look at this part of your XenForo PayPal payment provider:src/XF/Payment/PayPal.php
PayPal.php on line 109 :'no_shipping' => !empty($paymentProfile->options['require_address']) ? 2 : 1,
This line controls whether PayPal asks for a shipping address:
- 2: Address is required.
- 1: Address is not required.
- 0: Address is optional.
Solution:
If you don’t need the address at all, change this line to:'no_shipping' => 1,
Or, if you want to allow but not require the address, use:'no_shipping' => 0,
This should stop PayPal from requesting the user's shipping address when they check out.
UPDATE: This still does not seem to work, I suspect Xenforo is hardcoding 2 into the request.
@est3ban129 , best option is to go back to Paypal Legacy.
We use essential cookies to make this site work, and optional cookies to enhance your experience.