ASP.NET MVC: Triggering an action before posting to Paypal payment gateway

Posted by ajbeaven on Stack Overflow See other posts from Stack Overflow or by ajbeaven
Published on 2010-05-11T03:10:46Z Indexed on 2010/05/13 0:44 UTC
Read the original article Hit count: 335

Filed under:
|

I'm in the middle of developing an e-commerce site that is using Paypal as it's payment gateway. All I want to do is run some code before the user heads off to Paypal to pay for their order, but I have no idea how to do it.

The user should click a submit button, changes are made (in this case, the status of the order), and then the user is redirected to the payment gateway. Eg:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult GoToPaypal(FormCollection collection)
{
    //change order status

    //send user to paypal where they pay for their order
}

So my question is how do you do application stuff and then redirect to paypal's payment gateway? Example HTML and C# would be lovely :)

© Stack Overflow or respective owner

Related posts about paypal

Related posts about asp.net-mvc