How to capture a server response that comes straight to the browser window? - response

This form posts a transaction, and the server response comes straight back to the browser window as a newline-delimited string.
How do I capture the server response?
The form button:
https://www.calligraphydallas.com/stuff/AGI-newline.html
The form code (just save as html, launch it and submit it to see the behavior)
<html>
<form method='Post' action= 'https://www.paymentsgateway.net/cgi-bin/posttest.pl'>
<input type='hidden' name='pg_merchant_id' value='191620'/>
<input type='hidden' name='pg_password' value='PASSWORD02'/>
<input type='hidden' name='pg_transaction_type' value='10'/>
<input type='hidden' name='pg_total_amount' value='11.11'/>
<input type='hidden' name='ecom_payment_card_type' value='visa'/>
<input type='hidden' name='ecom_payment_card_name' value='James D Ivey'/>
<input type='hidden' name='ecom_payment_card_number' value='4111111111111111'/>
<input type='hidden' name='ecom_payment_card_expdate_month' value='08'/>
<input type='hidden' name='ecom_payment_card_expdate_year' value='2020'/>
<input type='hidden' name='ecom_payment_card_verification' value='123'/>
<input type='hidden' name='ecom_billto_postal_name_first' value='Forte'/>
<input type='hidden' name='ecom_billto_postal_name_last' value='Test'/>
<input type='hidden' name='ecom_billto_postal_street_line1' value='500 W Bethany Dr'/>
<input type='hidden' name='ecom_billto_postal_street_line2' value='Suite 200'/>
<input type='hidden' name='ecom_billto_postal_city' value='Allen'/>
<input type='hidden' name='ecom_billto_postal_stateprov' value='TX'/>
<input type='hidden' name='ecom_billto_postal_postalcode' value='75013'/>
<input type='submit' value='Pay Now'/>
</form>
</html>

Have you tried using Fiddler ?

Related

How to submit form with dynamical added textbox in div MVC.?

How to submit form with dynamical added texbox in div MVC.
Hi,
I want to submit a form which a textbox (full name),age ,(Phone no,phonenotype)
User can add n no. of phone no,phonetype eg.
Name -michale
age- 27
Phone:989878767 phonetype - mobile
Phone 022787656 phonetype- office
I want to submit this form to save the data in the database.
But in formcollection phone,phonetype is coming as separate array .
Hence unable to find which phone no. is mobile or office.
A dirty way:
use a name concatenated with a number:
<body> <div id="listPhones">
<div>
<input type="text" name="phone00"/><input type="text" name="phonetype00"/>
</div>
</div>
<bouton onclick="addPhone()">More</bouton>
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.3.min.js"> </script>
<script type="text/javascript">
function addPhone() {
var nbr_phone = $("#listPhones").children().length;
$("#listPhones").append("<div><input type='text' name='phone" + nbr_phone + "'/><input type='text' name='phonetype"+ nbr_phone + "'/></div>"); } </script>
</body>
How are you constructing the payload you're submitting?
You can POST JSON - e.g.
{"name":"foo", "age":"123", "phone":[{"type":"mobile", "no":"12345"}, {"type":"home", "no":"345678"}]}
If you're building <input />s, then something like this:
<ul>
<li>Name: <input type="text" name="name" /></li>
<li>Age: <input type="text" name="age" /></li>
<li>Phone type:
<input type="radio" name="phone[0][type]" value="mobile" /> Mobile
<input type="radio" name="phone[0][type]" value="home" /> Home
</li>
<li>Phone: <input type="text" name="phone[0][no]" /></li>
<li>Phone type:
<input type="radio" name="phone[1][type]" value="mobile" /> Mobile
<input type="radio" name="phone[1][type]" value="home" /> Home
</li>
<li>Phone: <input type="text" name="phone[1][no]" /></li>
</ul>
<input type="submit" value="go" />
Hth.

How do I set the 'Description' with PayPal's 'Buy Now' button?

I have this image where I can set the Amount but I cannot set the Description:
<form action="https://www.paypal.com/cgi-bin/webscr"
method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="moneytreelondon#gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="button_subtype" value="services">
<input id="total_price_and_postage_rate" type="hidden"
name="amount" value<%=r.total_price_and_postage_rate_no_commission%>">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn"
value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
<input type="image" src="" border="0" name="submit" alt="Refund">
<img alt="" [enter image description here][1]border="0"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif"
width="1" height="1">
</form>
How do I set the 'Descriptions'?
You may set the descriptions with this form tag
<input type="hidden" name="item_name" value="Your Desc">
Omitting the item_name and amount tags will let your customers make manual inputs in the PayPal checkout page

Why does "<input id='id' type=text name='id' value='H123'>" not get "POST"ed by FormData

