I have a question about the process of the payment using a gateway emerchant. I have to provide all the variables to the gateway and get the answer if the charge was made. I can make the charge if all the data is correct, but i don't know how to receive the answer from the gateway, the manual give me a clue, the answer will provide in the variable "urlBack". Do you know how to get data from this gateway?
First I process all date in javascript then I send the information using the following code, but the answer I will receive in another page (https://acmax.mx/popup_2). All works very well but I have problems with the answer from the gateway.
Thank so much
<form name="myPayTC" id="myPayTC" method="post" action="https://www.procom.prosa.com.mx/eMerchant/7727222_acmaxdemexico.jsp" onload='javascript:MyFrmOnLoad();'>
<input type="hidden" id="total" name="total" value='total'>
<input type="hidden" id="currency" name="currency" value="484">
<input type="hidden" id="address" name="address" value="ACMAX">
<input type="hidden" id="order_id" name="order_id" value='order_id'>
<input type="hidden" id="merchant" name="merchant" value="7727222">
<input type="hidden" id="store" name="store" value="1234">
<input type="hidden" id="term" name="term" value="001">
<input type="hidden" id="digest" name="digest" value='valDigest'>
<input type="hidden" id="return_target" name="return_target" value="N/A">
<!--<input type="hidden" id="urlBack" name="urlBack" value="https://acmax.mx/index.php?controller=ComercioResp">-->
<!--<input type="hidden" id="urlBack" name="urlBack" value="https://acmax.mx/es/checkout/confirm">-->
<input type="hidden" id="urlBack" name="urlBack" value="https://acmax.mx/popup_2">
<!--<input type="hidden" id="urlBack" name="urlBack" value="http://acmax.mx/es/checkout/paymentmethod">-->
<p><img src="https://acmax.mx/themes/theme674/img//bankwire.jpg" alt="Pago por tarjeta de crédito/débito" width="86" height="54" /> <input type="submit" name="pButton" value="Pago con Tarjeta de Crédito/Débito" class="exclusive" style="font-size:14px; height:28px;"></p>
</form>
The code that has the server is the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML version="-//W3C//DTD HTML 4.01 Transitional//EN">
<HEAD>
<TITLE>Verificacion de Compra</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
</HEAD>
<BODY>
<form id="formars" name="formars" action="https://acmax.mx/popup_2" method="post">
<input type="Hidden" name="EM_Response" value="denied">
<input type="Hidden" name="EM_Total" value="102">
<input type="Hidden" name="EM_OrderID" value="625">
<input type="Hidden" name="EM_Merchant" value="7727222">
<input type="Hidden" name="EM_Store" value="1234">
<input type="Hidden" name="EM_Term" value="001">
<input type="Hidden" name="EM_RefNum" value="initialrefnum">
<input type="Hidden" name="EM_Auth" value="000000">
<input type="Hidden" name="EM_Digest" value="initialdigest">
<input type="Hidden" name="cc_number" value="0565">
<input type="Hidden" name="total" value="102">
<input type="Hidden" name="order_id" value="625">
<input type="Hidden" name="merchant" value="7727222">
<input type="Hidden" name="tx_id" value="322307f91ef2b5318e5d720f49fb30dace2ca474">
<input name="pButton" value="Pago con Tarjeta de Crédito/Débito" type="Hidden" />
<input name="address" value="ACMAX" type="Hidden" />
</form>
<script type="text/javascript">
var formars = document.getElementById('formars');
formars.submit();
</script>
</BODY>
</HTML>
I can't change this code, so I need to get the data from the form "formars"
Well, for example, if you have set the urlBack parameter to some php page, let's call it returnCall.php.
Now, if the payment gateway is sending back the following 'post' data:
name1=cat&name2=dog&name3=echidna
Then in your php page, you can read that data as follows:
<?php
$value1 = $_POST["name1"];
$value2 = $_POST["name2"];
$value3 = $_POST["name3"];
?>
<p>
<ul>
<li>Value1 = <?=$value1?></li>
<li>Value2 = <?=$value2?></li>
<li>Value3 = <?=$value3?></li>
</ul>
</p>
Then the output on the page would translate to:
<p>
<ul>
<li>Value1 = cat</li>
<li>Value2 = dog</li>
<li>Value3 = echidna</li>
</ul>
</p>
You could similarly have an aspx page that could do the same thing.
string Value1;
string Value2;
string Value3;
protected void Page_Load(object sender, EventArgs e)
{
Value1 = Request.Form["name1"];
Value2 = Request.Form["name2"];
Value3 = Request.Form["name3"];
}
Related
I want to remake my payment form. I'm using GET method, and want to return link below form instead of redirect, after clicking submit. Someone have any idea?
<script type="text/javascript">
function formatMoney(e) {
document.getElementById('z24_kwota').value = (!isNaN(e.target.value) ? e.target.value : 0) * 100
}
</script>
<form method="get" id="myform" action="https://sklep.przelewy24.pl/zakup.php">
<input type="hidden" name="z24_id_sprzedawcy" value="000000">
<input type="hidden" name="z24_crc" value="000000">
<input type="hidden" name="z24_return_url" value="https://google.com">
<input type="hidden" name="z24_language" value="pl">
Tytuł wpłaty
<input type="text" name="z24_nazwa" id="pole" maxlength="30" value="" placeholder="Wprowadź tytuł wpłaty" required>
<br>
<input type="hidden" name="z24_kwota" id="z24_kwota">
Kwota wpłaty
<input type="text" id="pole" placeholder="Wprowadź kwotę wpłaty (PLN)" pattern="^([1-9])((\.\d{1,2})?)$|^((?!0)(\d){1,5})((\.\d{1,2})?)$|^(1(\d{5})(.\d{1,2})?)$|^(200000(.[0]{1,2})?)$" onkeyup="formatMoney(event)" required>
<br>
<BR>
<input type="submit" class="przycisk" value="zapłać teraz">
</form>
I checked all Internet, and can't find any solution
i'm new with web programming and i have this problem, I have this little form:
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Orden de Servicio</title>
<link rel="stylesheet" href="css/tabla.css">
<img src="img/logogps.png" alt="GPS" style="float:left; width:64px;height:64px; margin-left:1%;margin-top:1%;">
<script src="scripts/jquery-1.12.4.js"></script>
<script type="text/javascript">
function EnableAnom()
{
if($('#chkanom').is(':checked'))
{
document.getElementById("InputAudio").hidden = false;
document.getElementById("InputText").hidden = false;
document.getElementById("InputImage").hidden = false;
document.getElementById("lblaudio").hidden = false;
document.getElementById("txtdet").hidden = false;
document.getElementById("lblimg").hidden = false;
}
else
{
document.getElementById("InputAudio").hidden = true;
document.getElementById("InputText").hidden = true;
document.getElementById("InputImage").hidden = true;
document.getElementById("lblaudio").hidden = true;
document.getElementById("txtdet").hidden = true;
document.getElementById("lblimg").hidden = true;
}
}
</script>
</head>
<body>
<form action="checkprereg.php" method="POST" enctype="multipart/form-data">
<h2 class="text-center">Check PreInstalación</h2><br /><br />
<input type="hidden" name="id_orden" value=<?php echo $idorden; ?> />
<input type="hidden" name="chkenc" value="0">
<input type="checkbox" name="chkenc" value="1">
<label for="chkenc">Encendido</label><br>
<input type="hidden" name="chkapg" value="0">
<input type="checkbox" name="chkapg" value="1">
<label for="chkapg">Apagado</label><br>
<input type="hidden" name="chkcontig" value="0">
<input type="checkbox" name="chkcontig" value="1">
<label for="chkcontig">Continua / Ignición</label><br>
<input type="hidden" name="chkluces" value="0">
<input type="checkbox" name="chkluces" value="1">
<label for="chkluces">Luces</label><br>
<input type="hidden" name="chkotra" value="0">
<input type="checkbox" name="chkotra" value="1">
<label for="chkotra">Otra</label><br><br>
<label for="videvi">Video de evidencia (arranque):</label>
<input type="file" name="videvi" id="InputFile" accept="video/*"><br><br>
<label for="chkanom">Habilitar registro de anomalías</label>
<input type="checkbox" name="chkanom" id="chkanom" value="1" onclick="EnableAnom()" ><br><br>
<label for="audanom" hidden="true" id="lblaudio">Audio con detalles:</label>
<input type="file" name="audanom" id="InputAudio" accept="audio/*" hidden="true"><br><br>
<label for="textanom" hidden="true" id="txtdet">Detalles:</label>
<textarea name="textanom" id="InputText" rows="5" cols="50" hidden="true"></textarea><br><br>
<label for="imganom" hidden="true" id="lblimg">Imagen con detalles:</label>
<input type="file" name="imganom" id="InputImage" accept="image/*" hidden="true"><br><br>
<button class="button orange" type="submit" value="Submit">Enviar</button>
<button class="button orange" type="reset" value="Reset">Limpiar</button>
</form>
<p>
<a href="menu.php">
<img src="img/home.png" alt="Home" style="float:right; width:64px;height:64px; margin-left:1%;margin-top:1%;">
</a>
</p>
</body>
I did added a litlle script (EnableAnom()) that hides some inputs with a checkbox, but, with this script the form don't do POST, (I receive all vars empty) if I remove the script, the form works ok.
What is wrong in the script? (I did move up script up, down, without success)
Best regards.
<input type="hidden" name="id_orden" value=<?php echo $idorden; ?> />
change to
<input type="hidden" name="id_orden" value="<?php echo $idorden; ?>" />
and test first
I am using Minicart.JS for my simple paypal shopping cart. But this is not working as it should. The cart is not popping up if I click 'add to cart' button.
Here's my code.
<html>
<body>
<script src="//cdnjs.cloudflare.com/ajax/libs/minicart/3.0.3/minicart.min.js"></script>
<script>
paypal.minicart.render();
</script>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="labs-feedback-minicart#paypal.com" />
<input type="hidden" name="item_name" value="Test Product" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="amount" value="1.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="shipping2" value="1.50">
<input type="hidden" name="shipping" value="2.50">
<strong>Test Product</strong>
<p>
<label><input type="checkbox" id="terms" name="terms" value="" /> I agree to the terms</label>
</p>
<input type="submit" name="submit" value="Add to cart" />
</form>
<script>
paypal.minicart.render();
paypal.minicart.cart.on('checkout', function (evt) {
var hasAgreed = !!document.getElementById('terms').checked;
if (!hasAgreed) {
alert('You must agree to the terms!');
evt.preventDefault();
}
});
</script>
</body>
</html>
Here is the actual site. , I found an error in console that said:
Uncaught TypeError: Cannot call method 'appendChild' of null
I am not sure how to fix this, please let me know what's wrong with my setup. Thanks.
You need to change the Add to cart button to not be saved on PayPal (In Profit and loss Section) and also unprotect code after the button is created right before you copy and paste it :)
Hope this helps :)
i have 2 raw aweber html code, they are in separate accounts. now i want to have 1 sign up form for this two raw codes. Means when someone sign up on my form, the email should the be saved on my two list. but i got problem on how to integrate this two codes. When i remove 1 form it work for only 1 list but when i integrate the two it doesn't save any email on the two list.
heres my code ,sorry for my poor coding im new to javascript im trying hard to solved this problem hope someone can help me.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<!--1st-->
<script language="javascript">
function copy_fields(){
<!--document.getElementById('name1').value = document.getElementById('name').value;
document.getElementById('from1').value = document.getElementById('email').value;
}
function validate(){
var filter = /^([a-zA-Z0-9_\.\-])+\#(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if((document.submail.email.value=='')||(document.submail.email.value=='Email Address'))
{alert('Please Enter Email Address'); return false;}
if (!filter.test(document.submail.email.value))
{alert('Please Enter A Valid Email'); return false;}
document.getElementById('sub9').className='gray_out';
document.getElementById('sub9').disabled='true';
copy_fields();
document.form2.submit();
setTimeout('document.submail.submit()',3000);
}
</script>
<style type="text/css">
.gray_out {
filter:alpha(opacity=40);
-moz-opacity:.40;
opacity:.40;
}
</style>
<!--END 1st-->
<!--2nd-->
<script language="javascript">
function copy_fields1(){
<!--document.getElementById('name1').value = document.getElementById('name').value;
document.getElementById('from1').value = document.getElementById('email').value;
}
function validate1(){
var filter = /^([a-zA-Z0-9_\.\-])+\#(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if((document.submail.email.value=='')||(document.submail.email.value=='Email Address'))
{alert('Please Enter Email Address'); return false;}
if (!filter.test(document.submail.email.value))
{alert('Please Enter A Valid Email'); return false;}
document.getElementById('sub9').className='gray_out';
document.getElementById('sub9').disabled='true';
copy_fields1();
document.form1.submit();
setTimeout('document.submail.submit()',3000);
}
</script>
<style type="text/css">
.gray_out {
filter:alpha(opacity=40);
-moz-opacity:.40;
opacity:.40;
}
</style>
<!--END 2nd-->
</head>
<body>
<form name="submail" method="post" action="http://empowerauthoritypro.com/commission-loophole-ninja" >
<input type="hidden" name="go" value="now" />
<!-- First Name:<br />
<input id="name" type="text" name="name" value="First Name" onclick="if(this.value=='First Name') this.value=''" class="text-field" /><br />-->
Email:<br />
<input id="email" type="text" name="email" value="Email Address" onclick="if(this.value=='Email Address') this.value=''" class="text-field" />
<!--Optin Now-->
<input type="button" id="sub9" value="Submit" onClick='window.open(validate1())' />
</form>
<!--1st has email requirement only-->
<form name="form2" method="post" action="http://www.aweber.com/scripts/addlead.pl" target="iframe" style="display:none">
<input type="hidden" name="meta_web_form_id" value="1817364894" />
<input type="hidden" name="meta_split_id" value="" />
<input type="hidden" name="listname" value="dummylistshaq" />
<input type="hidden" name="redirect" value="http://www.aweber.com/thankyou.htm?m=default" /><input type="hidden" name="meta_adtracking" value="ninjatest" />
<input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="email" />
<input type="hidden" name="meta_tooltip" value="" />
<div style="display:none">
<img src="http://forms.aweber.com/form/displays.htm?id=jByM7MxsLBycLA==" alt="" width="1" height="1" />
</div>
<input type="text" name="email" id="from1" value="" size="20">
</form>
<iframe name="iframe" style="display:none"></iframe>
<!--END 1st-->
<!--2nd has name and email requirement but i have compromise the name to be hide-->
<form name="form1" method="post" action="http://www.aweber.com/scripts/addlead.pl" target="iframe" style="display:none">
<input type="hidden" name="meta_web_form_id" value="1376972149" />
<input type="hidden" name="meta_split_id" value="" />
<input type="hidden" name="listname" value="optinninja1" />
<input type="hidden" name="redirect" value="http://www.aweber.com/thankyou.htm?m=default" /><input type="hidden" name="meta_adtracking" value="ninjaoptin" /><input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="name,email" />
<input type="hidden" name="meta_tooltip" value="" />
<div style="display:none">
<img src="http://forms.aweber.com/form/displays.htm?id=jMzsbJzsTIwsnA==" alt="" width="1" height="1" />
</div>
<input type="hidden" name="name" id="name1" value="" size="20">
<input type="text" name="email" id="from1" value="" size="20">
</form>
<iframe name="iframe" style="display:none"></iframe>
<!--END 2nd-->
</body>
</html>
A better (and AWeber-supported) way to integrate multiple services with your AWeber list is to use the AWeber API.
Another possibility might be to set up a PHP page on your own site, set it as your AWeber Form's "Thank You Page", and code your PHP to take advantage of the Pass Subscriber Data feature:
https://help.aweber.com/entries/21775518-how-do-i-pass-form-data-to-my-thank-you-pages
I'm a bit confused regarding your desired workflow. You mention submitting to two AWeber lists, yet there is a third form in your code as well that posts to a third party.
I highly recommend getting in touch with AWeber Customer Solutions who will be able to address your needs more comprehensively. Just email help#aweber.com or visit https://www.aweber.com/contact-us.htm and a team member will take an in-depth look.
I've been playing with the PayPal code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="business" value="test#test.org">
<input type="hidden" name="item_name_1" value="Item1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_name_2" value="Item2">
<input type="hidden" name="amount_2" value="2.00">
<input type="submit" value="PayPal">
</form>
And I want to set the value of item_name_1 and amount_1 via javascript when a button is pressed elsewhere so when that form is submitted the values are all set:
So I have this function run when the add to cart is clicked:
<script type='text/javascript'>
function addtocart(){
paypal.item_name_2.value="Hello!";
}
</script>
I feel I'm on the right tracks but no joy. Help please! TIA
Try this
document.forms["paypal"].item_name_2.value="heelo";
try this
document.forms['paypay']['item_name_2'].value = "hello";