You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew M <an...@jibeya.com> on 2004/11/30 16:21:43 UTC

Flowscript, posting a form to an external url and returning back to flowscript

How do chaps,
I will try my best to explain what i'm trying to do. Ok, I have a form 
which when filled out by a user is then submitted to a secure merchant 
account which checks the users credit card details:

1. flowscript:
cocoon.sendPageAndWait("confirmOrder.xml", 
{"artistID":artistID,"artist_name":artist_name});

//Check if payment is successful
if (creditcardpayment is ok){
	cocoon.sendPage("confirmSuccess.xml")
}else{
	cocoon.sendPage("confirmFail.xml")
}

2. form

    <form action="https://www.merchant.com/merchant.dll/checkout" 
name="Form1" method="post">
    <input type="hidden" id="return-url" value="${muUrl}"/>
    <input type="hidden" name="continuation-id" id="continuation-id" 
value="${cocoon.continuation.id}"/>


Once processing is completed, the user is then redirected back to my 
website via the return-url. My question is this, how do I get back to 
the if statement following the sendPageWait? Is this possible?

many thanks


Andrew

Re: Flowscript, posting a form to an external url and returning back to flowscript

Posted by Andrew M <an...@jibeya.com>.
Reinhard,
brilliant.. I will give that a try.

many thanks

Andrew
On 30 Nov 2004, at 15:30, Reinhard Poetz wrote:

> Andrew M wrote:
>> How do chaps,
>> I will try my best to explain what i'm trying to do. Ok, I have a 
>> form which when filled out by a user is then submitted to a secure 
>> merchant account which checks the users credit card details:
>> 1. flowscript:
>> cocoon.sendPageAndWait("confirmOrder.xml", 
>> {"artistID":artistID,"artist_name":artist_name});
>> //Check if payment is successful
>> if (creditcardpayment is ok){
>> cocoon.sendPage("confirmSuccess.xml")
>> }else{
>> cocoon.sendPage("confirmFail.xml")
>> }
>> 2. form
>> <form action="https://www.merchant.com/merchant.dll/checkout" 
>> name="Form1" method="post">
>> <input type="hidden" id="return-url" value="${muUrl}"/>
>> <input type="hidden" name="continuation-id" id="continuation-id" 
>> value="${cocoon.continuation.id}"/>
>> Once processing is completed, the user is then redirected back to my 
>> website via the return-url. My question is this, how do I get back to 
>> the if statement following the sendPageWait? Is this possible?
>
>
> Change the return url to
>
> <input type="hidden" id="return-url" 
> value="http://yourwebserver/${yourUrl}/${continuation.id}"/>
>
> or something similar. The the flow will be continued ...
>
> -- 
> Reinhard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Flowscript, posting a form to an external url and returning back to flowscript

Posted by Reinhard Poetz <re...@apache.org>.
Andrew M wrote:
> How do chaps,
> I will try my best to explain what i'm trying to do. Ok, I have a form 
> which when filled out by a user is then submitted to a secure merchant 
> account which checks the users credit card details:
> 
> 1. flowscript:
> cocoon.sendPageAndWait("confirmOrder.xml", 
> {"artistID":artistID,"artist_name":artist_name});
> 
> //Check if payment is successful
> if (creditcardpayment is ok){
> cocoon.sendPage("confirmSuccess.xml")
> }else{
> cocoon.sendPage("confirmFail.xml")
> }
> 
> 2. form
> 
> <form action="https://www.merchant.com/merchant.dll/checkout" 
> name="Form1" method="post">
> <input type="hidden" id="return-url" value="${muUrl}"/>
> <input type="hidden" name="continuation-id" id="continuation-id" 
> value="${cocoon.continuation.id}"/>
> 
> 
> Once processing is completed, the user is then redirected back to my 
> website via the return-url. My question is this, how do I get back to 
> the if statement following the sendPageWait? Is this possible?


Change the return url to

<input type="hidden" id="return-url" 
value="http://yourwebserver/${yourUrl}/${continuation.id}"/>

or something similar. The the flow will be continued ...

-- 
Reinhard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org