retched:
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?
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.