Use Cordova InAppBrowser in form POST method - vue.js

I am developing an application in VUEJS using quasar framework to develop IOS/ANDROID app.
I want to open external webpage in my cordova application.
I have following form that i am using to post data to external payment gateway.
<form action="https://myUrl.com" method="post" id="myForm">
<input type="hidden" name="MERCHANTID" v-model="paymentDataPost.MERCHANTID" >
<input type="hidden" name="APPID" v-model="paymentDataPost.APPID" />
<input type="hidden" name="APPNAME" v-model="paymentDataPost.APPNAME"/>
<input type="hidden" name="TXNID" v-model="paymentDataPost.TXNID"/>
<input type="hidden" name="TXNDATE" v-model="paymentDataPost.TXNDATE"/>
<input type="hidden" name="TXNCRNCY" v-model="paymentDataPost.TXNCRNCY"/>
<input type="hidden" name="TXNAMT" v-model="paymentDataPost.TXNAMT"/>
<input type="hidden" name="REFERENCEID" v-model="paymentDataPost.REFERENCEID"/>
<input type="hidden" name="REMARKS" v-model="paymentDataPost.REMARKS"/>
<input type="hidden" name="PARTICULARS" v-model="paymentDataPost.PARTICULARS"/>
<input type="hidden" name="TOKEN" v-model="paymentDataPost.TOKEN"/>
<br>
</form>
And I was submitting this form in my methods after confirmation.
document.getElementById('myForm').submit()
This code works fine in web browser. When I tested my application in IOS platform, external website was not opening from my application.
So, I did some research and got to know about cordova-plugin-inappbrowser. Then I changed my above code to below one.
methods: {
async confirm () {
var myForm = '<form action="https://uat.connectips.com:7443/connectipswebgw/loginpage" method="post" id="myForm">' +
'<input type="hidden" name="MERCHANTID" v-model="paymentDataPost.MERCHANTID" >' +
'<input type="hidden" name="APPID" v-model="paymentDataPost.APPID" />' +
'<input type="hidden" name="APPNAME" v-model="paymentDataPost.APPNAME"/>' +
'<input type="hidden" name="TXNID" v-model="paymentDataPost.TXNID"/>' +
'<input type="hidden" name="TXNDATE" v-model="paymentDataPost.TXNDATE"/>' +
'<input type="hidden" name="TXNCRNCY" v-model="paymentDataPost.TXNCRNCY"/>' +
'<input type="hidden" name="TXNAMT" v-model="paymentDataPost.TXNAMT"/>' +
'<input type="hidden" name="REFERENCEID" v-model="paymentDataPost.REFERENCEID"/>' +
'<input type="hidden" name="REMARKS" v-model="paymentDataPost.REMARKS"/>' +
'<input type="hidden" name="PARTICULARS" v-model="paymentDataPost.PARTICULARS"/>' +
'<input type="hidden" name="TOKEN" v-model="paymentDataPost.TOKEN"/>' +
'<br>' +
'</form>' +
'<script type="text/javascript">document.getElementById("myForm").submit()<script/>'
var pageContentUrl = 'data:text/html;base64,' + btoa(myForm)
window.open(pageContentUrl,
'_blank',
'hidden=no,location=no,clearsessioncache=yes,clearcache=yes'
)
}
}
New window opens, but url is blank, and post data is not available as well.
Any help is very much appreciated.
Regards,

Related

Skrill: What is correct way to create recurring billing profile in Skrill

