Hi Simone,
many thanks for your suggestions.

1) Instead of using redirectTo, set up a page with a link to the external site (like a jx page), then use sendPageAndWait to send this page to the user, he will click on the link, go to the external site and all the rest, while your flow will be suspended until the external site will redirect him to your continuation and the flow will restart. This is a clean solution, but involves one more step for the user.

I have implemented the following so far:

function getUserOrder() {
        ......
......
cocoon.sendPageAndWait("confirmStage")
}

confirmStage is a sitemap function call:

<map:match pattern="confirmStage.xml">
<map:call function="confirmStage"/>
</map:match>


to:

function confirmStage() {
//2. Get card details.
var form = new Form("forms/CreditCardDetails.xml");
form.showForm("CreditCardDetails.xml", {"userGlobal":userGlobal});
var model = form.getModel();
var bizData = {"fname" : model.fname, "lname" : model.lname, "account_no" : model.account_no, "credit" : model.credit, "month" : model.month, "year" : model.year}

try {
if (value-returned == true) {
}else{
}
} catch (e) {
//Some problem has occured
msg2 = e.toString();
}
}

So I am making a sendPageAndWait to a form which reads like this in the html:

<form action=""http://www.externalsite.com/test.asp">www.externalsite.com/test.asp" name="Form1" method="post" ><input name="forms_submit_id" type="hidden" />
<input value="32558c182c69426584288f333413213a8a2a6a58" type="hidden" name="continuation-id" />
.......

The user enters their credit card details and clicks submit which posts the form to externalsite.com. 

Now, at this point, this is where I get confused. You say:

'while your flow will be suspended until the external site will redirect him to your continuation'

How so? This is what comes back to me:

www.mysite.com/continuation-id/value-returned

What happens next? How do I get the value-returned into the if statement following the var bizdata line?

many thanks

Andrew

Reply via email to