I'm testing cardstream payment gateway with sandbox details. I tried to change redirectURL. when I change it I got below error. if I keep it with "https://www.merchant.com/payment/" , it is working.
<html>
<head>
<script src="https://gateway.cardstream.com/sdk/web/v1/js/hostedforms.min.js"></script>
</head>
<body>
<form name="payment-form" method="post" action="https://gateway.cardstream.com/hosted/" data-hostedform-modal>
<input type="hidden" name="merchantID" value="100001" />
<input type="hidden" name="action" value="SALE" />
<input type="hidden" name="type" value="1" />
<input type="hidden" name="currencyCode" value="826" />
<input type="hidden" name="countryCode" value="826" />
<input type="hidden" name="amount" value="1001" />
<input type="hidden" name="orderRef" value="Test purchase" />
<input type="hidden" name="redirectURL" value="https://www.merchant.com/payment/" />
<input type="hidden" name="signature" value="07599ef4cdb2e26cb2bf34a9c65190a7ce82494bc1df144c3bb0d20ee2655d8278dc663b2b0421ef12b8f081e821151bb4c644277c5d65b5523a96539b53b5aa" />
<input type="submit" value="Pay Now">
</form>
<script>
var form = new window.hostedForms.classes.Form(document.forms[0]);
</script>
</body>
</html>
Related
i have an issue. i have this piece of code:
<html>
<body>
<form action="https://testsp.eu/sites/SC1/0a18c942-c443-4d91-954b-e6a2bf6b6061/_layouts/15/listform.aspx">
<input type="hidden" name="PageType" value="4" />
<input type="hidden" name="ListId" value="{F783213B-D85D-4580-A48D-3B7650F39970}" />
<input type="hidden" name="ID" value="429x07ec<script>alert(1)</script>c6lv0" />
<input type="hidden" name="ContentTypeID" value="0x0101009780EDAE3CDE424E865934F078F59B4E00B67EBEA1D4DD80439046916AAD0BBD4C" />
<input type="hidden" name="Source" value="https://testsp.reply.eu/sites/SC1/0a18c942-c443-4d91-954b-e6a2bf6b6061/Attachments/Forms/AllItems.aspx?RootFolder=Attachments%2Ftesting%2Dvia%2Dvpn%2Dopen%2Dedit%2Dand%2Dsave%2Dfiles%2Don%2Dtaamy%2Dnew%2Dfeature" />
<input type="hidden" name="RootFolder" value="Attachments/testing-via-vpn-open-edit-and-save-files-on-tammy-new-feature" />
<input type="hidden" name="AjaxDelta" value="1" />
<input type="hidden" name="isStartPlt1" value="1455724318260" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
for make it work i have the use the following header http:
Pragma: SharePointAjaxDelta=|SITES|SC1|0A18C942-C443-4D91-954B-E6A2BF6B6261:|SITES|SC1|_CATALOGS|MASTERPAGE|TT.MASTER:1.15.0.0.0.15.0.4763.1000.2.FALSE.:en-US:en-US:RW');
Anyone have an idea how i can request that html page with the header "pragma"?
Thanks in advance
I am trying to making simple product checkout system for my site. I am using paypal default checkout system. It is working fine but I need coupon code facility also. I never see any options in paypal for coupon code thing. That’s why I tried to create that via jquery.
I successful made that but it is work only on one product. When I add more product in page this it is not work. I can understand it about class and id issue but still I don’t figure out how to do that. also trying for discount as % wise current my code only work hard coded price.
Would you guys check my code see where my mistake is or how can make it. Or if there have any other way to do
HTML
<h2> Product 1 - $4.99</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal" class="frm_paypal">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="info#soming.com" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="item_name" value="Chile Powder" />
<input type="hidden" name="item_number" value="0001" />
<input type="hidden" name="amount" class="amount" value="4.99" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="button_subtype" value="products" />
<input type="hidden" name="no_note" value="0" />
<input type="hidden" name="tax_rate" value="0.082" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest" />
<input type="image" alt="PayPal - The safer, easier way to pay online!" name="submit" src="http://oldstoberfest.com/wp-content/uploads/2015/04/buynow.png" class="btnPaypal" />
<div class="div_coupon_code">
<div class="div_msg"></div>If you have any coupon code please enter Otherwise leave it blank and Press checkout.
<br>
<input type="text" name="coupon_code" class="coupon_code" value="" placeholder="Coupon Code" />
<br>
<input type="button" class="btnCheckOut" name="btnCheckOut" value="Checkout" /> <span class="span_pay">
<input type="button" class="btnPay" name="btnPay" value="Pay" />
</span>
</div>
<img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0" />
</form>
<h2> Product 2 - $6.99</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal" class="frm_paypal">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="info#soming.com" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="item_name" value="Chile Powder" />
<input type="hidden" name="item_number" value="0002" />
<input type="hidden" name="amount" class="amount" value="6.99" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="button_subtype" value="products" />
<input type="hidden" name="no_note" value="0" />
<input type="hidden" name="tax_rate" value="0.082" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest" />
<input type="image" alt="PayPal - The safer, easier way to pay online!" name="submit" src="http://oldstoberfest.com/wp-content/uploads/2015/04/buynow.png" class="btnPaypal" />
<div class="div_coupon_code">
<div class="div_msg"></div>If you have any coupon code please enter Otherwise leave it blank and Press checkout.
<br>
<input type="text" name="coupon_code" class="coupon_code" value="" placeholder="Coupon Code" />
<br>
<input type="button" class="btnCheckOut" name="btnCheckOut" value="Checkout" /> <span class="span_pay">
<input type="button" class="btnPay" name="btnPay" value="Pay" />
</span>
</div>
<img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0" />
</form>
<h2> Product 3 - $8.99</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal" class="frm_paypal">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="info#soming.com" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="item_name" value="Chile Powder" />
<input type="hidden" name="item_number" value="0003" />
<input type="hidden" name="amount" class="amount" value="8.99" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="button_subtype" value="products" />
<input type="hidden" name="no_note" value="0" />
<input type="hidden" name="tax_rate" value="0.082" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest" />
<input type="image" alt="PayPal - The safer, easier way to pay online!" name="submit" src="http://oldstoberfest.com/wp-content/uploads/2015/04/buynow.png" class="btnPaypal" />
<div class="div_coupon_code">
<div class="div_msg"></div>If you have any coupon code please enter Otherwise leave it blank and Press checkout.
<br>
<input type="text" name="coupon_code" class="coupon_code" value="" placeholder="Coupon Code" />
<br>
<input type="button" class="btnCheckOut" name="btnCheckOut" value="Checkout" /> <span class="span_pay">
<input type="button" class="btnPay" name="btnPay" value="Pay" />
</span>
</div>
<img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0" />
</form>
<h2> Product 4 - $1.99</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal" class="frm_paypal">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="info#soming.com" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="item_name" value="Chile Powder" />
<input type="hidden" name="item_number" value="0004" />
<input type="hidden" name="amount" class="amount" value="1.99" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="button_subtype" value="products" />
<input type="hidden" name="no_note" value="0" />
<input type="hidden" name="tax_rate" value="0.082" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest" />
<input type="image" alt="PayPal - The safer, easier way to pay online!" name="submit" src="http://oldstoberfest.com/wp-content/uploads/2015/04/buynow.png" class="btnPaypal" />
<div class="div_coupon_code">
<div class="div_msg"></div>If you have any coupon code please enter Otherwise leave it blank and Press checkout.
<br>
<input type="text" name="coupon_code" class="coupon_code" value="" placeholder="Coupon Code" />
<br>
<input type="button" class="btnCheckOut" name="btnCheckOut" value="Checkout" /> <span class="span_pay">
<input type="button" class="btnPay" name="btnPay" value="Pay" />
</span>
</div>
<img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0" />
</form>
<h2> Product 5 - $6.99</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal" class="frm_paypal">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="info#soming.com" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="item_name" value="Chile Powder" />
<input type="hidden" name="item_number" value="0005" />
<input type="hidden" name="amount" class="amount" value="6.99" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="button_subtype" value="products" />
<input type="hidden" name="no_note" value="0" />
<input type="hidden" name="tax_rate" value="0.082" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest" />
<input type="image" alt="PayPal - The safer, easier way to pay online!" name="submit" src="http://oldstoberfest.com/wp-content/uploads/2015/04/buynow.png" class="btnPaypal" />
<div class="div_coupon_code">
<div class="div_msg"></div>If you have any coupon code please enter Otherwise leave it blank and Press checkout.
<br>
<input type="text" name="coupon_code" class="coupon_code" value="" placeholder="Coupon Code" />
<br>
<input type="button" class="btnCheckOut" name="btnCheckOut" value="Checkout" /> <span class="span_pay">
<input type="button" class="btnPay" name="btnPay" value="Pay" />
</span>
</div>
<img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0" />
</form>
<h2> Product 6 - $6.99</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal" class="frm_paypal">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="info#soming.com" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="item_name" value="Chile Powder" />
<input type="hidden" name="item_number" value="0006" />
<input type="hidden" name="amount" class="amount" value="6.99" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="button_subtype" value="products" />
<input type="hidden" name="no_note" value="0" />
<input type="hidden" name="tax_rate" value="0.082" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest" />
<input type="image" alt="PayPal - The safer, easier way to pay online!" name="submit" src="http://oldstoberfest.com/wp-content/uploads/2015/04/buynow.png" class="btnPaypal" />
<div class="div_coupon_code">
<div class="div_msg"></div>If you have any coupon code please enter Otherwise leave it blank and Press checkout.
<br>
<input type="text" name="coupon_code" class="coupon_code" value="" placeholder="Coupon Code" />
<br>
<input type="button" class="btnCheckOut" name="btnCheckOut" value="Checkout" /> <span class="span_pay">
<input type="button" class="btnPay" name="btnPay" value="Pay" />
</span>
</div>
<img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0" />
</form>
<h2> Product 7 - $6.99</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal" class="frm_paypal">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="info#soming.com" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="item_name" value="Chile Powder" />
<input type="hidden" name="item_number" value="0007" />
<input type="hidden" name="amount" class="amount" value="6.99" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="button_subtype" value="products" />
<input type="hidden" name="no_note" value="0" />
<input type="hidden" name="tax_rate" value="0.082" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest" />
<input type="image" alt="PayPal - The safer, easier way to pay online!" name="submit" src="http://oldstoberfest.com/wp-content/uploads/2015/04/buynow.png" class="btnPaypal" />
<div class="div_coupon_code">
<div class="div_msg"></div>If you have any coupon code please enter Otherwise leave it blank and Press checkout.
<br>
<input type="text" name="coupon_code" class="coupon_code" value="" placeholder="Coupon Code" />
<br>
<input type="button" class="btnCheckOut" name="btnCheckOut" value="Checkout" /> <span class="span_pay">
<input type="button" class="btnPay" name="btnPay" value="Pay" />
</span>
</div>
<img alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0" />
</form>
JS
jQuery(document).ready(function($){
$('body').on('click','#btnPaypal', function(e) {
e.preventDefault();
$("#div_coupon_code").show("slow");
return false;
});
$('body').on('click','#btnCheckOut', function(e) {
var coupon=$("#coupon_code").val();
var go_paypal=1;
if(coupon=="happy" || coupon=="HAPPY")
{
$("#amount").val(5.24);
$("#div_msg").html("Valid coupon code entered! Click pay to continue").show("slow");
go_paypal=0;
}
else if(coupon!="")
{
$("#div_msg").html("Invalid coupon code. Please double check").show("slow");
go_paypal=1;
}
else
$("#frm_paypal").submit();
if(go_paypal==0)
{
$("#btnCheckOut").hide("slow");
$("#span_pay").show("fast");
}
});
$('body').on('click','#btnPay', function(e) {
$("#frm_paypal").submit();
});
$("#div_coupon_code").hide();
$("#span_pay").hide();
});
single product demo
http://jsfiddle.net/cyber007/gpLeqgzc/
Multiple product demo
http://jsfiddle.net/cyber007/3pLv8dy6/
i will keep update here
if you want to calculate discount for multiple products dynamically then make sum of all products price and then apply coupon discount after getting total
So,your code should be like this...
function calcPrice(){
var v = parseInt(document.getElementById("val").value);
var q = parseInt(document.getElementById("quantity").value);
if ((isNaN(q)) || (q == null) || (q <0)) {
alert ("You must enter a positive number");
document.getElementById("quantity").value = "";
return false;
}
var p = calcTotal(v,q);
alert("Total Price = " + p);
}
function calcTotal(v,q) {
var discount = 0;
if (q>=1) {discount = .25}
var price = q * v;
var savings = price * discount;
var total = price - savings;
return total;
}
this is the reference you just need to modify id and class for your HTML
I have to submit this form to a payment processing gateway on my PHP page. All the credit card payment information will be taken on the next screen but the gateway needs the "HostedKey" and "Gateway_ID" need to be invisible from public code view as well.
<form action="nextpage.php" method ="POST" target="_blank">
Patient Account Number:
<input type="text" name="CustRefID" id="CustRefID">
<input type="hidden" name="HostedKey" id="HostedKey" value="ZZZZZZ" />
<input type="hidden" name="Gateway_ID" id="Gateway_ID" value="XXXXXX" />
<input type="hidden" name="IndustryCode" id="IndustryCode" value="2" />
<input type="hidden" name="Amount" id="Amount" value="" />
<input type="hidden" name="RecurringType" id="RecurringType" value="N" />
<input type="hidden" name="RecurringAmount" id="RecurringAmount" value="" />
<input type="hidden" name="CURL" id="CURL" value="back to my site" />
<input type="hidden" name="AVSRequired" id="AVSRequired" value="Y"/>
<input type="hidden" name="CVV2Required" id="CVV2Required"value="Y"/>
<input type="hidden" name="EmailRequired" id="EmailRequired" value="Y"/>
<input type="hidden" name="PostRspMsg" id="PostRspMsg" value="Y"/>
<input type="hidden" name="SECCode" id="SECCode" value="1" />
<input type="hidden" name="Descriptor" id="Descriptor" value="Online" />
<input type="Submit" name="Submit" id="Submit" value="Pay Online Now" />
</form>
I tried something like this. It hid the Key and ID but the form did not pass on the hidden session variables.
<strong>Patient Account Number: </strong>
<form action="nextpage.php" method"post">
<input type="text" name="CustRefID"/>
<input type="hidden" name="HostedKey" id="HostedKey" value="" />
<input type="hidden" name="Gateway_ID" value="<?php ($Gateway_ID); ?>" />
<input type="hidden" name="HostedKey" value="<?php ($HostedKey); ?>" />
<input type="submit" name="Submit" value="Submit" />
</form>
<?php
if (isset($_POST['Submit']))
{ $_session['CustRefID'] = $_POST['CustRefID'];}
{ $_session['HostedKey'] = $_POST['xxxxxx'];}
{ $_session['Gateway_ID'] = "zzzzzz";}
?>
<strong><? echo $_session['CustRefID'];?></strong>
Any help would be great. My programmer is out sick...
You have repetition in your HTML. Change it to this:
<input type="hidden" name="Gateway_ID" value="<?php ($Gateway_ID); ?>" />
<input type="hidden" name="HostedKey" value="<?php ($HostedKey); ?>" />
2. You didn't specify what POST info should go in the SESSION. Change it to this:
{
$_SESSION['CustRefID'] = $_POST['CustRefID'];
$_SESSION['HostedKey'] = $_POST['HostedKey'];
$_SESSION['Gateway_ID'] = $_POST['HostedKey'];
}
My form is generating an error when I use:
<input type="hidden" name="total_amount" value="<?php=$_POST['total_amount']?>" />
however it works fine when I use:
<input type="hidden" name="total_amount" value="<?=$_POST['total_amount']?>" />
I thought it was insecure to use <?= instead of <?php.
Here is the complete form:
<form name="save_file" action="cyprus_funds_transfer.php" method="post" enctype="multipart/form-data">
<? if($_POST['value_type'] == 1) {?>
<input type="hidden" name="amount" value="<?php=$_POST['account_number']?>" />
<input type="hidden" name="value_type" value="1" />
<input type="hidden" name="total_amount" value="<?php=$_POST['total_amount']?>" />
<? } else { ?>
<input type="hidden" name="amount" value="<?php=$_POST['amount']?>" />
<input type="hidden" name="value_type" value="0" />
<? } ?>
<input type="hidden" name="to" value="<?php=$_POST['send_to']?>" />
<input type="hidden" name="from" value="<?php=$_POST['send_from']?>" />
<input type="hidden" name="message" value="<?php=$_POST['message']?>" />
<input type="hidden" name="mode" value="save" />
<input type="hidden" name="order_id" value="<?php=$order_id?>" />
<input type="hidden" name="email_id" value="<?php=$_POST['email_id']?>" />
</form>
This is wrong way
<?php=$_POST['send_to']?>
this is correct way
<?=$_POST['send_to']?> is similar to <?php echo $_POST['send_to']; ?>
Codepad
Try to replace
<?php=$_POST['send_to'];?>
to this
<?=$_POST['send_to'];?>
or with this
<?php echo $_POST['send_to'];?>
Anybody having this problem? Suddenly paypal is not returning POST data to the notify_url. Array is completely empty and it happens when payment is made through new paypal checkout system.
Below is the final page after payment is made. When I click continue booking, it should have redirected to notify_url with POST data for validation and stuff but data is an empty array.
My request code is listed below. Can anybody please take a look at it and tell me whether some variable is missing or i am doing something wrong?
<form method="post" name="paypal_form" action="http://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="business" value="ayaz.a_1286483626_biz#gmail.com" />
<input type="hidden" name="cmd" value="_xclick" />
<!-- the next three need to be created -->
<input type="hidden" name="return" value="https://system1.smanager.net/SM/lib/booking_system/response.php" />
<input type="hidden" name="cancel_return" value="https://system1.smanager.net/SM/lib/booking_system/paypal_ipn.php?cancelled=true" />
<input type="hidden" name="notify_url" value="https://system1.smanager.net/SM/lib/booking_system/response.php" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="bn" value="toolkit-php" />
<input type="hidden" name="cbt" value="Continue Back to Booking System" />
<!-- Payment Page Information -->
<input type="hidden" name="no_shipping" value="" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="cn" value="Comments" />
<input type="hidden" name="cs" value="" />
<!-- Product Information -->
<input type="hidden" name="item_name" value="TestProduct" />
<input type="hidden" name="amount" value="10.23" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="item_number" value="1234" />
<input type="hidden" name="undefined_quantity" value="" />
<input type="hidden" name="on0" value="" />
<input type="hidden" name="os0" value="" />
<input type="hidden" name="on1" value="" />
<input type="hidden" name="os1" value="" />
<!-- Shipping and Misc Information -->
<input type="hidden" name="shipping" value="0.0" />
<input type="hidden" name="shipping2" value="" />
<input type="hidden" name="handling" value="" />
<input type="hidden" name="tax" value="6" />
<input type="hidden" name="custom" value="somedata" />
<input type="hidden" name="invoice" value="" />
<!-- Customer Information -->
<input type="hidden" name="first_name" value="ayaz" />
<input type="hidden" name="last_name" value="alavi" />
<input type="hidden" name="address1" value="Address" />
<input type="hidden" name="address2" value="" />
<input type="hidden" name="city" value="" />
<input type="hidden" name="state" value="abc" />
<input type="hidden" name="zip" value="" />
<input type="hidden" name="email" value="ayaz.a_1286483582_per#gmail.com" />
<input type="hidden" name="night_phone_a" value="" />
<input type="hidden" name="night_phone_b" value="" />
<input type="hidden" name="night_phone_c" value="" />
</form>
</body>
Thanks.
I have also face same problem.
Please set the following settings in Your business account.
In Website Payment Preferences
=> Auto Return: On
=> Set Return URL
=> Payment Data Transfer: On.
Please try this, this may help you.
All the best.
Kanji