GestPay PlugIn Multistore redirection URL

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 năm cách đây
We have a multistore environment (3 stores), and downloaded this free plugin
https://www.nopcommerce.com/p/2421/gestpay-payment-plugin.aspx

It works fine except the BancaSella's payment page "Return to store" button redirects to the principal store's homepage (domain name). How can the plugin be changed to redirect to the currently used store, possibly where the user left off, like PayPal?
6 năm cách đây
UPDATE: I phoned BancaSella. The technical guy in their support center told me they require you to purchase a separate codice esercente for each domain. Using the GestPay backoffice you can then configure the respective URLs for ACK, NAK and Server2Server response.

But companies like to save money so I tried modifying the Nop.Plugin.Payments.GestPay plugin, file PaymentGestPayController.cs, public ActionResult EsitoGestPay. I initially tried to use the activeScope to get the SiteUrl to redirect to but it was always returning SiteId=1 (root site).
Instead my workaround uses the order to retrieve the current user's store:

1)
                        //__________ Redirect Multistore __________//
                        if (order.StoreId > 1)
                            return Redirect(string.Format("{0}/checkout/completed/{1}",
                                _storeService.GetStoreById(order.StoreId).Url,
                                order.Id.ToString()));
just before ACK:

                        //__________ Ordine Completato __________//
                        return RedirectToRoute("CheckoutCompleted", new { orderId = order.Id });


and

2)

                        //__________ Redirect Multistore __________//
                        if (order.StoreId > 1)
                            return Redirect(string.Format("{0}/Plugins/PaymentGestPay/Error?type=1&errC={1}&errD={2}",
                                _storeService.GetStoreById(order.StoreId).Url,
                                HttpUtility.UrlEncode(errorCode),
                                HttpUtility.UrlEncode(ErrorDesc)));

just before NAK:
                        //__________ ??Comunicarlo all'utente?? __________//
                        return RedirectToAction("GeneralError", new { type = "1", errC = HttpUtility.UrlEncode(errorCode), errD = HttpUtility.UrlEncode(ErrorDesc) });


If there is a more professional way to handle return URL in a multistore environment this please let me know!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.