Create URL Query String to accept Terms & Conditions - asp.net

I am building a script that is downloading a zip file and placing it on my desktop. The script works fine except the link to the zip file is taking me to a terms and condition site in order to download it.
I have the below form:
<form action="https://powhatan.iiie.disa.mil/TOUbanneraccept.asp">
<input name="HTTP_REFERER" type="hidden" value="http://iase.disa.mil/stigs/compilations/Pages/index.aspx">
<input name="HTTP_HOST" type="hidden" value="powhatan.iiie.disa.mil">
<input name="SERVER_NAME" type="hidden" value="powhatan.iiie.disa.mil">
<input name="URL" type="hidden" value="/TOUbanner.asp">
<input name="SCRIPT_NAME" type="hidden" value="/TOUbanner.asp">
<input name="PATH_INFO" type="hidden" value="/TOUbanner.asp">
<input name="Destination" type="hidden" value="">
<input name="OriginalURL" type="hidden" value="https://powhatan.iiie.disa.mil/stigs/downloads/zip/FOUO_SRG-STIG_Library_2017_04.zip">
<input name="RewriteURL" type="hidden" value="">
<input name="Accept" style="width: 150px;" type="submit" value="I ACCEPT">
</form>
I am trying to create a query string to accept the webpage terms so that my download will continue but my query string is not working. From what i researched I came up with:
https://powhatan.iiie.disa.mil/TOUbanneraccept.asp/?HTTP_REFERER=http://iase.disa.mil/stigs/compilations/Pages/index.aspx&HTTP_HOST=powhatan.iiie.disa.mil&SERVER_NAME=powhatan.iiie.disa.mil&URL=/TOUbanner.asp&SCRIPT_NAME=/TOUbanner.asp&OriginalURL=https://powhatan.iiie.disa.mil/stigs/downloads/zip/FOUO_SRG-STIG_Library_2017_04.zip&Accept=I%20ACCEPT
I even tried
https://powhatan.iiie.disa.mil/TOUbanneraccept.asp?Accept=I%20ACCEPT
When I try either one I get a Error 404 page as if the page does not exist. I have to do this because it will be included in a VBA macro.
Can anyone tell me what I am doing wrong or what may going on here?

Related

Paypal IPN not retrieving variables

I have a Paypal account with set subscription button on it. After a subscription is set by a buyer I am sending him to a receipt page. On this page I need to retrieve variables from Paypal to update by database.
form is working
subscription saved on Paypal
buyer correctly redirected to receipt page
but variable are not retrieved.
here is what I have tried so far:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="mybusinessname">
<input type="hidden" name="lc" value="IE">
<input type="hidden" name="item_name" value="Monthly Subscription">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="a1" value="0.00">
<input type="hidden" name="p1" value="1">
<input type="hidden" name="t1" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="a3" value="1.50">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHosted">
<input type="hidden" name="custom" value="test_value">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Instant Payment Notification (IPN) details on Paypal are enabled and point to:
https://www.mydomain/payments/
IPN history shows that notifications from Paypal are correctly sent to Notification URL (above)
However, the receipt page shows
Error
Undefined index: custom
to get the custom variable I tried GET, POST and even REQUEST method using something like
test 1: <?php echo $_GET["custom"]; ?>
test 2: <?php echo $_POST["custom"]; ?>
Then I tried
<?php
if (isset($_POST['custom'])) {
$custom_display = $_POST['custom'];
}
?>
but this results in: Undefined variable: custom_display
All I need is to get custom variable.
I am guessing that I am doing something wrong, but after many hours of searching for an answer and trying different settings (e.g. sending dynamically notification url within the form, changing settings in paypal, using different urls etc) nothing seems to be working for me and I am stuck
Any help would be greatly appreciated!
I ran into the same issue (?) a few months back. The answer seems to be: PayPal does not pass custom in IPN anymore (nor does it honor the return value). Both of these stopped working sometime last year.
My workaround was to use the subscr_id value to lookup the customer profile. YMMV.

Paypal integration questions

I have some code that i wrote many years ago to integrate Paypal within my site. So a user adds multiple products to their cart and then checks out which then automatically takes the user to the paypal site.
I decided to revisit it today and created the following HTML
<form name="myForm" method="POST" action="https://www.sandbox.paypal.com/cgi-bin/webscr" >
<input type="hidden" name="cmd" value="_cart"/>
<input type="hidden" name="business" value="myemail-facilitator#myDomain.com"/>
<input type="hidden" name="item_name" value="Product 1"/>
<input type="hidden" name="amount" value="500.00"/>
<input type="hidden" name="quantity" value="1"/>
<input type="hidden" name="upload" value="1"/>
<input type="hidden" name="currency_code" value="GBP"/>
<input type="hidden" name="return" value="http://XX/paypal/completed.aspx"/>
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cancel_return" value="http://XX/paypal/Cancel.aspx"/>
<input type="hidden" name="shopping_url" value="http://XX/paypal/MyShop"/>
<input type="hidden" name="notify_url" value="http://XX/paypal/MyShop/checkout.aspx"/>
<input type="hidden" name="lc" value="GB"/>
<input type="hidden" name="image_url" value="http://XX/paypal/shop.gif"/>
<input type="hidden" name="no_note" value="1"/>
<input type="hidden" name="invoice" value="ZZZ1234567890"/>
<script type="text/javascript">document.myForm.submit();</script></form>
This came up with an error "Error Detected Your shopping cart is empty".
Logged into my sandbox account and no error listed to determine what ive done wrong.
Googled around which suggested to change _cart to _xclick - which resolved the issue, however when i read the documentation at
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
I dont understand why _cart didnt work? Is there a more appropriate way to do this or _xclick fine with my site setup as described above?
For multiple items i was looping the item_name and amount and adding each value, but this doesnt work the way i expected i.e. I've seen sites where they display each product, quantity and amount for each product in the cart and then total - where did i go wrong?
Finally once a transaction is complete i have set up the IPN value to send the details to my site..... Do i need the site to be using https in order for this to work or would http work?
I tried searching for these answers but some are quite dated or using 3rd part components.
Please make below changes to your HTML codes to make your form work again.
<input type="hidden" name="item_name" value="Product 1"/>
<input type="hidden" name="amount" value="500.00"/>
<input type="hidden" name="quantity" value="1"/>
↓↓
<input type="hidden" name="item_name_1" value="Product 1"/>
<input type="hidden" name="amount_1" value="500.00"/>
<input type="hidden" name="quantity_1" value="1"/>

display external webpage inside shiny through a POST request

I am trying to put a button on my shiny app which calls out external website though a form/post request. The input values will change but here is a real example.
Example:
<form action="http://toppgene.cchmc.org/CheckInput.action" method="post">
<input type="hidden" name="query" value="TOPPFUN">
<input type="hidden" id="type" name="type" value="HGNC">
<input type="hidden" name="training_set" id="training_set" value="EGFR">
<input type="submit" class="mybutton">
</form>
PS: cross posted on shiny-discuss google group link
Thanks!
-Abhi

Sending form data to another websites form

I am trying to incorporate a reservation widget within my wordpress install and I have everything working fine except sending the data or it not populating on the other sites form. The site I am trying to send data to is an online reservation software: http://www.directinn.com/demo/
Here is how I am doing my form:
<form name="bookingform" action="http://www.directinn.com/demo" method="get" target="_blank">
<input type="text" name="date1" id="Text1" class="ftxt MyDate three columns" maxlength="10" value="" placeholder="Arrival Date"/>
<input type="text" name="date2" id="Text2" class="ftxt MyDate three columns" maxlength="10" value="" placeholder="Departure Date" />
<input type="submit" name="bookingformsubmit" class="book-now" value="Book Now">
<input type="hidden" name="arrivalDay" value="" />
<input type="hidden" name="arrivalMonth" value="" />
<input type="hidden" name="arrivalYear" value="" />
<input type="hidden" name="departureDay" value="" />
<input type="hidden" name="departureMonth" value="" />
<input type="hidden" name="departureYear" value="" />
<input type="hidden" name="numAdults" value="1" />
Any help would be greatly appreciated ;)
So they are saying if you can iFrame in their Form on your page and if you add the USERNAME for example to the URL, your USERNAME will appear on the invoice. Like this I believe:
http://www.directinn.com/iframefull.html/BOB
I do not think you can make your own form and POST to their page. I see no indication that that is possible from the link you posted of the example.
The code you have will submit a load of Query String data to the receiving site.
The target site may implement some type of cross-site posting prevention which is causing the blockage - or they may ignore your query string parameters entirely.

Paypal integration problem

I am having problem in integrating paypal IPN.I am implementing this code but it is not returning me the values to IPN
My form that is made after executing the code is as follow
<form method="post" name="paypal_form" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cmd" value="_cart"/>
<input type="hidden" name="business" value="info#something.com"/>
<input type="hidden" name="return" value="http://abc.com/test.php?action=success"/>
<input type="hidden" name="cancel_return" value="http://abc.com/test.php?action=cancel"/>
<input type="hidden" name="notify_url" value="http://abc.com/test.php?action=ipn"/>
<input type="hidden" name="item_name_1" value="Adob photoshop"/>
<input type="hidden" name="item_number_1" value="10"/>
<input type="hidden" name="amount_1" value="15"/>
<input type="hidden" name="upload" value="1"/>
<input type="hidden" name="cn" value="1"/>
<input type="hidden" name="tx" value="TransactionID"/>
<input type="hidden" name="currency_code" value="USD"/>
<input type="hidden" name="no_shipping" value="1"/>
<center><br/><br/>If you are not automatically redirected to paypal within 5 seconds...<br/><br/>
<input type="submit" value="Click Here"></center>
</form>
The problem is that the code is working fine for the return and cancel part but when I use this code for IPN it does not give me any value.My code for the IPN is as under
if ($pay->validate_ipn()) {
//do the insertion I have tested this insertion it is working fine
}
Have a look at History > IPN History inside your PayPal account. This should show the status of the IPN messages that were sent to you. Click on the message ID if you wish to find out more detailed information.
If it's retrying, double-check your error logs and ensure it's returning a proper HTTP/1.1 200 OK response when accessed by the PayPal IPN service (notify.paypal.com).

Resources