Add do_action before displaying the confirmation page #7108
Replies: 4 comments 13 replies
-
Hey @Genevieve-K, great suggestions. I'll need to determine the best place for the do_action to go. The lifecycle of a donation is a little tricky because gateways are the deciding factor and we rely on them to essentially complete the form how they see fit. Sometimes they will tell the framework the payment is complete, other times they will use webhooks to complete the payment, or handle redirecting themselves on the front-end. To truly know when a donation is complete would be to listen for its status to change through To know when a form is complete, I think you are on the right track recommending the confirmation page. Honestly, I think having an action right before the actual URL request to the confirmation page might be the most reliable way to determine when a form is completed. In your situation you would probably need to check the confirmation page |
Beta Was this translation helpful? Give feedback.
-
Maybe I can continue to use the |
Beta Was this translation helpful? Give feedback.
-
@Genevieve-K I have temporary solutions for you to try below. If any of these work we can look into adding some actions to make things easier.
|
Beta Was this translation helpful? Give feedback.
-
I was finally able to test it. My gift is still in the cart. I don't think that subscription status changes until PayPal responds via the webhook. |
Beta Was this translation helpful? Give feedback.
-
Could you add a
do_action()
when a payment is done and the confirmation page displayed ?I developed a cart and I want to delete the gifts in the cart when the payment is done. The donation status can be pending for an offline donation or complete. Testing the status is therefore not sufficient.
I use until now the filter to
'give_get_success_page_uri'
but for Stripe, if there are errors with the payment, thegive_get_success_page_uri()
function is called before creating the payment intent. And this filter is applied even if there is a failure.I tested to use a filter to
'give_success_page_redirect
', but this work only for legacy gateways. For Stripe, the redirect is in__invoke()
, in the HandleGatewayPaymentCommand class.If all gateways use this function, could you add a
do_action()
in this function for example? It's rather urgent.Thank you by advance.
Beta Was this translation helpful? Give feedback.
All reactions