I am trying to generate a recurring payment using our test accounts and I am getting response on status url as well which is mentioned below.
Implemented as per Instructions which are mentioned on page number: 12 & 35
Here is the code which we are posting to Skrill:
<form action="https://pay.skrill.com" target="_blank" class="skrill-form">
<input type="hidden" name="pay_to_email" value="email#gmail.com">
<input type="hidden" name="currency" value="EUR">
<input type="hidden" name="return_url" value="http://domain/dev-test-page-2/">
<input type="hidden" name="return_url_text" value="Return to main website">
<input type="hidden" name="return_url_target" value="4">
<input type="hidden" name="cancel_url" value="http://domain/dev-test-page-2/">
<input type="hidden" name="cancel_url_target" value="4">
<input type="hidden" name="status_url"
value="http://domain/wp-admin/admin-ajax.php?action=skrill_response">
<input type="hidden" name="status_url2" value="mailto:email#gamil.com">
<input type="hidden" name="logo_url" value="https://domain/wp-content/uploads/2018/07/logo.png">
<input type="hidden" name="rec_amount" value="2">
<input type="hidden" name="rec_start_date" value="17/01/2019">
<input type="hidden" name="rec_end_date" value="27/01/2019">
<input type="hidden" name="rec_period" value="2">
<input type="hidden" name="rec_cycle" value="day">
<input type="hidden" name="rec_grace_period" value="2">
<input type="hidden" name="rec_status_url"
value="http://domain/wp-admin/admin-ajax.php?action=skrill_rec_status_url">
<input type="hidden" name="rec_status_url2"
value="http://domain/wp-admin/admin-ajax.php?action=skrill_rec_status_url">
<input type="text" name="amount" value="1">
<input type="submit" value="Pay" class="btn">
</form>
Response:
[action] => skrill_response
[transaction_id] => 2605308006
[mb_amount] => 39
[amount] => 39
[md5sig] => 72EE69AA174B377A6E488129CA4F5063
[merchant_id] => 111682769
[payment_type] => WLT
[mb_transaction_id] => 2605308006
[mb_currency] => EUR
[pay_from_email] => email#gmail.com
[pay_to_email] => email#gmail.com
[currency] => EUR
[customer_id] => 111683528
[status] => 2
We are not getting any response on rec_status_url. Further, we have also tried to access the recurring transaction status of above test transaction as per mentioned instructions in PDF in return I received an email that my account temporarily locked.
Am I skipping some of essential parameters?
Query string as per instructions to access the status of a recursion:
https://www.skrill.com/app/query.pl?action=status_rec&email=email#gmail.com&password=123456&trn_id=2605308006
Response:
401 Your account is currently locked. Please contact our Merchant Team at:merchantservices#skrill.com
Implemented as per Instructions which are mentioned on page number: 30
Have you solved your issue?
Most probably you merchant account is not enabled from Skrill's side to receive recurring payments. Please ask their support to enable it for you.
Also i would highly recommend you to user server-to-server request to generate 'session' for your payments, not leaving your payment parameters/data on the user's front-end(html form).
As far as i am aware about rec_status_url, it should be called only in when customer was subscribed and there was at least one sub/recurring payment, then if he cancels the plan, you should receive correct http post message.
About query.pl?action=status_rec - all MQI/API queries should contain your MQI/API password as md5 hash value - not plain text password.
Make sure that "MQI" service is enabled for your account(My Account->Settings->Developer Settings)
Cheers,

How to Integrate PayUMoney payment gateway with Angular2/4/5

