I am trying to:
Set the publish status after payment of submission
I expected to see:
Published Status
Instead, I got:
Draft Status
Hi, after processing payment (Stripe TEST API Enabled), the status of the post remains as draft after payment has processed.
If I were to change the status in the top area to publish, it gets published after submission and before payment gets processed, therefor, posting a 'free' post.
My settings are in the screen shots attached.
The same form we were working on the previous support ticket. Thank you so much Minesh.
Hi, there is currently a known issue with the Forms (CRED) Commerce API not firing specific events when the Order is completed. Please read the erratum post here and apply the patch as described: https://toolset.com/errata/api-action-after-the-payment-gets-completed-is-not-fired/
Then retest the payment complete process. If the status is still not updated as expected, please temporarily enable an offline payment method like "Check payment" or "Cash on delivery" and complete an Order manually in wp-admin. Is the related Forms Commerce post status updated correctly when using a different payment method?
Let me know the results and we can go from there.
Hi Cristian, I updated the file, cleared cache, etc etc. The problem still persists. I tried a offline method as suggested (check) and that does seem to work.
It looks like it doesn't work with Stripe in test mode.
Thank you.
Okay so it sounds like the notification is triggered when you complete an Order manually. Is the Order automatically marked as "Complete" after payment is processed by Stripe?
If your answer is No: This is the expected behavior, because Form notifications are triggered when the Order is marked "Complete". Check the documentation here for some more information about this: https://toolset.com/documentation/user-guides/charging-payments-with-cred-to-register-users/#marking-the-order-as-complete
If your answer is Yes: Let me know and I can take a closer look. I will need some time to research using Stripe's Test API.
Thank you for the reply. Yes, that was the issue. I checked out the plugin but, I dont want to install another plugin for a simple solution and it seems outdated. As a solution, as per Woocommerce Documentation, I used:
/**
* Auto Complete all WooCommerce orders.
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
$order->update_status( 'completed' );
}
Thanks again.