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

#   call custom payment plugin even when total is 0

##

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

Less More

- Posts: 53
- Thank you received: 1
-
-

3 years 8 months ago [\#349453](#349453) by [matmosis](/forum/user/61552-matmosis "View matmosis's Profile")  *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349453 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")* was created by *[matmosis](/forum/user/61552-matmosis "View matmosis's Profile")*

-- HikaShop version -- : 4.7.1
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.3
-- Browser(s) name and version -- : Chrome 90.0.4430.212

Hello,
we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic.
if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.

Is it possible to make it always called even with a total amount = 0?

Thanks.

Regards,
Matteo

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

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34318_2015-11-18-2.png)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 654
-
-

3 years 8 months ago -  3 years 8 months ago [\#349456](#349456) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349456 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hello,

Sorry for this return, but we aren't sure to follow you, what do you mean by "***the plugin is not called at all***"
- Do you mean not display in while checkout process
**OR**
- The finish button isn't display ? Or nothing happen when you click it?
If it's a different idea, please be very specific in your answer, and in all case explain us why you need to pass by the payment server, whereas with a total of 0 no payment should be required.
**=&gt;** Your elements will surely allow us to better understand your needs and therefore be more precise in our help.

Regards

Last edit: 3 years 8 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

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

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

Less More

- Posts: 53
- Thank you received: 1
-
-

3 years 8 months ago [\#349472](#349472) by [matmosis](/forum/user/61552-matmosis "View matmosis's Profile")  Replied by *[matmosis](/forum/user/61552-matmosis "View matmosis's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349472 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hello,
we made a custom payment plugin that is called when choosed as a payment method from the chekcout page.
this custom plugin redirect to a servlet (java app) because this app manage the payment environment and do other stuff after the payment is done.
if the total amount on checkout page is = 0 the finish button is dispayed, but if i click it, hikashop does not call out custom payment plugin, because the chkeout page with a total amout = 0 does not present any choose for the payment (yes, because the total is 0)

but we need to call out payment plugin anyway, because in the flow, even when the total is 0 we need to do stuff

is there a way to call our custom payment plugin even when no payment method is present for choice?

Thanks.

Regards,
Matteo

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

3 years 8 months ago [\#349474](#349474) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349474 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

You should implement the onAfterOrderCreate(&amp;$order, &amp;$send_email) event in your plugin.
In it, check if the $order-&gt;order_full_price is set to 0. If it is, then you can call the function of your plugin redirecting to the servlet.

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

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

Less More

- Posts: 53
- Thank you received: 1
-
-

3 years 8 months ago [\#349492](#349492) by [matmosis](/forum/user/61552-matmosis "View matmosis's Profile")  Replied by *[matmosis](/forum/user/61552-matmosis "View matmosis's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349492 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,
ok thank you!

i just implemented the onAfterOrderCreate and it is ok, but our "servlet url" to call is configured as a payment plugin parameter, and i usually retrive it with $this-&gt;payment_params-&gt;payment_url, but unfortunatelly in this case is empty, maybe because no payment method is selected (order_full_price = 0) ??

Usually we use onAfterOrderConfirm(&amp;$order, &amp;$methods, $method_id) and call parent::onAfterOrderConfirm($order, $methods, $method_id); // This is a mandatory line in order to initialize the attributes of the payment method

Is there a way i can simulate like if our custom payment plugin is selected when order_full_price = 0?

Thanks.

Regards,
Matteo

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

3 years 8 months ago [\#349493](#349493) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349493 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

Yes. Like in the onPaymentNotification method of payment plugins, you can use the line: Code:

$this-&gt;loadPaymentParams($order);

This will load $this-&gt;payment_params based on the payment method selected in the order.

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

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

Less More

- Posts: 53
- Thank you received: 1
-
-

3 years 8 months ago [\#349505](#349505) by [matmosis](/forum/user/61552-matmosis "View matmosis's Profile")  Replied by *[matmosis](/forum/user/61552-matmosis "View matmosis's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349505 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

the problem is that in the $order there is no payment method selected, that is because when order_full_price = 0 no payment method is presented as a choice in the checkout page.

Is there another way to load our custom payment plugin parameters?

Thanks.

Regards,
Matteo

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

3 years 8 months ago [\#349506](#349506) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349506 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

You just need to set it: Code:

$order-&gt;order_payment_method = 'XXX'; $order-&gt;order_payment_id = 'YYY'; $this-&gt;loadPaymentParams($order);

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

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

Less More

- Posts: 53
- Thank you received: 1
-
-

3 years 8 months ago [\#349517](#349517) by [matmosis](/forum/user/61552-matmosis "View matmosis's Profile")  Replied by *[matmosis](/forum/user/61552-matmosis "View matmosis's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349517 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

yes but, how am i supposed to know those data?
order_payment_method is a class, how can i reproduce it?

and how can i be sure what number is order_payment_id ?
we have a development environment, a staging and a production one, in every environment could be a different number.

Is there a way to do it?

Thanks.

Regards,
Matteo

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

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

Less More

- Posts: 53
- Thank you received: 1
-
-

3 years 8 months ago [\#349519](#349519) by [matmosis](/forum/user/61552-matmosis "View matmosis's Profile")  Replied by *[matmosis](/forum/user/61552-matmosis "View matmosis's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349519 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

suppose that i set a "default payment id" parameter somewhere in our component, is there a way to retrive "payment_method" class from payment_id ?

something like:

$order-&gt;order_payment_id = JComponentHelper::getParams('our_component')-&gt;get('default_payment_id');
$order-&gt;order_payment_method = hikashop-&gt;getPaymentClass($order-&gt;order_payment_id);
$this-&gt;loadPaymentParams($order);

Thanks.

Regards,
Matteo

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

3 years 8 months ago [\#349518](#349518) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349518 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

order_payment_method needs to be the folder name of your payment plugin. Since this development is for a payment plugin you already know it and it won't change. You could actually use $this-&gt;name since you're implementing the onAfterOrderCreate in your payment plugin.
For order_payment_id, this will change for each different website. You could retrieve it from the database with a small MySQL query: Code:

$db = JFactory::getDBO(); $query = 'SELECT payment_id FROM #__hikashop_payment WHERE payment_type = '.$db-&gt;Quote($this-&gt;name); $db-&gt;setQuery($query); $order-&gt;order_payment_id = $db-&gt;loadResult();

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

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

Less More

- Posts: 53
- Thank you received: 1
-
-

3 years 8 months ago [\#349526](#349526) by [matmosis](/forum/user/61552-matmosis "View matmosis's Profile")  Replied by *[matmosis](/forum/user/61552-matmosis "View matmosis's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349526 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

ok thank you i'll give it a try.

Meanwhile I notice a strange beaviour when full_price is &gt; 0
onAfterOrderCreate() is called two times, the first one with $order-&gt;order_full_price = 0 and the second time with the right order
amount. Furthermore the first time the object $order is different from the second time $order, the first only have properties, the second have classes as well (bill,cap,cart, etc.)

A similar behaviour appends when full_price is = 0

It's expected? how can we know if we are in the right onAfterOrderCreate() call?

Thanks.

Regards,
Matteo

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

3 years 8 months ago [\#349527](#349527) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349527 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

It must be because you're using HikaMarket. In that case, HikaMarket will create a sub order for each vendor linked to the order.
That way, each vendor only see his sub order while the shop owner and the customer see the main order.
So you need to check $order-&gt;order_type == 'sale' in order to only take into account the main order, not the sub orders.

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

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

Less More

- Posts: 53
- Thank you received: 1
-
-

3 years 8 months ago [\#349560](#349560) by [matmosis](/forum/user/61552-matmosis "View matmosis's Profile")  Replied by *[matmosis](/forum/user/61552-matmosis "View matmosis's Profile")* on topic *[call custom payment plugin even when total is 0](/forum/4-how-to/905940-call-custom-payment-plugin-even-when-total-is-0#349560 "-- HikaShop version -- : 4.7.1 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.3 -- Browser(s) name and version -- : Chrome 90.0.4430.212  Hello, we made a custom payment plugin, this plugin redirect to a servlet (java) for the payment logic. if the cart has total amount = 0 (due to discounts or coupons) the plugin is not called at all.  Is it possible to make it always called even with a total amount = 0?  Thanks.  Regards, Matteo")*

Hi,

you are precious! thank for your kind support, I managed to solve.

Thanks.

Regards,
Matteo

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwNTk0MC1jYWxsLWN1c3RvbS1wYXltZW50LXBsdWdpbi1ldmVuLXdoZW4tdG90YWwtaXMtMD90bXBsPW1hcmtkb3du) 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?

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

Time to create page: 0.486 seconds

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

[](#top)
