[Skip to main content](#vessel-content)

#   Vendor sub-order does NOT get invoice number when using Mangopay

##

- **[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")**
- [![sabroso's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38789-sabroso "View sabroso's Profile") Topic Author
- [ Offline](/forum/user/38789-sabroso)

Less More

- Posts: 128
- Thank you received: 2
-
-

10 years 1 month ago [\#253172](#253172) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253172 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")* was created by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")*

-- HikaShop version -- : 2.6.4
-- HikaMarket version -- : 1.7.2
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6

FYI: Mangopay Payment Plugin 1.7.3

Hi there,

In the Hikashop config I have:
- Payment confirmed order status: confirmed

I have setup 3 Payment Methods:
- Bank Transfer
- Stripe
- Mangopay

After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.

This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.

I have checked php error logs as follows:

When Bank Transfer is used -&gt; no errors

When Stripe is used Code:

[21-Oct-2016 06:19:08 America/New_York] PHP Notice: Undefined property: stdClass::$order_payment_tax in /home/XXXX/public_html/media/com_hikamarket/mail/order_status_notification.preload.php on line 55 [21-Oct-2016 06:19:09 America/New_York] PHP Notice: Undefined property: stdClass::$order_payment_tax in /home/XXXX/public_html/media/com_hikamarket/mail/order_status_notification.preload.php on line 55 [21-Oct-2016 06:19:09 America/New_York] PHP Notice: Undefined property: stdClass::$order_payment_tax in /home/XXXX/public_html/media/com_hikamarket/mail/order_status_notification.preload.php on line 55

When Mangopay is used Code:

[21-Oct-2016 06:22:45 America/New_York] PHP Notice: Undefined property: stdClass::$order_payment_tax in /home/XXXX/public_html/media/com_hikamarket/mail/order_status_notification.preload.php on line 55 [21-Oct-2016 06:22:45 America/New_York] PHP Notice: Undefined property: stdClass::$order_payment_tax in /home/XXXX/public_html/media/com_hikamarket/mail/order_status_notification.preload.php on line 55 [21-Oct-2016 06:22:45 America/New_York] PHP Notice: Undefined property: stdClass::$order_payment_tax in /home/XXXX/public_html/media/com_hikamarket/mail/order_status_notification.preload.php on line 55

It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.

Please help, thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 1 month ago [\#253191](#253191) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253191 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi,

I do not reproduce your issue but I think I know what could be the cause.

HikaMarket refuse the modification of a sub-order when that sub-order is "paid".
Because MangoPay is an adaptive plugin, it mark itself the sub-order as paid.

But, in HikaMarket 1.7.1 we introduced some modifications to allow the modification of the sub-order if it does not affect the "order_vendor_price" Code:

if(!empty($order-&gt;old-&gt;order_vendor_paid) &amp;&amp; $order-&gt;old-&gt;order_vendor_paid &gt; 0 &amp;&amp; (!isset($order-&gt;hikamarket-&gt;internal_process) &#124;&#124; $order-&gt;hikamarket-&gt;internal_process === false) ) { if(isset($order-&gt;order_vendor_price) &amp;&amp; $order-&gt;order_vendor_price !== $order-&gt;old-&gt;order_vendor_price) { $do = false; return; } }

Because you have HikaMarket 1.7.2 ; you should have that code in your HikaMarket order class and the modification of the sub-sale should be authorized because the sub-orders are not updated with a modification of the order vendor price.
Now, in order to be sure, you can just add two lines of codes just before the " $do = false;" Code:

$app = JFactory::getApplication(); $app-&gt;enqueueMessage('Subsale '.(int)$order-&gt;order_id.' is being modified [' . $order-&gt;order_vendor_price . ' / ' . $order-&gt;old-&gt;order_vendor_price . ']');

So, if the sub sale update is blocked, you will see a warning message with some details.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")**
- [![sabroso's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38789-sabroso "View sabroso's Profile") Topic Author
- [ Offline](/forum/user/38789-sabroso)

Less More

- Posts: 128
- Thank you received: 2
-
-

10 years 1 month ago -  10 years 1 month ago [\#253241](#253241) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253241 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi, thanks for that.

Unfortunately the execution does not get into neither of the "if's" on the piece of code that you suggested. I had to take those two lines of code outside of the if's to see some message, as follows:
Code:

$app = JFactory::getApplication(); $app-&gt;enqueueMessage('Subsale '.(int)$order-&gt;order_id.' is being modified [' . $order-&gt;order_vendor_price . ' / ' . $order-&gt;old-&gt;order_vendor_price . ']'); if(!empty($order-&gt;old-&gt;order_vendor_paid) &amp;&amp; $order-&gt;old-&gt;order_vendor_paid &gt; 0 &amp;&amp; (!isset($order-&gt;hikamarket-&gt;internal_process) &#124;&#124; $order-&gt;hikamarket-&gt;internal_process === false) ) { if(isset($order-&gt;order_vendor_price) &amp;&amp; $order-&gt;order_vendor_price !== $order-&gt;old-&gt;order_vendor_price) { $do = false; return; } }

In this case the Message I see is as follows:
Code:

Message Subsale 0 is being modified [30 / ] Subsale 73 is being modified [ / 30.00000] Thank you for your purchase.

It looks like the function is being executed twice. The testing order was a 30 euros order where there were no fees, so all the money goes to the vendor.

Thoughts? thanks!

Last edit: 10 years 1 month ago by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 1 month ago [\#253249](#253249) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253249 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi,

You place the display of the message before the first "if" ; so you have the message when a sub sale is modified ; but it does not mean that the update of the sub sale will be refused.
And regarding the messages, there "vendor price" and the "old vendor price" are never the same, so the sub sale is update each time.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")**
- [![sabroso's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38789-sabroso "View sabroso's Profile") Topic Author
- [ Offline](/forum/user/38789-sabroso)

Less More

- Posts: 128
- Thank you received: 2
-
-

10 years 4 weeks ago [\#253284](#253284) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253284 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi,

I had tried putting the display of the messages inside the "if's" but I didn't get any message.

I tried this: Code:

if(!empty($order-&gt;old-&gt;order_vendor_paid) &amp;&amp; $order-&gt;old-&gt;order_vendor_paid &gt; 0 &amp;&amp; (!isset($order-&gt;hikamarket-&gt;internal_process) &#124;&#124; $order-&gt;hikamarket-&gt;internal_process === false) ) { if(isset($order-&gt;order_vendor_price) &amp;&amp; $order-&gt;order_vendor_price !== $order-&gt;old-&gt;order_vendor_price) { $app = JFactory::getApplication(); $app-&gt;enqueueMessage('Subsale '.(int)$order-&gt;order_id.' is being modified [' . $order-&gt;order_vendor_price . ' / ' . $order-&gt;old-&gt;order_vendor_price . ']'); $do = false; return; } }

But didn't get any message.

I also tried this Code:

if(!empty($order-&gt;old-&gt;order_vendor_paid) &amp;&amp; $order-&gt;old-&gt;order_vendor_paid &gt; 0 &amp;&amp; (!isset($order-&gt;hikamarket-&gt;internal_process) &#124;&#124; $order-&gt;hikamarket-&gt;internal_process === false) ) { $app = JFactory::getApplication(); $app-&gt;enqueueMessage('Subsale '.(int)$order-&gt;order_id.' is being modified [' . $order-&gt;order_vendor_price . ' / ' . $order-&gt;old-&gt;order_vendor_price . ']'); if(isset($order-&gt;order_vendor_price) &amp;&amp; $order-&gt;order_vendor_price !== $order-&gt;old-&gt;order_vendor_price) { $do = false; return; } }

And didn't get any message.

From what you say I understand the updating of the suborder is not being rejected, right?

So that's fine, but the suborder it is NOT getting an invoice number when confirmed via the Mangopay plugin.

What else could be going wrong?

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 4 weeks ago [\#253288](#253288) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253288 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi,

That's right, HikaMarket is not blocking the update of the sub orders.
You are using the latest version of the Mangopay plugin (1.7.3) and that is also the plugin I am using in my local website but I can't reproduce your issue in that website.

Regarding your PHP log, you have warnings in the email notification (which would be fix in the next release).
You have the order notifications emails for both MangoPay and Stripe plugins ; which mean that the vendors are notified for the update of their orders.
MangoPay do not touch the sub sales ; it just modify the main order to make it "confirmed", like any other plugins.
So there is no code or nothing suspicious in that plugin which could explain the problem you have ; I have read several time the code of that plugin and I can't explain your issue.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")**
- [![sabroso's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38789-sabroso "View sabroso's Profile") Topic Author
- [ Offline](/forum/user/38789-sabroso)

Less More

- Posts: 128
- Thank you received: 2
-
-

10 years 4 weeks ago [\#253363](#253363) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253363 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi,

I think the problem could be in Hikamarket, in the order class.

I did the following troublshooting.

In administrator/components/com_hikamarket/classes/order.php, in the function generateOrderInvoiceNumber I added the following code:
Code:

$app = JFactory::getApplication(); $force == true ? $fuerza = 1: $fuerza = 0; $app-&gt;enqueueMessage('Force:'.$fuerza.' Order Invoice Created:'.$order-&gt;order_invoice_created.' Old Order Invoice Created:'.$order-&gt;old-&gt;order_invoice_created); if(!$force &amp;&amp; (!empty($order-&gt;order_invoice_created) &#124;&#124; !empty($order-&gt;old-&gt;order_invoice_created))) { $app-&gt;enqueueMessage('Invoice cancelled'); return false; }

When I make a purchase using the Stripe plugin (where I get an invoice number for the suborder) I get the following messages:
After submitting the cart: Code:

Message Subsale 0 is being modified [14 / ] Notice: Undefined property: stdClass::$order_id in /home/tangopol/public_html/mg/administrator/components/com_hikamarket/classes/order.php on line 840 Notice: Undefined property: stdClass::$order_vendor_price in /home/tangopol/public_html/mg/administrator/components/com_hikamarket/classes/order.php on line 840

After submitting the credit card: Code:

Message Subsale 99 is being modified [ / 14.00000] Force:0 Order Invoice Created: Old Order Invoice Created:0 Thank you for your purchase.

Then I make a purchase using the MangoPay option.
There is no message after submitting the cart since I'm redirected to Mangopay to enter the credit card details.

After submitting the credit card details: Code:

Message Subsale 0 is being modified [14 / ] Subsale 101 is being modified [ / 14.00000] Force:0 Order Invoice Created: Old Order Invoice Created:1477304961 Invoice cancelled Thank you for your purchase.

As you can see, when using Mangopay as payment method and the execution arrives to the generateOrderInvoiceNumber() function in the order class, the fact that there is an Invoice created date in the Old Order property stops the creation of the invoice number for the suborder. This does not happen when using Stripe as paymeny method, and the suborder gets an invoice ID.

Thoughts?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 4 weeks ago [\#253384](#253384) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253384 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi,

Because you have added some trace in your file, the lines are not the same.
So I don't know what is your line 840.
My line 840 is empty and the line 841 is Code:

if(isset($order-&gt;order_vendor_price) &amp;&amp; $order-&gt;order_vendor_price !== $order-&gt;old-&gt;order_vendor_price) {

and there is no reference of the "order_id" or code which can generate a warning on the order_vendor_price.

Now the real problem is that, an order without "order_id" is being created and not updated.
I am sorry but I don't understand the tests you made nor the result you have ; they are not what I can see in the source code of the HikaMarket 1.7.2 package.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")**
- [![sabroso's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38789-sabroso "View sabroso's Profile") Topic Author
- [ Offline](/forum/user/38789-sabroso)

Less More

- Posts: 128
- Thank you received: 2
-
-

10 years 4 weeks ago -  10 years 4 weeks ago [\#253394](#253394) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253394 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi,

Line 840 refers to the lines you suggested me to add: Code:

$app = JFactory::getApplication(); $app-&gt;enqueueMessage('Subsale '.(int)$order-&gt;order_id.' is being modified [' . $order-&gt;order_vendor_price . ' / ' . $order-&gt;old-&gt;order_vendor_price . ']');

They go into the beforeUpdateSubsale function as follows Code:

$app = JFactory::getApplication(); $app-&gt;enqueueMessage('Subsale '.(int)$order-&gt;order_id.' is being modified [' . $order-&gt;order_vendor_price . ' / ' . $order-&gt;old-&gt;order_vendor_price . ']'); if(!empty($order-&gt;old-&gt;order_vendor_paid) &amp;&amp; $order-&gt;old-&gt;order_vendor_paid &gt; 0 &amp;&amp; (!isset($order-&gt;hikamarket-&gt;internal_process) &#124;&#124; $order-&gt;hikamarket-&gt;internal_process === false) ) { if(isset($order-&gt;order_vendor_price) &amp;&amp; $order-&gt;order_vendor_price !== $order-&gt;old-&gt;order_vendor_price) { $do = false; return; } }

The other tracing lines I have added in the administrator/components/com_hikamarket/classes/order.php are inside the generateOrderInvoiceNumber function as per my previous message.

I attach the full order.php file so you can see the line numbers - I attach it as .txt file because I'm not allowed to attach php files

What don't you understand? It looks pretty clear to me where the problem is. The key seems to be in the administrator/components/com_hikamarket/classes/order.php, inside the generateOrderInvoiceNumber() function.

As you can see in this function, there is an if condition to cancel the generation of the invoice: Code:

if(!$force &amp;&amp; (!empty($order-&gt;order_invoice_created) &#124;&#124; !empty($order-&gt;old-&gt;order_invoice_created))) { return false; }

When Stripe payment method is used, then when this function is called for the suborder Code:

$force = false $order-&gt;order_invoice_created = empty $order-&gt;old-&gt;order_invoice_created = 0

Hence the if does NOT execute and the execution of the function continues and gives and invoice ID to the suborder

When Mangopay payment method is used, then when this function is called for the suborder Code:

$force = false $order-&gt;order_invoice_created = empty $order-&gt;old-&gt;order_invoice_created = 1477304961

Since $order-&gt;old-&gt;order_invoice_created has a value, then the if gets executed and the return false stops the execution of the rest of the function. Hence the suborder does not get an invoice ID

Last edit: 10 years 4 weeks ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 4 weeks ago [\#253396](#253396) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253396 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi,

Okay ; now I understand the messages you got in your log.

1 - The PHP warning messages are normal (and not problematic).
The code is called for both triggers (create / update).
It is logical that when the order is created, there is no "order_id" because there is not an order in the database yet.
When the order is created, there is also no "old" order.

2 - You're right, there is a problem regarding the order_invoice_created ; but due to the fact that there was a lot of messages that I don't understand what it was coming from, I missed the important point.

In the mangopay plugin, you will find a query which update the sub orders for the vendor payment. Code:

$query = 'UPDATE ' . hikashop_table('order') . ' SET order_vendor_paid = order_id, order_invoice_created = ' . time() . ' WHERE order_id IN (' . implode(',', $suborders_id) . ')';

To Code:

$query = 'UPDATE ' . hikashop_table('order') . ' SET order_vendor_paid = order_id ' . ' WHERE order_id IN (' . implode(',', $suborders_id) . ')';

And the reason why you got the issue and I was not is the ordering of the plugins in Joomla.
HikaMarket get the notification thanks to his plugin "hikashop / market" and the mango pay plugin via "hikashoppayment / mangopay".
In your case it looks like the payment plugin is called before, so it updates the database and then when HikaMarket is notified, the suborders were already marked.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")**
- [![sabroso's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38789-sabroso "View sabroso's Profile") Topic Author
- [ Offline](/forum/user/38789-sabroso)

Less More

- Posts: 128
- Thank you received: 2
-
-

10 years 4 weeks ago [\#253471](#253471) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253471 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

OK, thank you very much Jerome. It looks like we are getting to the bottom of the issue.

However I'm still not 100% clear about the solution you suggested:

a) Just change the query you mentioned in the Mangopay plugin? ( will this be changed in the future version of the plugin?)
b) Just re-order the plugins? ( is this a reliable solution?)
c) Both change the query AND re-roder the plugins?

Many thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 4 weeks ago [\#253472](#253472) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253472 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Hi,

Just apply the patch in the plugin ; it will be fine.
Because the plugins are in two different groups, you cannot change their relative ordering.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")**
- [![sabroso's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38789-sabroso "View sabroso's Profile") Topic Author
- [ Offline](/forum/user/38789-sabroso)

Less More

- Posts: 128
- Thank you received: 2
-
-

10 years 4 weeks ago [\#253514](#253514) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Vendor sub-order does NOT get invoice number when using Mangopay](/forum/19-hikamarket/887063-vendor-sub-order-does-not-get-invoice-number-when-using-mangopay#253514 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.6  FYI: Mangopay Payment Plugin 1.7.3  Hi there,  In the Hikashop config I have: - Payment confirmed order status: confirmed  I have setup 3 Payment Methods: - Bank Transfer - Stripe - Mangopay  After the order gets confirmed then it gets an invoice number, both the parent order and the vendor suborder. This process happens OK with Bank Transfer and Stripe. However there is a problem when Mangopay is used, the parent order gets invoice number but the vendor sub-order does NOT get invoice number when confirmed.  This tells me it is not a configuration problem (it works fine with Stripe and Bank Transfer) but a problem with the Mangopay plugin.  I have checked php error logs as follows:  When Bank Transfer is used -&gt; no errors  When Stripe is used  When Mangopay is used  It looks like the PHP notice is the same when using Stripe and Mangopay, so I'm not sure this is the source of the problem. But unfortunately there is no other error message.  Please help, thanks!")*

Thank you very much Jerome, this is now working fine.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODg3MDYzLXZlbmRvci1zdWItb3JkZXItZG9lcy1ub3QtZ2V0LWludm9pY2UtbnVtYmVyLXdoZW4tdXNpbmctbWFuZ29wYXk/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.090 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
