Overview
This article explains the cause and resolution for the paypalwebhook.doPost error that may appear in the Error Logs within Payments2Us.
The error commonly appears as:
Program Area: paypalwebhook.doPost
Subject: Payment Form webhook
Description: webhook secret key missing
This means Payments2Us received a webhook event from PayPal, but the Payment Form record linked to that webhook does not have a Webhook Secret Key value populated.
What the Error Means
When PayPal sends a webhook notification (for example, PAYMENT.SALE.COMPLETED), Payments2Us matches that webhook to the correct Payment Form using the Webhook Secret Key.
If the Webhook Secret Key field is blank or mismatched, Payments2Us cannot validate the webhook and logs an error such as:
This usually occurs when:
- A new PayPal webhook was created but the setup was not completed, or
- The existing Payment Form is linked to an incorrect or duplicate webhook in PayPal.
Common Scenario
A common reason for this error is that a new PayPal webhook setup was started but not fully completed.
For example:
A new webhook was created for a Payment Form, but the setup was stopped midway — before the Webhook Secret Key was populated in Salesforce.
Later, when PayPal sends webhook events to that incomplete webhook, Payments2Us cannot match or validate the event, and the error appears in the log.
Resolution Steps
-
Identify the Payment Form
- Check the error log to find the Payment Form ID (e.g.
a0xXXXXXXXXXXX). - Open the corresponding Payment Form record in Salesforce.
- Check the error log to find the Payment Form ID (e.g.
-
Check the Webhook Secret Key Field
- If the field Webhook Secret Key is blank, the webhook setup is incomplete.
-
Delete the Incorrect or Incomplete Webhook from PayPal
- Log in to your PayPal Developer Dashboard.
- Go to My Apps & Credentials → Webhooks.
- Locate the webhook URL associated with this Payment Form.
- Carefully delete the incomplete or duplicate webhook.
- ⚠️ Be cautious to remove the correct webhook only — deleting an active one may affect live transactions.
-
Recreate the Webhook (if needed)
- Follow the guide How to Setup PayPal Modern to create a new webhook correctly.
- After successful setup, the Webhook Secret Key field should be automatically populated in the Payment Form record.
-
Verify
- After setup is complete, monitor the Error Logs for at least one business day to confirm the issue is resolved.
Prevention Tips
- Always complete the entire PayPal webhook setup process before testing transactions.
- Ensure that only one active PayPal webhook exists per live environment.
- Do not manually modify the Webhook Secret Key field in Salesforce — it is automatically generated.
- Keep a record of active webhook URLs and their corresponding Payment Form IDs for troubleshooting purposes.
Summary
The error paypalwebhook.doPost – webhook secret key missing occurs when PayPal sends a webhook that cannot be matched to a valid Payment Form due to a missing or incomplete Webhook Secret Key.
To resolve:
Delete any incomplete or duplicate webhooks in PayPal, and then recreate the correct webhook following the PayPal Modern Setup Guide.
Once correctly configured, webhook events will process successfully and the error will no longer appear.