Detect internal order/created in administration - kentico

We have built a custom payment provider, see http://pmc.digital/pt/blogue/junho-2016/integracao-mb-way-com-kentico-cms/ (PT only sorry, see https://translate.google.com/translate?hl=en&sl=pt&tl=en&u=http%3A%2F%2Fpmc.digital%2Fpt%2Fblogue%2Fjunho-2016%2Fintegracao-mb-way-com-kentico-cms%2F for Google Translated version).
It works great, including with internal orders by site editors, however because the visitor (on the front-end) needs to be redirected to a "Pending Order Page" (with instructions to accept the payment in the provider's APP), it is also redirecting users in admin.
I was hoping to have a ViewMode for the administration, however when doing an internal order the PortalContext.ViewMode is live site (I guess so it can use the Shopping Cart steps/methods, etc).
Is it enough to check whether the current logged in user is not the user for the cart, and has the necessary permissions to the ecommerce module?
Considering usability what's the best method to redirect to the Orders APP from the CMSPaymentGatewayProvider ProcessPayment method?

You can use the following as well:
if(!string.IsNullOrEmpty(DocumentContext.CurrentAliasPath))
{
//do front end code
}
else
{
//do back end code
}
I have this running in a custom payment gateway with no issues at all.

The page that is used for creating new orders via administration interface has following url:
/CMSModules/Ecommerce/Pages/Tools/Orders/Order_New.aspx
So you can either check if the order is placing through this page or you can customize it and set some custom variable that would tell where you are placing the order.
If you want to get redirected to man Orders application, then the url is:
/Admin/CMSAdministration.aspx#b72ad042-31bf-4ff2-8436-25a647bba548
If you want just the grid of orders, then this is the url you are looking for:
/CMSModules/Ecommerce/Pages/Tools/Orders/Order_List.aspx

Related

How do I capture the URL after an external website login in ReactJS?

I want to retrieve the URL after opening an external website pop up in my ReactJS/NodeJS application. Basically in my application, I have a button that redirects the page to microsoft online login page. What I want is the URL of the page after the user logs into microsoft online.
Is there any way that's possible? If so, what are my options?
If you navigate to another webpage, your React application is no longer being served to your browser, and can't do anything. You would need to have a script running on the microsoft website, either by writing it in the source code (which I doubt you can do) or by some other method such as a browser extension.
There is no way to track different systems like methods #izb mentioned, if they already dont provide.
Many systems provides information from their servers, push/ping systems.
One of the payment systems, I redirect request, customer pays, and they redirects the page I entered before in their panel, like successful or fail pages.

Add condition for smart-app-banner?

i'm using smart-app-banner for site. How i can add some condition for showing this banner? For example, user entered on our site but did not do any things with banner(close or install), that is why if he well return on our site next time, we must show this banner for him only after three days.
You should check out this alternative to the solution you are currently using as it states: "When a customer visits your site, Desktop users are sent an SMS with a link to download your app. Mobile users are automatically directed to the appropriate app store."
https://github.com/ombori/app-banner

Orchard CMS Editable Content on MVC Views

I'm working on an Orchard module for selling an e-book of sorts. Prior to purchase, a user can view a page showing a sample of the product. After purchase, there is no more need for the sample page, and the user has access to the full product.
I would like to set things up such that if a paying customer tries to access the sample page that they would be redirected to their full product and if a non-customer were to try to go to full product page they would be redirected to the sample. I'd also like my page content to be editable via the Dashboard.
My current implementation:
Controller handling the conditional routing / redirecting based on whether a purchase has been made.
A layer rule for each of my page url's each containing an html widget to provide the page content
This seems to work, but I am wondering what other options I have to accomplish this.
You may be making things way more complicated than they need to be.
Using widgets is unnecessary. It would be much better to build a regular content type and display that. You could serve it through a special controller that checks for a purchase, but even that is unnecessary. Instead, you could create a part that would have the purchase verification logic in its driver's display method. This way, you could even apply the exact same logic to any content type.

Custom Terms of Use Page before login to SharePoint

I am using MOSS with ADS. I want to display Terms of Use page before the user can login into SharePoint with two button i.e. "Accept","Decline". If user select "Accept" he will be directed to sharepoint site, if not to our companies intranet front page. This will be applicable for the current session. ie. If the user has signed off, then it should prompt the terms of use again when user hits the MOSS site but once accepted user should not get this page again until he/she signs off.
Please advise.
Thank you
You can follow one of the Approach below based on your requirement & Flexibility.
If you have AD Configured with the FBA, Make a copy of Login.aspx and save it as MyLogin.aspx & Edit the Login Control and insert your Terms & Conditions there,keep in a check box AND enable the login button only if I agree is checked.
Next is to have a control that is deployed to the Master Page, this control will not have a UI but it will check in the session to see if the user has agreed the Terms and condition if yes it will redirect to the welcome page or the page user has requested else will navigate him to the Terms page until accepts.On Accept flag that information in session.
If you are using SharePoint 2010 you could use the Dialog framework to show a popup & get this done.
You could create a custom page in /_layouts which has your terms and conditions, along with the buttons for accept/decline.
Hitting the accept button will create a cookie for keeping track of whether or not the user has accepted the conditions for the current session.
Then, you could create a HttpModule which intercepts all requests to the SharePoint site. If the cookie is present, do nothing (ie let the user access the requested page), otherwise redirect the browser to the custom accept/decline page.
You should be able to do this fairly easily. If you dont care about them accepting or denying it, then just use this redirect module http://httpcode.s3.amazonaws.com/httpcode.Redirect.wsp to redirect them once to the page. You can tell this module to do it once. If you need to verify that they accept/decline, you will need to add all the people to a new group, and then on accepting, remove them from that group. That way they will always be directed to the new page.
Hope this helps

Sharepoint Redirecting Users or Groups from a page to another

What I am tring to do is, when people comes to that page:
http://server:26521/MY_Portal/service/default.aspx
I want them to be redirected to that page
http://server:26521/default.aspx
Depending on their User name Or User Group.
Thanks for helps.
I can think of two ways to do this:
If you're using ISA Server or a similiar product in front of Sharepoint, you can configure it to do this. So those users who you want redirected will never access the first page.
Alternatively, you could write a webpart, which analyzes who the user is, and does some sort of redirection, either in .net or in javascript to the page you want.

Resources