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

#   Declined Mangopay transaction not properly redirected

##

- **[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
-
-

9 years 6 months ago [\#267862](#267862) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#267862 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")* was created by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")*

-- HikaShop version -- : 3.0.1
-- HikaMarket version -- : 1.7.3
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6

Hi there,

I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.

In the Payment method Configuration I have setup a Cancel URL as follows:
[ myweb.com/index.php?option=com\_content&amp;view=article&amp;id=15](https://myweb.com/index.php?option=com_content&view=article&id=15)

Which is a Jomla menu item which contains a single article.

However when the payment is declined by Mangopay the user is redirected back to:
[ myweb.com/component/hikashop/order/cancel\_order?lang=en](https://myweb.com/component/hikashop/order/cancel_order?lang=en)

Which is a completely blank page (on the component area of Joomla).

I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?

No errors in the MangoPay log.

To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIyLW1hcmtldC1idWctcmVwb3J0Lzg4OTkwNC1kZWNsaW5lZC1tYW5nb3BheS10cmFuc2FjdGlvbi1ub3QtcHJvcGVybHktcmVkaXJlY3RlZD90bXBsPW1hcmtkb3du) 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: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

9 years 6 months ago [\#267863](#267863) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#267863 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")*

Hello,

The redirection to that HikaShop page is logical and expected.
That HikaShop task need to update the order and then load the "cancel url" stored in the plugin configuration to perform a redirection.
In any case a redirection should be made.

So if you have a full blank page in "cancel_order", it indicates a PHP fatal error.
Please take a look at your PHP error log in order to check that error and have more details about it.

Regards,

---

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

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

9 years 6 months ago -  9 years 6 months ago [\#267911](#267911) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#267911 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")*

Hi, thanks,

Sorry it is not a full blank page. All the modules, menus, etc load fine, it is just the area where the component displays has no content at all (see attached)

I'm testing on a testing environment with PHP error reporting set to maximum and I don't see any fatal error, warning, notice or anything in fact. Nothing gets added to the error log either when I perform this operation.

The order does not get updated and there is no redirection to the cancel url which I have setup in the plugin config.

PS: I have tested the same scenario (card declined) with the Stripe Plugin and it works fine, the order gets automatically cancelled. However in the Stripe Plugin there is no "Cancell URL" so I could not see if that works

- [ ![Screenshot-mg-tgpx.png](/forum/attachment/37755) ](/forum/attachment/37755 "...ot-mg-tgpx.png") [ ](/forum/attachment/37755?download=1 "...ot-mg-tgpx.png")

Last edit: 9 years 6 months ago by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIyLW1hcmtldC1idWctcmVwb3J0Lzg4OTkwNC1kZWNsaW5lZC1tYW5nb3BheS10cmFuc2FjdGlvbi1ub3QtcHJvcGVybHktcmVkaXJlY3RlZD90bXBsPW1hcmtkb3du) 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: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

9 years 6 months ago [\#267916](#267916) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#267916 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")*

Hello,

Okay.
Regarding the URL, it looks like the fact that there is no "order_id" in the parameter, HikaShop is not able to determine what is the current order id to determine which payment plugin load to get his cancel url.
But HikaShop should have the "order_id" information in the current session ; so that is strange that it cannot retrieve it...

In the hikashoppayment mangopay plugin, you can replace the line Code:

$redirect_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&amp;ctrl=order&amp;task=cancel_order';

By Code:

$redirect_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&amp;ctrl=order&amp;task=cancel_order&amp;order_id=' . (int)$order_id;

In order to force the "order_id" in the URL and then HikaShop should continue his normal process.

Regards,

---

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

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

9 years 6 months ago [\#268049](#268049) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#268049 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")*

Thanks Jerome,

That fixes the redirection issue, now the "Cancel URL" configured in the MangoPay payment plugin is loaded after a cancelled or failed transaction.

However, the order stays as CREATED. Which is confusing to both the Vendor and the Customer.

When I tested this with the Stripe Payment Plugin, once the payment is rejected the order status gets automatically changed to CANCELLED and both the Vendor and the Client get an email saying the status of their order has changed to CANCELLED.

Shouldn't the MangoPay payment plugin do this as well?

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIyLW1hcmtldC1idWctcmVwb3J0Lzg4OTkwNC1kZWNsaW5lZC1tYW5nb3BheS10cmFuc2FjdGlvbi1ub3QtcHJvcGVybHktcmVkaXJlY3RlZD90bXBsPW1hcmtkb3du) 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: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

9 years 6 months ago [\#268056](#268056) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#268056 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")*

Hello,

That's not the role of the plugin ; that's the goal of the "order&amp;task=cancel_order" of HikaShop.

Regards,

---

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

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

9 years 6 months ago [\#268103](#268103) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#268103 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")*

OK, what I meant is WHY the order is NOT cancelled when the payment is cancelled/declined by MangoPay?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIyLW1hcmtldC1idWctcmVwb3J0Lzg4OTkwNC1kZWNsaW5lZC1tYW5nb3BheS10cmFuc2FjdGlvbi1ub3QtcHJvcGVybHktcmVkaXJlY3RlZD90bXBsPW1hcmtkb3du) 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: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

9 years 6 months ago [\#268105](#268105) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#268105 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")*

Hello,

As I mentioned in my previous message ; that's not related to the plugin.
So please open a new thread in the HikaShop section of the forum.

Regards,

---

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

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

9 years 6 months ago [\#268536](#268536) by [sabroso](/forum/user/38789-sabroso "View sabroso's Profile")  Replied by *[sabroso](/forum/user/38789-sabroso "View sabroso's Profile")* on topic *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#268536 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")*

Hi Jerome,

I reported the fact that the order was not getting automatically cancelled when the payment was cancelled/declined by MangoPay in the HIkashop Forum as you suggested:

[ www.hikashop.com/forum/3-bug-report/8899...mangopay.html#268534](https://www.hikashop.com/forum/3-bug-report/889953-order-not-cancelled-automatically-after-payment-declined-in-mangopay.html#268534)

It turns out the problem can be fixed by adding the following patch to the MangPay Payment plugin in the paymentNotificationSecureReturn function, right before the line:
Code:

if(empty($this-&gt;app))

The patch would be:
Code:

elseif(isset($payIn-&gt;Status) &amp;&amp; $payIn-&gt;Status == 'FAILED') { $order_status = $this-&gt;payment_params-&gt;invalid_status; $history = new stdClass(); $history-&gt;notified = 1; $history-&gt;data = 'MangoPay Secure Return: '.$payIn-&gt;Status; $this-&gt;modifyOrder($order_id, $order_status, $history, true); }

This greatly enhances the usability of the plugin, so I think it will be a good idea to include it in the plugin moving forward.

What do you think?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIyLW1hcmtldC1idWctcmVwb3J0Lzg4OTkwNC1kZWNsaW5lZC1tYW5nb3BheS10cmFuc2FjdGlvbi1ub3QtcHJvcGVybHktcmVkaXJlY3RlZD90bXBsPW1hcmtkb3du) 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: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

9 years 6 months ago [\#268538](#268538) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Declined Mangopay transaction not properly redirected](/forum/22-market-bug-report/889904-declined-mangopay-transaction-not-properly-redirected#268538 "-- HikaShop version -- : 3.0.1 -- HikaMarket version -- : 1.7.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6  Hi there,  I’m using MangoPay as the payment method and I have an issue when the user’s card is declined by MangoPay since the user is NOT being redirected to the URL I expect it to.  In the Payment method Configuration I have setup a Cancel URL as follows:   myweb.com/index.php?option=com&#95;content&amp;view=article&amp;id=15  Which is a Jomla menu item which contains a single article.  However when the payment is declined by Mangopay the user is redirected back to:   myweb.com/component/hikashop/order/cancel&#95;order?lang=en  Which is a completely blank page (on the component area of Joomla).  I have also noticed that the order created before redirecting the user to the MangoPay gateway where the card is inserted, stays as created. And in the Payment method configuration I have setup Invalid Status as Cancelled. Shouldn’t the order be cancelled automatically?  No errors in the MangoPay log.  To generate the declined payment in MangoPay sandbox you have to use a valid testing card and type 999 as CVV code  Thanks!")*

[ www.hikashop.com/forum/3-bug-report/8899...mangopay.html#268535](https://www.hikashop.com/forum/3-bug-report/889953-order-not-cancelled-automatically-after-payment-declined-in-mangopay.html#268535)

---

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

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

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