When I submit the following form
<form name="fileUpload" id="fileUpload" method="post" action="javascript:void(0);" enctype="multipart/form-data">
<input id='id' type=text name='id' value='H123'>
<div class="file_browser">
<input type="file" name="multiple_files[]" id="_multiple_files" class="hide_broswe" multiple />
</div>
<div class="file_upload">
<input type="submit" value="Upload" class="upload_button" />
</div>
</form>
The files[] get uploaded OK but input "#id" is not in the $_POST array.
I need it because I want to pass the name of the directory that the images are to be stored in.
I notice that you are missing quotation marks around 'text' in
<input id='id' type=text name='id' value='H123'>
Which should be:
<input id='id' type='text' name='id' value='H123'>
Besides that I can't see any obvious reason why it shouldn't work.

Paypal automatic redirect to Store Vendor

I made a e-commerce which handles payments by Paypal, the flow works good although there is a boring thing, when the user finish to pay, to go back to the StoreWebSite has to click to the button which was provided by PayPal page.
there is anyway to make that operation automatic?
there is any flag I can set to force paypal redirect to my StoreWebSite when the user finish to pay?
basically I do that
Basically I do the following:
<html ng-app>
<body data-ng-controller="testController">
<form id="Checkpay" name="Checkpay" style="margin: 0" method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" target="_blank" class="ng-pristine ng-valid">
<input type="hidden" id="return_url" name="return_url" value="">
<input type="hidden" name="quantita" id="qtytext" value="0">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="Le Spose di Nika">
<input type="hidden" name="business" value="TEST#TEST.it">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="cancel_return" id="cancel_return" value="">
<input type="hidden" name="return" id="return" value="">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" id="H_amount" name="amount" value="719.80">
<input type="hidden" id="H_first_name" name="first_name">
<input type="hidden" id="H_address1" name="address1">
<input type="hidden" id="H_city" name="city">
<input type="hidden" id="H_state" name="state">
<input type="hidden" id="H_zip" name="zip">
<input type="hidden" id="H_email" name="email">
<input type="hidden" id="Country" name="country">
<input type="hidden" id="charset" name="charset" value="utf8">
<input type="hidden" id="rm" name="rm" value="2">
<input type="hidden" id="notify_url" name="notify_url" value="">
<input id="Submit1" type="submit" value="submit_post" />
</form>
<input id="Submit2" type="button" data-ng-click='pay()' value="js_post" />
</body>
</html>
<script src="http://localhost:27433/Scripts/jquery-1.7.1.min.js"></script>
<script src="http://localhost:27433/Scripts/jquery-ui-1.8.20.min.js"></script>
<script src="http://localhost:27433/Scripts/angular.js"></script>
<script>
function test() {
}
function testController($scope, $http) {
var URL = "http://backend.MYSITE.com/";
$scope.payTest = function () {
var PAYPAL_URL_RELEASE = "https://www.paypal.com/cgi-bin/webscr";
$('#return_url').val(URL);
$('#cancel_return').val(URL + '/ErrorPay');
$('#return').val(URL + '/Success');
$('#notify_url').val(URL + '/PayPalReceiverIPN.ashx?idOrder=');
document.forms["Checkpay"].action = PAYPAL_URL_RELEASE;
document.forms["Checkpay"].submit();
}
}
</script>
return_url
The URL to which the sender's browser is redirected after approving a payment on paypal.com.
You can find it here

JamboPay and Rails Integration

I have JamboPay api that i want to integrate with my rails application. It looks something like this;
<form method="post" action="https://www.jambopay.com/JPExpress.aspx" target="_blank">
<input type="hidden" name="jp_item_type" value="cart"/>
<input type="hidden" name="jp_item_name" value="test shop"/>
<input type="hidden" name="order_id" value="455879"/>
<input type="hidden" name="jp_business" value="business#yourdomain.com"/>
<input type="hidden" name="jp_amount_1" value="51"/>
<input type="hidden" name="jp_amount_2" value="0"/>
<input type="hidden" name="jp_amount_5" value="0"/>
<input type="hidden" name="jp_payee" value="email#yourcustomer.com"/>
<input type="hidden" name="jp_shipping" value="company name"/>
<input type="hidden" name="jp_rurl" value="http://www.yourwebsite.com/testpost/Result.aspx?ii=0"/>
<input type="hidden" name="jp_furl" value="http://www.yourwebsite.com/testpost/Result.aspx?ii=1"/>
<input type="hidden" name="jp_curl" value="http://www.yourwebsite.com/testpost/Result.aspx?ii=2"/>
<input type="image" src="https://www.jambopay.com/jambohelp/jambo/rsc/paymentsbyJamboPay.jpg"/>
</form>
I want to be able to send this information from my transactions controller in the create method.
Any ideas how i can pass this form from my controllers because i keep the same form for all payment methods in the views.
Thank you in advance.
You can send this post request using Net::HTTP library all you have to do is to send this information to your controller action and then send post request from action.

Resources