Sofort does not send data to xentral
-
Hi. Thank you for a very cool plugin!
We noticed that some of the payments are not displayed in CRM Xentral. We decided to find out what was wrong with the payments and it turned out that all of them were made through Sofort.
Our assumption is that when you make a payment via Sofort, the confirmation data comes only after a day, so nothing comes to CRM.
Is it possible to make it so that when a payment is made, the data is transmitted immediately, not after 24 hours?
-
Hi @vox-terman
Glad you like the plugin. I am guessing that your Xentral CRM plugin is using the
woocommerce_payment_complete
action triggered by WooCommerce when the payment is completed to upload data.Because Sofort is an asynchronous payment method, it can take a day or so before Stripe triggers the
payment_intent.succeeded
webhook. The Stripe plugin uses that webhook to complete the payment on the WooCommerce Order, and at that time thewoocommerce_payment_complete
event is triggered by WooCommerce.I don’t recommend you attempt to programmatically complete the payment before it has actually succeeded. You could attempt to upload the data to your CRM using the on-hold status action for the WC_Order. Or the Stripe action
wc_stripe_order_payment_complete
which is triggered for all payments immediately.Kind Regards
That’s great! Thanks for the quick response!
Could you please tell me how to execute on-hold status for WC_Order via Sofort? I need to write it in functions.php.
And how can I execute wc_stripe_order_payment_complete for all payments immediately?
Hi @vox-terman
Here is the link to the wc_stripe_order_payment_complete filter. I don’t know how your Xentral CRM plugin is coded but I assume that’s a premium plugin so you can contact their developers and ask them how to use our filter to upload the data to the CRM.
Kind Regards,
Yes, thanks, I’ll contact them!
Can you please tell me how at the time of payment through Sofort I can send wc_stripe_order_payment_complete instead of payment_intent.succeeded?
Can you please tell me how at the time of payment through Sofort I can send wc_stripe_order_payment_complete instead of payment_intent.succeeded?
The best thing to do is contact the developers of your premium CRM plugin and ask them how you can send payment data to the CRM immediately, rather than waiting on the
woocommerce_payment_complete
which is triggered by WooCommerce when the order is completed.They know their plugin the best and they can provide you with the best answer on how to do that.
Kind Regards
Thanks for the reply!
I was able to communicate with Xentral and this is what I found out. They take orders in “processing” status into their system. Sofort doesn’t create this status and goes straight to “picking” status, so Xentral can’t pick them up.
Is it possible to build in an intermediate “processing” status for Sofort? Or create an additional status before “picking”?
Hello! Maybe you have some ideas how to embed an intermediate status?
Hi @vox-terman
Sofort doesn’t create this status and goes straight to “picking” status, so Xentral can’t pick them up.
Do you know what plugin is assigning the picking status? Our plugin by default sets Sofort orders to an on-hold status. Here is the section of code that controls that: https://plugins.trac.wordpress.org/browser/woo-stripe-payment/trunk/includes/abstract/abstract-wc-stripe-payment.php#L107
You can use filter
wc_stripe_pending_charge_status
to customize the status from on-hold to processing. But, it sounds like you have something overriding the status because on-hold should be the status assigned to Sofort orders. So where is the picking status coming from?Kind Regards
Hi. Thank you for your reply!
It is, the “picking” status is made using the “Custom Order Status for WooCommerce” plugin.
In Xentral, the statuses are taken as shown in the screenshot: https://tinyurl.com/yu9rl95m
Xentral picks up all orders in “processing” status and returns them back in “picking” status. But Sofort does not have a “proccesing” status. I tried to create this status using the code: https://github.com/woocommerce/woocommerce-gateway-stripe/issues/547#issuecomment-496169815 and nothing has worked so far.
- This reply was modified 1 year, 3 months ago by Vox Terman.
But Sofort does not have a “proccesing” status.
Yes, Sofort does have the processing status once the payment is processed by Stripe. Sofort is an asynchronous payment method, meaning it can take 2 – 14 days for the payment to be completed.
Once the
payment_intent.succeeded
webhook event is triggered by Stripe, the Stripe plugin calls theWC_Order::payment_complete
method which updates the order’s status toprocessing
.You should be able to force the order to a processing status with the following code:
Example:
add_action('wc_stripe_order_payment_complete', function($charge, $order){ if($order->get_payment_method() === 'stripe_sofort') { $order->payment_complete(); } }, 10, 2);
- This reply was modified 1 year, 3 months ago by Payment Plugins.
Wow, thank you!
I’ll give it a try!
Can this be deleted?
https://github.com/woocommerce/woocommerce-gateway-stripe/issues/547#issuecomment-496169815
Can this be deleted?
Yes, you don’t need that code if you use our example.
Thanks a lot, I’ll write as soon as I manage to check (first Sofort payment arrives)!
Thank you very much! The solution works!
- The topic ‘Sofort does not send data to xentral’ is closed to new replies.