Page 32 of 45 FirstFirst ... 22303132333442 ... LastLast
Results 311 to 320 of 449
  1. #311
    Join Date
    Jun 2012
    Location
    California
    Posts
    259
    Plugin Contributions
    0

    Default Re: PayPal RESTful API Payment Module

    Okay, the second error log above is BS because it occurred before I got upgraded to the new paypal so ignore that.
    In regards to the first error log above ChatGPT, I know hiss, hiss, boo, boo but it helps me a lot sometimes, indicates that this is a PHP method signature mismatch between the PayPal RESTful module and Zen Cart’s messageStack class:

    paypalr is declaring:

    Code:
    public function output(?string $class = null)

    Zen Cart’s messageStack::output() is declared as:

    Code:
    public function output($class)
    In PHP 8+, method signatures in subclasses must match exactly (including nullable types and default values).

    Proposed fix:
    Open:

    /includes/modules/payment/paypal/PayPalRestful/Admin/Formatters/Messages.php


    Find:

    Code:
    public function output(?string $class = null)

    Replace with:

    Code:
    public function output($class = null)

    That makes the signature compatible with messageStack::output($class).

    If the above is correct then I will just make the change.
    If not then I apologize and please advise.
    Thank You for any assistance with this issue.

  2. #312
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,903
    Plugin Contributions
    96

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by wsworx View Post
    Okay, the second error log above is BS because it occurred before I got upgraded to the new paypal so ignore that.
    In regards to the first error log above ChatGPT, I know hiss, hiss, boo, boo but it helps me a lot sometimes, indicates that this is a PHP method signature mismatch between the PayPal RESTful module and Zen Cart’s messageStack class:

    paypalr is declaring:

    Code:
    public function output(?string $class = null)

    Zen Cart’s messageStack::output() is declared as:

    Code:
    public function output($class)
    In PHP 8+, method signatures in subclasses must match exactly (including nullable types and default values).

    Proposed fix:
    Open:

    /includes/modules/payment/paypal/PayPalRestful/Admin/Formatters/Messages.php


    Find:

    Code:
    public function output(?string $class = null)

    Replace with:

    Code:
    public function output($class = null)

    That makes the signature compatible with messageStack::output($class).

    If the above is correct then I will just make the change.
    If not then I apologize and please advise.
    Thank You for any assistance with this issue.
    Thanks for the report; the issue was previously reported in this (https://github.com/lat9/paypalr/issues/81) GitHub issue. The solution you posted was also suggested there, so I'll say you can "go with it".

  3. #313
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    934
    Plugin Contributions
    9

    Default Refunds not being recognized? + 1 Additional Question

    PHP 8.4 / ZC 2.1.0 / PayPal RESTFUL 1.2

    Testing the module out and everything works as far as recognizing paying events (CREATE, CAPTURED, COMPLETED). However, triggering an refund from the PayPal side of things has the order not recognize that it was refunded.

    That is to say: if I charge an order, then try to refund that order, the PayPal refund doesn't reach the ZC Database. I can see a log is generated (attached below, it's from the sandbox) but then at the end of it, the module notes that it cannot find the order and just drops out.

    Is this something to be concerned with?

    Code:
    2025-09-14 09:54:36: (ppr_webhook) ppr_webhook (PAYMENT.CAPTURE.REFUNDED, PayPal/AUHD-1.0-1, POST) starts.{
        "id": "WH-74T39592TU773570G-4UR976727P454984C",
        "event_version": "1.0",
        "create_time": "2025-09-14T13:54:28.338Z",
        "resource_type": "refund",
        "resource_version": "2.0",
        "event_type": "PAYMENT.CAPTURE.REFUNDED",
        "summary": "A $ 0.01 USD capture payment was refunded",
        "resource": {
            "seller_payable_breakdown": {
                "total_refunded_amount": {
                    "value": "0.01",
                    "currency_code": "USD"
                },
                "paypal_fee": {
                    "value": "0.00",
                    "currency_code": "USD"
                },
                "gross_amount": {
                    "value": "0.01",
                    "currency_code": "USD"
                },
                "net_amount": {
                    "value": "0.01",
                    "currency_code": "USD"
                }
            },
            "amount": {
                "value": "0.01",
                "currency_code": "USD"
            },
            "update_time": "2025-09-14T06:54:24-07:00",
            "create_time": "2025-09-14T06:54:24-07:00",
            "invoice_id": "PPR-20250914095258-1-PauWil-c05c82fc",
            "links": [
                {
                    "method": "GET",
                    "rel": "self",
                    "href": "https:\/\/api.sandbox.paypal.com\/v2\/payments\/refunds\/27L28035LL8140251"
                },
                {
                    "method": "GET",
                    "rel": "up",
                    "href": "https:\/\/api.sandbox.paypal.com\/v2\/payments\/captures\/50A226912H175722S"
                }
            ],
            "id": "27L28035LL8140251",
            "payer": {
                "email_address": "[email protected]",
                "merchant_id": "K5V8XYA7Z66VL"
            },
            "status": "COMPLETED"
        }
    }
    ************************************************
    
    
    webhook verification passed
    ************************************************
    
    
    webhook event supported by PayPalRestful\Webhooks\Events\PaymentCaptureRefunded
    PAYMENT.CAPTURE.REFUNDED - action() triggered
    ************************************************
    
    
    2025-09-14 09:54:37: (ppr_webhook) validateCredentials: Checking (1).
    TokenCache::clear, clearing cached token.
    The curlPost (v1/oauth2/token) request was successful (200).
    {
        "token_type": "Bearer",
        "expires_in": 31492
    }
    TokenCache::save, saving access-token; valid for 31492 seconds.
    
    
    ************************************************
    
    
    
    
    ---
    NOTICE: Order ID lookup returned no results.
    The second question: originally I had an address of mydomain.com/ppr_webhook.php but I noticed in the last update that it was removed. Should I remove this configured address from the PayPal developers section for the webhook address?

  4. #314
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,903
    Plugin Contributions
    96

    Default Re: Refunds not being recognized? + 1 Additional Question

    I'm having 'difficulties' moving this post to the payment module's support-thread: https://www.zen-cart.com/showthread....Payment-Module

    If you could re-post there,
    I'll be happy to investigate issue #1.

    For the 2nd question, it's still /ppr_webhook.php. That script is copied to the root when the payment module is installed. And is registered to PayPal webhooks automatically.
    Last edited by DrByte; 14 Sep 2025 at 07:28 PM. Reason: moved

  5. #315
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Refunds not being recognized? + 1 Additional Question

    Quote Originally Posted by retched View Post
    PHP 8.4 / ZC 2.1.0 / PayPal RESTFUL 1.2

    Testing the module out and everything works as far as recognizing paying events (CREATE, CAPTURED, COMPLETED). However, triggering an refund from the PayPal side of things has the order not recognize that it was refunded.

    That is to say: if I charge an order, then try to refund that order, the PayPal refund doesn't reach the ZC Database. I can see a log is generated (attached below, it's from the sandbox) but then at the end of it, the module notes that it cannot find the order and just drops out.

    Is this something to be concerned with?

    Code:
    2025-09-14 09:54:36: (ppr_webhook) ppr_webhook (PAYMENT.CAPTURE.REFUNDED, PayPal/AUHD-1.0-1, POST) starts.{
        "id": "WH-74T39592TU773570G-4UR976727P454984C",
        "event_version": "1.0",
        "create_time": "2025-09-14T13:54:28.338Z",
        "resource_type": "refund",
        "resource_version": "2.0",
        "event_type": "PAYMENT.CAPTURE.REFUNDED",
        "summary": "A $ 0.01 USD capture payment was refunded",
        "resource": {
            "seller_payable_breakdown": {
                "total_refunded_amount": {
                    "value": "0.01",
                    "currency_code": "USD"
                },
                "paypal_fee": {
                    "value": "0.00",
                    "currency_code": "USD"
                },
                "gross_amount": {
                    "value": "0.01",
                    "currency_code": "USD"
                },
                "net_amount": {
                    "value": "0.01",
                    "currency_code": "USD"
                }
            },
            "amount": {
                "value": "0.01",
                "currency_code": "USD"
            },
            "update_time": "2025-09-14T06:54:24-07:00",
            "create_time": "2025-09-14T06:54:24-07:00",
            "invoice_id": "PPR-20250914095258-1-PauWil-c05c82fc",
            "links": [
                {
                    "method": "GET",
                    "rel": "self",
                    "href": "https:\/\/api.sandbox.paypal.com\/v2\/payments\/refunds\/27L28035LL8140251"
                },
                {
                    "method": "GET",
                    "rel": "up",
                    "href": "https:\/\/api.sandbox.paypal.com\/v2\/payments\/captures\/50A226912H175722S"
                }
            ],
            "id": "27L28035LL8140251",
            "payer": {
                "email_address": "[email protected]",
                "merchant_id": "K5V8XYA7Z66VL"
            },
            "status": "COMPLETED"
        }
    }
    ************************************************
    
    
    webhook verification passed
    ************************************************
    
    
    webhook event supported by PayPalRestful\Webhooks\Events\PaymentCaptureRefunded
    PAYMENT.CAPTURE.REFUNDED - action() triggered
    ************************************************
    
    
    2025-09-14 09:54:37: (ppr_webhook) validateCredentials: Checking (1).
    TokenCache::clear, clearing cached token.
    The curlPost (v1/oauth2/token) request was successful (200).
    {
        "token_type": "Bearer",
        "expires_in": 31492
    }
    TokenCache::save, saving access-token; valid for 31492 seconds.
    
    
    ************************************************
    
    
    
    
    ---
    NOTICE: Order ID lookup returned no results.
    The second question: originally I had an address of mydomain.com/ppr_webhook.php but I noticed in the last update that it was removed. Should I remove this configured address from the PayPal developers section for the webhook address?
    I wonder if this is simply a mismatch between orders in your database vs sandbox.
    The Order ID lookup for webhook handling would use the webhook payload of "id": "27L28035LL8140251" to search your store's paypal history table for an order with that transaction id.

    The log you posted is only related to the webhook.

    Did I correctly understand from your post that there doesn't seem to be a refund reflected in the order history itself? Or is it only missing when looking at paypal-specific details?


    Also, while the module automatically registers the ppr_webhook.php as the webhook handler, it will do it separately for sandbox and for production, and doesn't de-register when you change modes. It's currently only de-registering when you uninstall the module. (It shouldn't matter that a sandbox webhook is registered, since once in production you'll almost never use the sandbox webhook anyway. So it's moot.)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #316
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    934
    Plugin Contributions
    9

    Default Re: Refunds not being recognized? + 1 Additional Question

    Quote Originally Posted by lat9 View Post
    I'm having 'difficulties' moving this post to the payment module's support-thread: https://www.zen-cart.com/showthread....Payment-Module

    If you could re-post there,
    I'll be happy to investigate issue #1.

    For the 2nd question, it's still /ppr_webhook.php. That script is copied to the root when the payment module is installed. And is registered to PayPal webhooks automatically.
    Wait, so the file is copied to the root automatically on install? Should I reinstall the module if my root is missing this file?

  7. #317
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,903
    Plugin Contributions
    96

    Default Re: Refunds not being recognized? + 1 Additional Question

    Quote Originally Posted by retched View Post
    Wait, so the file is copied to the root automatically on install? Should I reinstall the module if my root is missing this file?
    If you're running v1.2.0, there was an issue with the auto-update. Update to v1.2.1 to correct the issue.

  8. #318
    Join Date
    Apr 2009
    Posts
    121
    Plugin Contributions
    0

    Default Re: Refunds not being recognized? + 1 Additional Question

    ZC 1.5.8a / php 7.4.33

    Running fine with v1.1.0, but error in 1.2.1:

    Code:
    [20-Sep-2025 02:00:06 Canada/Pacific] PHP Parse error:  syntax error, unexpected ')', expecting variable (T_VARIABLE) in /zc/includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php on line 367
    
    [20-Sep-2025 02:00:06 Canada/Pacific] Request URI: /index.php?main_page=checkout_shipping, IP address: x.x.x.x
    --> PHP Parse error: syntax error, unexpected ')', expecting variable (T_VARIABLE) in /zc/includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php on line 367.

  9. #319
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,903
    Plugin Contributions
    96

    Default Re: Refunds not being recognized? + 1 Additional Question

    Quote Originally Posted by siliconbug View Post
    ZC 1.5.8a / php 7.4.33

    Running fine with v1.1.0, but error in 1.2.1:

    Code:
    [20-Sep-2025 02:00:06 Canada/Pacific] PHP Parse error:  syntax error, unexpected ')', expecting variable (T_VARIABLE) in /zc/includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php on line 367
    
    [20-Sep-2025 02:00:06 Canada/Pacific] Request URI: /index.php?main_page=checkout_shipping, IP address: x.x.x.x
    --> PHP Parse error: syntax error, unexpected ')', expecting variable (T_VARIABLE) in /zc/includes/modules/payment/paypal/PayPalRestful/Api/PayPalRestfulApi.php on line 367.
    Hmm, I'm not seeing that with PHP 7.4.30 (don't currently have access to 7.4.33). Here are lines 361 to 367 of the PayPalRestfulApi.php module:
    PHP Code:
        public function updatePackageTracking(
            
    string $paypal_txnid,
            
    string $tracking_number,
            
    string $carrier_code,
            
    string $action 'ADD',
            
    bool $email_buyer false,
        ): 
    false|array { 
    If you remove the comma (,) after bool $email_buyer = false, does that correct the issue?

  10. #320
    Join Date
    Apr 2009
    Posts
    121
    Plugin Contributions
    0

    Default Re: Refunds not being recognized? + 1 Additional Question

    New error log after removing the comma (,) :
    Code:
    [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.

 

 
Page 32 of 45 FirstFirst ... 22303132333442 ... LastLast

Similar Threads

  1. v158 UPS Shipping using RESTful/OAuth API [Support Thread]
    By lat9 in forum Addon Shipping Modules
    Replies: 187
    Last Post: 20 Apr 2026, 09:15 PM
  2. IPower & FirstData API Payment Module
    By spence in forum Addon Payment Modules
    Replies: 6
    Last Post: 7 Jul 2011, 06:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg