Forums / PayPal RESTful support / PayPal RESTful API Payment Module

PayPal RESTful API Payment Module

Views: 84,746

Results 321 to 340 of 491
20 Sep 2025, 10:11 PM
#321
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

PayPal RESTful API Payment Module

siliconbug:

New error log after removing the comma (,) :

[20-Sep-2025 08:55:25 Canada/Pacific] PHP Parse error: syntax error, unexpected '|', expecting ';' or '{' in /includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php on line 367

[20-Sep-2025 08:55:25 Canada/Pacific] Request URI: /index.php?main_page=checkout_shipping, IP address: x.x.x.x
--> PHP Parse error: syntax error, unexpected '|', expecting ';' or '{' in /includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php on line 367.

I kinda figured that that would happen.  Try removing the "return type hint" on line 367, so that the code block above now reads
```php
    public function updatePackageTracking(
        string $paypal_txnid,
        string $tracking_number,
        string $carrier_code,
        string $action = 'ADD',
        bool $email_buyer = false
    ) {  
21 Sep 2025, 3:37 AM
#322
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: PayPal RESTful API Payment Module

New errors after removing the "return type hint" on line 367:

[20-Sep-2025 20:32:49 Canada/Pacific] PHP Parse error:  syntax error, unexpected '|', expecting ';' or '{' in /zc/includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php on line 588

[20-Sep-2025 20:32:49 Canada/Pacific] Request URI: /index.php?main_page=checkout_shipping, IP address: x.x.x.x
--> PHP Parse error: syntax error, unexpected '|', expecting ';' or '{' in /zc/includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php on line 588.
21 Sep 2025, 12:07 PM
#323
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: PayPal RESTful API Payment Module

siliconbug:

New errors after removing the "return type hint" on line 367:

[20-Sep-2025 20:32:49 Canada/Pacific] PHP Parse error: syntax error, unexpected '|', expecting ';' or '{' in /zc/includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php on line 588

[20-Sep-2025 20:32:49 Canada/Pacific] Request URI: /index.php?main_page=checkout_shipping, IP address: x.x.x.x
--> PHP Parse error: syntax error, unexpected '|', expecting ';' or '{' in [B]/zc/includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php[/B] on line 588.

Change line 588 of the file highlighted above from
```php
    public function webhookVerifyByPostback($parameters): bool|null

to

    public function webhookVerifyByPostback($parameters)
22 Sep 2025, 10:09 PM
#324
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: PayPal RESTful API Payment Module

It works now, thanks!

Looks like my site doesn't like '|'

23 Sep 2025, 11:40 AM
#325
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: PayPal RESTful API Payment Module

siliconbug:

It works now, thanks!

Looks like my site doesn't like '|'
Yep, that's PHP 7.4 that's "not liking it". Those corrections (and other downward-compatible PHP/Zen Cart changes) will be part of v1.3.0.

26 Sep 2025, 6:05 PM
#326
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,849
Plugin Contributions:
18

Re: PayPal RESTful API Payment Module

[TABLE]

Sorry,
from iPad
zc 2.0.1

[26-Sep-2025 17:50:44 UTC] PHP Fatal error: Uncaught Error: Call to undefined method zcObserverPaypalrestful::notify() in /includes/classes/observers/auto.paypalrestful.php:313
Stack trace:
#0 /includes/classes/observers/auto.paypalrestful.php(130): zcObserverPaypalrestful->outputJsFooter('products_all')
#1 /includes/classes/traits/NotifierManager.php(87): zcObserverPaypalrestful->updateNotifyFooterEnd(Object(notifier), 'NOTIFY_FOOTER_E...', 'products_all', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
#2 /includes/templates/jays_resp/common/tpl_main_page.php(267): base->notify('NOTIFY_FOOTER_E...', 'products_all')
#3 /index.php(94): require('/home/jaysmode/...')
#4 {main}
thrown in /includes/classes/observers/auto.paypalrestful.php on line 313

