WooCommerce Payment Entry Capture

The WooCommerce integration was not working correctly for a while and seems now fixed in the develop branch - many thanks to @rucha_mahabal (#19487). I would like to request that like the Shopify integration, WooCommerce also capture the payment received data and create a payment entry linked to the new sales order created.

The WooCommerce Order.created webhoook payload already delivers this information to ERPNext - see below example from actual transaction, showing the test mode payment authorization information from Razorpay (paid directly in woocommerce). ERPNext successfully creates the sales order, new customer, new item (woocommerce group), item price, and assigns a sales order based on the series specified (in our case SO-WEB-…)

I am not a developer, but I am assuming that if we can create a sales order from this data, then we can also parse for the included payment information into a new payment entry linked to the sales order created. Do not know what effort is involved but would like to see if other in the community would like to see this feature. There are posts requesting full two-way integration - but I think that may be a much larger undertaking. We should at least be able to match the Shopify features.

Appreciate your thoughts and comments on this.

PS: There remains a mismatch even after the fix. ERPNext does not recognize the State (MH in the webhook data below) as Maharashtra and so Out of State GST tax template / rule is applied instead of In-State.

Webhook Payload Data:

[Body] => {\"id\":683,\"parent_id\":0,\"number\":\"683\",\"order_key\":\"wc_order_tG1LKT1HqagJt\",\"created_via\":\"checkout\",\"version\":\"3.8.0\",\"status\":\"pending\",\"currency\":\"INR\",\"date_created\":\"2019-11-19T09:19:00\",\"date_created_gmt\":\"2019-11-19T03:49:00\",\"date_modified\":\"2019-11-19T09:19:00\",\"date_modified_gmt\":\"2019-11-19T03:49:00\",\"discount_total\":\"0.00\",\"discount_tax\":\"0.00\",\"shipping_total\":\"0.00\",\"shipping_tax\":\"0.00\",\"cart_tax\":\"65.89\",\"total\":\"615.00\",\"total_tax\":\"65.89\",\"prices_include_tax\":true,\"customer_id\":8,\"customer_ip_address\":\"174.100.163.201\",\"customer_user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/78.0.3904.97 Safari\\/537.36\",\"customer_note\":\"\",\"billing\":{\"first_name\":\"Test\",\"last_name\":\"Customer\",\"company\":\"\",\"address_1\":\"X XXXXXXX\",\"address_2\":\"XXXXXXXXX Marg\",\"city\":\"Mumbai\",\"state\":\"MH\",\"postcode\":\"400091\",\"country\":\"IN\",\"email\":\"XXXXXX@XXXX.com\",\"phone\":\"123456789\"},\"shipping\":{\"first_name\":\"Test\",\"last_name\":\"Customer\",\"company\":\"\",\"address_1\":\"X XXXXXXX\",\"address_2\":\"XXXXXXXXX Marg\",\"city\":\"Mumbai\",\"state\":\"MH\",\"postcode\":\"400091\",\"country\":\"IN\"},\"payment_method\":\"razorpay\",\"payment_method_title\":\"Credit Card\\/Debit Card\\/NetBanking\",\"transaction_id\":\"pay_DhzarsB7ZeIxrX",\"date_paid\"2019-11-19T05:37:45\"date_paid_gmt\"2019-11-19T00:07:45\"date_completed\":null,\"date_completed_gmt\":null,\"cart_hash\":\"3abb278683de356875f277e10b442cb9\",\"meta_data\":[{\"id\":3400,\"key\":\"is_vat_exempt\",\"value\":\"no\"}],\"line_items\":[{\"id\":63,\"name\":\"XXXXXXX X-LARGE 12 CT\",\"product_id\":384,\"variation_id\":0,\"quantity\":1,\"tax_class\":\"\",\"subtotal\":\"549.11\",\"subtotal_tax\":\"65.89\",\"total\":\"549.11\",\"total_tax\":\"65.89\",\"taxes\":[{\"id\":1,\"total\":\"32.946429\",\"subtotal\":\"32.946429\"},{\"id\":2,\"total\":\"32.946429\",\"subtotal\":\"32.946429\"}],\"meta_data\":[],\"sku\":\"DX12\",\"price\":549.107143}],\"tax_lines\":[{\"id\":65,\"rate_code\":\"IN-MH-SGST-1\",\"rate_id\":1,\"label\":\"SGST\",\"compound\":false,\"tax_total\":\"32.95\",\"shipping_tax_total\":\"0.00\",\"rate_percent\":6,\"meta_data\":[]},{\"id\":66,\"rate_code\":\"IN-MH-CGST-2\",\"rate_id\":2,\"label\":\"CGST\",\"compound\":false,\"tax_total\":\"32.95\",\"shipping_tax_total\":\"0.00\",\"rate_percent\":6,\"meta_data\":[]}],\"shipping_lines\":[{\"id\":64,\"method_title\":\"Free shipping\",\"method_id\":\"free_shipping\",\"instance_id\":\"2\",\"total\":\"0.00\",\"total_tax\":\"0.00\",\"taxes\":[],\"meta_data\":[{\"id\":441,\"key\":\"Items\",\"value\":\"XXXX X-LARGE 12 CT × 1\"}]}],\"fee_lines\":[],\"coupon_lines\":[],\"refunds\":[],\"_links\":{\"self\":[{\"href\":\"https:\\/\\/shop.DOMAIN.com\\/in\\/wp-json\\/wc\\/v3\\/orders\\/683\"}],\"collection\":[{\"href\":\"https:\\/\\/shop.DOMAIN.com\\/in\\/wp-json\\/wc\\/v3\\/orders\"}],\"customer\":[{\"href\":\"https:\\/\\/shop.DOMAIN.com\\/in\\/wp-json\\/wc\\/v3\\/customers\\/8\"}]}}

if that is so … I believe this (a bug fix) should have been merged into the stable branch (version-11, version-12) it was not working with.
Merging it to the develop branch (which eventually will become version-13) does not help any current user.

Or am I seeing something wrong here?

@rucha_mahabal is there any specific reason you pointed the PR towards develop (if the above assumption of mine “bug fix” is correct and it’s not a feature)?