views:

289

answers:

2

Hi,

I would like to have a user redirected to an external credit card gate. Of course I have to POST some user info to that gate, but I don't know how exactly can I do this.

I know that I could do this by generating a html form with hidden or read-only fields and have a user click "Submit" button. But this solution is not perfect, because all the form data could be easily changed using e.g. Firebug. I think you cannot do this using $this->_redirect(...). But maybe there is some other solution?

Many thanks for any tips or suggestions.

+2  A: 

I would like to have a user redirected to an external credit card gate. Of course I have to POST some user info to that gate, but I don't know how exactly can I do this.

Using a form is the only method available. The RFC states that the user should explicitly agree to sending a POST (i.e. click on a submit button).

I know that I could do this by generating a html form with hidden or read-only fields and have a user click "Submit" button. But this solution is not perfect, because all the form data could be easily changed using e.g.

It is no more secure that using a redirect as the header data can be modified without too much of a problem. There are even Firefox plugins to do it.

Yacoby
Thanks. So it appears that I have to go with a form.
Marcin
It's how it's done everywhere.
Htbaa
A: 

use cURL to post data

http://framework.zend.com/manual/en/zend.http.client.adapters.html

bonez
Thanks. I'll have a look at it.
Marcin
This will not allow you to redirect the user to the payment gateway.
Htbaa
depends on if you want to redirect. his question was merely to post data. short of creating a you're own form, you send data via a post request with cURL
bonez