[26-Sep-2025 17:50:44 UTC] Request URI: /index.php?main_page=products_all&disp_order=5&page=75, IP address: 114.119.153.16
--> PHP Fatal error: Uncaught Error: Call to undefined method zcObserverPaypalrestful::notify() in /includes/classes/observers/auto.paypalrestful.php:313
Stack trace:
#0 /includes/classes/observers/auto.paypalrestful.php(130): zcObserverPaypalrestful->outputJsFooter('products_all')
#1 /includes/classes/traits/NotifierManager.php(87): zcObserverPaypalrestful->updateNotifyFooterEnd(Object(notifier), 'NOTIFY_FOOTER_E...', 'products_all', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
#2 /includes/templates/jays_resp/common/tpl_main_page.php(267): base->notify('NOTIFY_FOOTER_E...', 'products_all')
#3 /index.php(94): require('/home/jaysmode/...')
#4 {main}
thrown in /includes/classes/observers/auto.paypalrestful.php on line 313.

[26-Sep-2025 17:50:44 UTC] Request URI: /index.php?main_page=products_all&disp_order=5&page=75, IP address: 114.119.153.16
--> PHP Fatal error: Uncaught Error: Call to undefined method zcObserverPaypalrestful::notify() in /includes/classes/observers/auto.paypalrestful.php:313
Stack trace:
#0 /includes/classes/observers/auto.paypalrestful.php(130): zcObserverPaypalrestful->outputJsFooter('products_all')
#1 /includes/classes/traits/NotifierManager.php(87): zcObserverPaypalrestful->updateNotifyFooterEnd(Object(notifier), 'NOTIFY_FOOTER_E...', 'products_all', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
#2 /includes/templates/jays_resp/common/tpl_main_page.php(267): base->notify('NOTIFY_FOOTER_E...', 'products_all')
#3 /index.php(94): require('/home/jaysmode/...')
#4 {main}
thrown in /includes/classes/observers/auto.paypalrestful.php on line 313.

[/TD]
[/TR]
[TR]
[TD]

[/TD]
[/TR]
[/TABLE]

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

27 Sep 2025, 12:32 PM
#327
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: PayPal RESTful API Payment Module

You don't say what version of PayPal/RESTful you're running, but the file /includes/classes/auto.paypalrestful.php for v1.2.0+ has only 220 lines and that error's coming from line 313.

29 Sep 2025, 5:52 PM
#328
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: PayPal RESTful API Payment Module

Apologies if this question has been asked before but the plug in is creating logs for every transaction. Is this normal behavior? I have the debug turned off in the plug in.

29 Sep 2025, 10:12 PM
#329
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: PayPal RESTful API Payment Module

wsworx:

Apologies if this question has been asked before but the plug in is creating logs for every transaction. Is this normal behavior? I have the debug turned off in the plug in.
An example of such a log would help greatly in diagnosing the issue.

29 Sep 2025, 10:47 PM
#330
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: PayPal RESTful API Payment Module

Certainly, is there anything that could show up in the log that could be a security risk as the log has some customer information in it as well?

They start at the top with the following:

2025-09-25 11:35:35: (ppr_webhook) ppr_webhook (PAYMENT.CAPTURE.COMPLETED, PayPal/AUHD-1.0-1, POST) starts.

Here is one that started indicating a declined transaction:

2025-09-22 20:51:46: (ppr_webhook) ppr_webhook (PAYMENT.CAPTURE.DECLINED, PayPal/AUHD-1.0-1, POST) starts.
30 Sep 2025, 5:14 PM
#331
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
732
Plugin Contributions:
0

Re: PayPal RESTful API Payment Module

Under Modules --> Payment --> Paypal Restful module, is your Debug Mode set to Log File? Mine is on (so I get all the log files). Maybe yours is too?

  • Jeff
30 Sep 2025, 5:50 PM
#332
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: PayPal RESTful API Payment Module

Jeff_Mash:

