Welcome Guest, Not a member yet? Register   Sign In
HTTP POST from Controller, NOT from HTML Form
#17

[eluser]tkaw220[/eluser]
Dear all,

After days of trial and research, I found that my problem comes from cURL redirect. Below I enclosed my codes:

$postdata = array(
'MerchantCode' => $MerchantCode,
'PaymentId' => $this->session->userdata('payment_method'),
'RefNo' => $RefNo,
'Amount' => $Amount,
'Currency' => $Currency,
'UserName' => $this->session->userdata('billing_first_name'),
'UserEmail' => $this->session->userdata('email'),
'UserContact' => $this->session->userdata('billing_mobile'),
'Lang' => 'UTF-8',
'Signature' => $Signature,
'ResponseURL' => site_url() . '/order/payment_response'
);

$this->load->library('Curl');
$this->curl->create($PaymentRequestURL);
$this->curl->option(CURLOPT_REFERER, site_url() . '/order/review_order/');
$this->curl->option(CURLOPT_FOLLOWLOCATION, 1);
$this->curl->post($postdata);
echo $this->curl->execute();

I used the cURL library for CI written by Philip Sturgeon. The above codes POST to payment request page sucessfully, it accepts all the parameters, but when I take a look at the browser URL, the page stuck at my Controller, and does not redirected to payment gateway page completely. This resulting missing images and validation scripts (Firebug shown the browser tries to load all the assets from my site, in fact those assets should come from payment gateway server).

I searched for cURL redirect problem and found this link, http://www.phpbuilder.com/board/showthre...t=10299554. The user and I is having the same problem.

How do I fix the code so it redirected to payment request page completely?

Many thanks.


Messages In This Thread
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-22-2011, 10:17 PM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-22-2011, 10:54 PM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-22-2011, 11:14 PM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-23-2011, 12:21 AM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-23-2011, 12:30 AM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-23-2011, 12:51 AM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-23-2011, 08:31 AM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-24-2011, 01:12 AM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-24-2011, 09:41 PM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-24-2011, 10:17 PM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-24-2011, 10:59 PM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-24-2011, 11:02 PM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-25-2011, 12:52 AM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-25-2011, 01:38 AM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-25-2011, 08:24 AM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-25-2011, 08:31 PM
HTTP POST from Controller, NOT from HTML Form - by El Forum - 04-26-2011, 07:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB