btcpayserver / woocommerce-plugin

Plugin for connecting Woocommerce with BTCPayServer
https://btcpayserver.org/
Other
51 stars 41 forks source link

Need help with custom order numbers #45

Open maxdamage101 opened 4 years ago

maxdamage101 commented 4 years ago

Hello, First of all, I've installed a docker installation, it's working perfectly with woocommerce. Until I activate the custom order numbers plugin. I've created a support ticket on their side to- https://wordpress.org/support/topic/need-help-letting-my-payment-plugin-find-custom-order_id/#post-12644818

I'm using a custom order numbers plugin, and I'm trying to get the IPN messages to work with my custom order numbers. I've tried messing with the filter(Below) alot, but I can't seem to be able to get it to work. It's only giving me "500" errors.

`function get_order_id_from_custom_order_style($orderid){ if(is_string($orderid)){ $result = preg_replace('~\D~', '', $orderid); return $result; } return $orderid; }

add_filter('woocommerce_order_id_from_number', 'get_order_id_from_custom_order_style', 1);`

Now the thing is, when I have the custom order numbers plugin activated. It finds the custom numbers and puts it in the invoice generated on the invoice menu. (plugin enabled)

Order Id | 3057723049   | Error while sending IPN (1001 invoice_created): Unexpected return code: 500

Now my qeustion is, how do I find the customerID before I activated the plugin? Because when I disable this plugin I get this information in the invoice menu and everything works fine. (plugin disabled)

Order Id | 1703 IPN (1005 invoice_confirmed) sent for invoice 2xdB8RwnMkZPtS83vYNEXW

If I could get assistance with this, I could really appreciate it.

dennisreimann commented 3 years ago

Can you check whether or not this helps? https://github.com/btcpayserver/woocommerce-plugin/issues/40#issuecomment-578751075

dennisreimann commented 3 years ago

I've researched this a bit and maybe these notes help to proceed further.

Generate invoice

Invoice callbacks

Proposal