Under Modules --> Payment --> Paypal Restful module, is your Debug Mode set to Log File? Mine is on (so I get all the log files). Maybe yours is too?

Thanks for jumping in.
No, mine is set to "Off" that's why I find it strange that it is pumping out these log files when that is turned off.

4 Oct 2025, 10:53 PM
#335
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: PayPal RESTful API Payment Module

I use PayPal Shipping to purchase shipping labels, but I'm unsure if this issue is related to v1.2.1.

When purchasing a shipping label directly from the PayPal order list, I've noticed that the updated PayPal Shipping system, which no longer integrates with ShipStation, no longer provides the customer's actual phone number. Instead, it automatically substitutes the number with a generic placeholder: "9999999999."

I'll turn the log on to look into it.

5 Oct 2025, 1:51 PM
#336
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: PayPal RESTful API Payment Module

siliconbug:

I use PayPal Shipping to purchase shipping labels, but I'm unsure if this issue is related to v1.2.1.

When purchasing a shipping label directly from the PayPal order list, I've noticed that the updated PayPal Shipping system, which no longer integrates with ShipStation, no longer provides the customer's actual phone number. Instead, it automatically substitutes the number with a generic placeholder: "9999999999."

I'll turn the log on to look into it.
Hmm, I use PayPal Shipping, too, but I'm not seeing that 'generic placeholder' on the shipping label (I'm not seeing a phone at all). I'll note that when I view a Payment record, the customer's phone number shows up there.

5 Oct 2025, 9:02 PM
#337
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: PayPal RESTful API Payment Module

lat9:

Hmm, I use PayPal Shipping, too, but I'm not seeing that 'generic placeholder' on the shipping label (I'm not seeing a phone at all). I'll note that when I view a Payment record, the customer's phone number shows up there.

USPS shipping labels do not include phone numbers, whereas UPS labels do.

I don’t see the customer’s phone number in the log, just their name, email, and address. It's also not visible on PayPal's side.

5 Oct 2025, 9:15 PM
#338
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: PayPal RESTful API Payment Module

From the PayPal "Recent activity" table, I clicked on the **Name **for a Payment from Type. From that display, I scrolled down to see the Customer details; the customer's Contact Telephone was listed there.

5 Oct 2025, 9:21 PM
#339
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: PayPal RESTful API Payment Module

I think I might have found it! Looking at PayPal's "create order" API, it looks like both the email address and phone number can be sent up (https://developer.paypal.com/docs/api/orders/v2/#orders_create!ct=application/json&path=purchase_units/shipping&t=request%29; they're not currently.

Send me a PM with your direct email address and I'll make a change to add that information to the payload and send it on over.

I also found this note regarding the phone number:

The phone number of the customer. Available only when you enable the Contact Telephone Number option in the **Profile & Settings** for the merchant's PayPal account. The phone.phone_number supports only national_number.

6 Oct 2025, 4:11 AM
#340
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
125
Plugin Contributions:
0

Re: PayPal RESTful API Payment Module

lat9:

From the PayPal "Recent activity" table, I clicked on the **Name **for a Payment from Type. From that display, I scrolled down to see the Customer details; the customer's Contact Telephone was listed there.

In Transaction details, I see a customer's name and address under Shipping address only.

lat9:

I think I might have found it! Looking at PayPal's "create order" API, it looks like both the email address and phone number can be sent up (https://developer.paypal.com/docs/api/orders/v2/#orders_create!ct=application/json&path=purchase_units/shipping&t=request%29; they're not currently.

Send me a PM with your direct email address and I'll make a change to add that information to the payload and send it on over.

I also found this note regarding the phone number:

The phone number of the customer. Available only when you enable the Contact Telephone Number option in the **Profile & Settings** for the merchant's PayPal account. The phone.phone_number supports only national_number.

PM sent.

Contact telephone number setting in my PayPal account was previously turned off, but I remember that PayPal Shipping used to include the correct phone number on UPS labels by default. I've now switched the setting to On (optional field).