Sana Assistant (online)
Table of Contents

PunchoutNextAction reference

Determines the next action in the punchout process that needs to be executed by Sana Commerce Cloud after completion of TransferBasketAsync method.

Class

PunchoutNextAction.HttpPost

Tells Sana Commerce Cloud to send an HTTP POST request to specified URL with specified form values. Returns an instance of PunchoutNextAction.HttpPostAction nested type.

It can be used in the punchout process to post the basket data to the procurement system:

// 'url' here is the URL of the procurement system page.
// 'data' here is the dictionary containing the values to post to the procurement system.
return NextAction.HttpPost(url, data);

PunchoutNextAction.Redirect

Tells Sana Commerce Cloud to perform a redirect to specified URL. Returns an instance of PunchoutNextAction.RedirectAction nested type.

It can be used in the punchout process to redirect the user to the procurement system:

// 'url' here is the URL of the procurement system page.
return PunchoutNextAction.Redirect(url);

You can specify an optional message that will be shown to the user while the redirect is being performed in the user's browser:

return PunchoutNextAction.Redirect(url, "Please wait while we are redirecting you to the procurement system page...");

The message can be also a piece of HTML markup if you need to beautify it with some formatting. To do this pass true in isHtmlMessage parameter:

string formattedMessage = "<h1>Redirecting...<h1><div>Please wait while we are redirecting you to the procurement system page...<div>";
return PunchoutNextAction.Redirect(url, formattedMessage, isHtmlMessage: true);

See also