I have website that has page for donation. Merchants registered on the Gateway are to send transaction requests to GTPay via HTTP Post to URLhttps://ibank.gtbank.com/GTPay/Tranx.aspx When I submit my request I see this page of the above URL displayed inside my donation page instead of taking me to the URL Below is my code: $url ='https://ibank.gtbank.com/GTPay/Tranx.aspx'; $fields = array('gtpay_mert_id'=> urlencode($gtpay_mert_id),'gtpay_tranx_id'=> urlencode($gtpay_tranx_id),'gtpay_tranx_amt'=> urlencode($gtpay_tranx_amt),'gtpay_tranx_curr'=> urlencode($gtpay_tranx_curr),'gtpay_cust_id'=> urlencode($gtpay_cust_id),'gtpay_tranx_noti_url'=> urlencode($gtpay_tranx_noti_url),'gtpay_hash'=> urlencode($gtpay_hash)); //url-ify the data for the POSTforeach($fields as $key=>$value){ $fields_string .= $key.'='.$value.'&';} rtrim($fields_string,'&'); $form_files=array(); $form_options=array('cookies'=> array('auth'=> $auth )); http_post_fields($url, $fields, $form_files, $form_options);//open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POST, count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); //execute post $result = curl_exec($ch); //close connection curl_close($ch); Note: The donation amount entered is to be multiplied by 100 and the value of the parameter gtpay_hash(a hidden field in the form) to be submitted is supposed to be sha512 of a concatenation of the values of the following parameters of the form. gtpay_mert_id,gtpay_tranx_id,gtpay_tranx_amt,gtpay_tranx_curr,gtpay_cust_id,gtpay_tranx_noti_url,hashkey. How do I get the values entered in the form, perform the hash on those values and assign to the hidden parameter and submit to the url along with the other values entered in the form?
Can you link to the documentation provided by gtbank? Also, are you responsible for paying a fee if there's a disputed transaction and there's a chargeback? If so, it might be safer if you use a service where you don't have to worry about these things (I think doing donations through paypal may be one such service, but I'm not completely sure). Otherwise, you're open to fraudsters who use your site to test a bunch of stolen credit cards, and you pay a chargeback on each successful transaction that is later disputed. https://www.reddit.com/r/startups/comments/3lehge/what_i_learned_about_chargebacks_after_getting/
Sorry, I typed the initial link in error Below is the correct link https://ibank.gtbank.com/gtpay/integrationapi/mman-tech.html
If I'm reading this right, then your visitor is supposed to make the POST request with their browser, not you on the backend. On the gtbank page, you can see an example form. Put that form somewhere on your page, and relabel the 'submit' button to 'donate' or whatever you like. You won't need the javascript inside the body tag. When someone clicks on the button in their browser, it should take them to the gtbank page to complete the transaction.