i am working with angular5 , i need to integrate PayUMoney payment gateway in my application , for that i added following form and test with "https://test.payu.in/_payment" domain.
Error :
Error Reason Transaction failed due to incorrectly calculated hash
parameter.
Corrective Action Please ensure that the hash used in transaction
request is calculated using the correct formula. Please note the
correct formula for calculating the value of hash:
sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT)
Based on above formula and applying for this transaction, hash should
be calculated as mentioned below : hash =
sha512(gtKFFx|ba7816bf8f01cfea414140de5da|500|merit application
fees|bhagvat lande|landebm#gmail.com|||||||||||eCwWELxi) = Array
As seen above, correct hash value should have been - Array
But the hash posted in the transaction request from your end was -
e95bd46ce3cf4b3c32a63ba5f51934ef8506e0e47027512f41bff125be02cd14
My Component with Form
<form #f method="post" id="payu-payment-form" action="https://test.payu.in/_payment">
<input type="hidden" name="hash" value="e95bd46ce3cf4b3c32a63ba5f51934ef8506e0e47027512f41bff125be02cd14"/>
<input type="hidden" name="key" value="gtKFFx" />
<input type="hidden" name="txnid" value="ba7816bf8f01cfea414140de5da" />
<input type="hidden" name="amount" value="500" />
<input type="hidden" name="productinfo" value="merit application fees" />
<input type="hidden" name="firstname" value="bhagvat lande" />
<input type="hidden" name="email" value="******#gmail.com" />
<input type="hidden" name="phone" value="+91**********" />
<input type="hidden" name="surl" value="http://localhost:4200/#/payment/payment-success" />
<input type="hidden" name="furl" value="http://localhost:4200/#/payment/payment-error" />
<input type="hidden" name="service_provider" value="" />
<button class="btn btn-info" type="submit" (click)="f.submit()" value="submit" formtarget="_blank"> <i class="fa fa-money"></i> Proceed To Pay</button>
</form>
in above form i just generate one dummy hash key(SHA-256) and put their.
Questions :
how to integrate PayUmoney payment gateway in ANgular2/4/5 ?
they provided formula on their documentation for generation hash key , it tooks all other forms fields and generate hash key (SHA-256) , is their any way to create hash key at client side and how to use that ?
thanks

php how to doing continuously processing

I have a form that will processing input.how to make it run continuos after i just click submit once?
I want to know the method.
say i have the code :
<form name="form1" action="" method="post">
<input type="text" name="tfcari" />
<input type="submit" name="btcari" />
</form>
<?php
if (isset($_POST['btcari'])) {
get(..);
?>
Thanks.

How to test payment using Nochex Payment gateway in Alibaba B2B trader script?

I have problem in Nochex payment gateway with test payment in teswting mode.
I have set following details but not working.
echo '<form action="https://www.nochex.com/nochex.dll/checkout" name="form1" id="frm1" method="post"><input type="hidden" name="email" value="'.$rowsettings['nochex'].'">';
echo '<input type="hidden" name="amount" value="'.$rowsettings['goldmemberfee'].'">';
echo '<input type="hidden" name="ordernumber" value="'.$_SESSION['SellerID'].'">';
echo '<input type="hidden" name="description" value="Gold Member Update for '.$_SESSION['BusinessEmail'].'">';
echo '<input type="hidden" name ="test_transaction" value="100">';
echo '<input type="hidden" name ="test_success_url" value= "successurl">';
echo "<input type='hidden' name='returnurl' value='".$rowsettings['url']."/goldmember.php?ncid=".$_SESSION['SellerID']."'>";
echo "<input type='hidden' name='cancelurl' value='".$rowsettings['url']."/fail.php'>";
echo ".";
thanks.
You're using the old version of the Nochex Checkout, it'll still work, but isn't best practice. This document will show you how to upgrade to the new Payments Page system:
https://esupport.nochex.com/index.php?_m=downloads&_a=viewdownload&downloaditemid=4&nav=0,12
It's basically a case of changing the address that the form posts to and the names of some of the variables.
Your new form should look like this:
echo '<form method="POST" action="https://secure.nochex.com" name="form1" id="frm1">';
echo '<input type="hidden" name="merchant_id" value="'.$rowsettings['nochex'].'">';
echo '<input type="hidden" name="amount" value="'.$rowsettings['goldmemberfee'].'">';
echo '<input type="hidden" name="order_id" value="'.$_SESSION['SellerID'].'">';
echo '<input type="hidden" name="description" value="Gold Member Update for '.$_SESSION['BusinessEmail'].'">';
echo '<input type="hidden" name="test_transaction" value="100">';
echo '<input type="hidden" name="test_success_url" value= "successurl">';
echo '<input type='hidden' name='success_url' value='".$rowsettings['url']."/goldmember.php?ncid=".$_SESSION['SellerID']."'>';
echo '<input type='hidden' name='cancel_url' value='".$rowsettings['url']."/fail.php'>';
echo '</form>';

Logging into a website using Mechanize and Nokogiri?

I am having some difficulty with one of our service providers login forms. The other sites are working fine but for some reason I can't get past their login form.
The website login for is like this:
<form accept-charset="UTF-8" action="/sessions" class="new_user_session" id="new_user_session" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="kaLEkPesQfeheronzGTdfnVAzpuUiC+VmjVXBu540n8=" /></div>
<fieldset class="big">
<div class="form-row">
<div class="form-label">
<label for="user_session_email">Email</label>
</div>
<div class="form-field">
<input id="user_session_email" name="user_session[email]" size="30" type="text" />
</div>
</div>
<div class="form-row">
<div class="form-label">
<label for="user_session_password">Password</label>
</div>
<div class="form-field">
<input id="user_session_password" name="user_session[password]" size="30" type="password" />
</div>
<div class="form-comment"><p>Forgot your password?</p></div>
</div>
<div class="form-row optional">
<div class="form-field">
<label for="user_session_remember_me"><input name="user_session[remember_me]" type="hidden" value="0" /><input id="user_session_remember_me" name="user_session[remember_me]" type="checkbox" value="1" /> Remember me for 2 weeks</label>
</div>
</div>
</fieldset>
I have tried to login using the same code as other the other sites but it doesn't work.
# Create a new mechanize object
agent = Mechanize.new
# Load the dial9 website
page = agent.get("http://webapplication.co.uk")
# Select the first form
form = agent.page.forms.first
form.username = 'username
form.password = 'password'
# Submit the form
page = form.submit form.buttons.first
I have also tried a different way of logging in as suggested in other SO questions/answers:
email = 'user#domain.com'
password = 'password
# Create a new mechanize object
agent = Mechanize.new
# Load the postmarkapp website
page = agent.get("https://domain.com")
# Select the first form
form = agent.page.forms.first
form.field_with(:email => "user_session_email").value = email
form.field_with(:password => "user_session_password").value = password
# Submit the form
page = form.submit form.buttons.first
Using this method of authentication I get the following output when running the rake task:
undefined method `email' for [hidden:0x3fef2ab2b994 type: hidden name: utf8 value: ✓]:Mechanize::Form::Hidden
Upon closer inspection the above error seems to be due to the fact that there is a field immediately after the form is started:
<form accept-charset="UTF-8" action="/sessions" class="new_user_session" id="new_user_session" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="kaLEkPesQfeheronzGTdfnVAzpuUiC+VmjVXBu540n8=" /></div>
Am I missing something? If so, what? Any pointers are appreciated!
Try changing
form.field_with(:email => "user_session_email").value = email
form.field_with(:password => "user_session_password").value = password
to
form.field_with(:name => "user_session[email]").value = email
form.field_with(:name => "user_session[password]").value = password