Hi I have an App developed in Ionic v1 and its working fine while making payment from browser , but while making payment from device Android its not redirecting me to the payment gateway page.
https://test.sbiepay.com/secure/AggregatorHostedListener
The payment gateway team said that I need to pass extra header that is Referer in case of Android device then only they will allow the request from android device.
I did every trick to add extra header in case of device but nothing is working.
Can anybody help me in this how could I send extra header with request to payment gateway, in case of android device.
<form name="sendParam" method="post"
action="https://test.sbiepay.com/secure/AggregatorHostedListener">
<input ng-repeat="(key, value) in fields" type="hidden"
name="{{key}}" value="{{value}}" />
<input type="submit" value="enter" style="position:
absolute; left: -9999px"/>
</form>
Above form submit using js. In case of web these header added automatically.
var fields = {
EncryptTrans: response.data.data.EncryptTrans,
merchIdVal: appConfig.merchIdVal
};
if (appConfig.isDevice) {//Device
console.log('Run in device');
$http.defaults.headers.post['Referer'] =
"http://app.ptl.staging.edubold.com/";
$http.defaults.headers.post['Origin'] =
"http://app.ptl.staging.edubold.com/";
openInAppBrowser(fields);
}
Instead of doing this, You need to use ajax.
Get all the response and save in db using ajax in the same file. Then using callback method fetch the data directly from db.
You cannot set origin header using HTML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With