Issue with Form Submission Processing and Payment Failure

Dear Gravity Forms Support Team,

I hope you are doing well. I am reaching out to you regarding an issue I have encountered with form submissions and payments in Gravity Forms. Despite the payment being declined, the form submission is still being processed as valid.

Here is the situation:

  1. Form Submission Details: The form submission seems to be processed correctly at first, and all validation steps are completed without any issues. However, once the payment process takes place, even though the payment is declined by PayPal (based on the webhook “PAYMENT.CAPTURE.DECLINED”), the form submission is still recorded as if it were successful.
  2. Payment Logs: The payment method being used is PayPal Checkout. I’ve noticed that, although the form proceeds to submission, the transaction fails and PayPal sends a webhook indicating that the payment was declined. Here is a portion of the debug log for your reference:
2024-09-21 18:06:37.821835 - DEBUG --> GF_PPCP::log_webhook_event_details() Webhook log => Array
(
    [id] => WH-6BH94594WU782263M-7H026661YV730435X
    [type] => PAYMENT.CAPTURE.DECLINED
    [event_version] => 1.0
    [resource_version] => 2.0
)
2024-09-21 18:06:37.832098 - DEBUG --> GFPaymentAddOn::maybe_process_callback(): Result from gateway callback => Array
(
    [id] => WH-6BH94594WU782263M-7H026661YV730435X
    [entry_id] => 8598
    [transaction_id] => 7CL38806TA1686256
    [type] => fail_payment
    [amount] => 9.00
)
  1. Unexpected Behavior: The form submission still goes through and is saved in the database as successful, despite the payment being declined. This creates confusion because the entry shows up as valid, and notifications are sent for the form submission, although the payment was unsuccessful.
  2. What I Have Tried: I have checked the feed settings, webhook configuration, and payment capture logic, but I haven’t found a way to prevent the form from being submitted when the payment is declined. I would appreciate any guidance or suggestions on how to resolve this issue and ensure that the form submission is only processed once the payment is successfully captured.

Please let me know if there are any further details or logs you require to investigate this matter.

Thank you for your support, and I look forward to your assistance.

I’ve already reached out to support via email, but I handle a large volume of orders on Mondays and Tuesdays. Therefore, I would greatly appreciate it if the issue could be resolved before Monday, which is why I am posting my message here as well.

Problem solved by the support by mail :heart:

Explication:

The problem occurs because the PayPal Checkout API does not always immediately inform whether a payment was declined. For some transactions, it may take a few minutes or even hours to receive this confirmation. Since the Gravity Forms PayPal add-on cannot wait for the decline message before completing the form submission, it proceeds with saving the entry as long as all the other form fields are validated correctly and PayPal has indicated that the order was successfully created. The entry is saved with a “pending payment” status, and once PayPal sends a webhook with the updated transaction status (such as declined or completed), the entry’s status is updated.

The notifications are being sent prematurely because the form’s notification settings are configured to trigger upon form submission, rather than upon successful payment. To fix this, you need to adjust the “event” setting in the form’s notification settings. You can configure it to trigger upon payment completion, which is one of the events added by the payment add-on. This change can be made by going to the Form Settings > Notifications section and selecting the correct event for each notification.

By following these steps, notifications will only be sent once a payment is successfully completed, avoiding confusion caused by prematurely sent emails.

1 Like