I am working on a site and I have a custom order form which displays a PayPal Express Checkout Button at the time of checkout. The button correctly redirects to PayPal in FireFox with the sale price and order number, however in Safari and Chrome, when I click on the button, nothing happens. Using Chrome Developer Tools, I can see that the GET request is being processed when I click the button, but then immediately canceled. I have already tried changing the form target to target="_self" and target="paypal" which did not help. Here is my code for the PayPal Express Checkout Button and the redirect to PayPal:
我正在网站上工作,我有一个自定义订单表格,在结账时显示PayPal Express Checkout按钮。该按钮使用销售价格和订单号正确地重定向到FireFox中的PayPal,但在Safari和Chrome中,当我点击按钮时,没有任何反应。使用Chrome开发者工具,我可以看到单击按钮时正在处理GET请求,但随后立即取消。我已经尝试将表单目标更改为target =“_ self”和target =“paypal”,但没有帮助。这是我的PayPal Express Checkout按钮的代码和重定向到PayPal:
//////payment handlers
if ($payprovider == 'paypal') {
////hand off to paypal
header("Location: order-inspection.php?process=paypal&amount=".$row12['customer_payment_amount']."&items=".$row12['COUNT(session)']."&order=".$row12['ordernumber']." ");
} elseif ($payprovider == 'googlewallet') {
////hand off to google
header("Location: order-inspection.php?process=googlewallet&amount=".$row12['customer_payment_amount']."&items=".$row12['COUNT(session)']."&order=".$row12['ordernumber']." ");
} elseif ($payprovider == 'wepay') {
////hand off to google
header("Location: order-inspection.php?do=wepay&amount=".$row12['customer_payment_amount']."&items=".$row12['COUNT(session)']."&order=".$row12['ordernumber']." ");
} elseif ($payprovider == 'callin') {
////hand off to google
header("Location: order-inspection.php?do=callin&amount=".$row12['customer_payment_amount']."&order=".$row12['ordernumber']."&id=".$_SESSION['CURINSPECID']." ");
} else {
////send to step one because inspectid dropped
header("Location: order-inspection.php?do=step1&error=sessiondropped");}
} elseif (isset($_GET['process']) && $_GET['process'] == 'paypal') {
////vars needed
$orderamount = cleanget('amount');
$orderitems = cleanget('items');
$ordernumberid = cleanget('order');
////update payment provider
$SQL1 = " UPDATE inspections_payment SET customer_payment_status='Dropped at Paypal',payment_provider = 'paypal' WHERE ordernumber = '".$ordernumberid."'";
$result1 = mysql_query($SQL1,$cid)or die(mysql_error());
////print the image to let customer know they are being redirected
print '<center><br /><br /><br /><br /><br /><strong>Sending you to PayPal for payment processing.</strong><br />Please wait.... </center>';
////data to send to paypal
print '<form name="payment" action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="team@lemonsquad.com">
<input type="hidden" name="cbt" value="Return to site.">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="bn" value="IC_Sample">
<input type="hidden" name="on0" value="Order Number">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="os0" value="'.$ordernumberid.'">
<input type="hidden" name="custom" value="'.$ordernumberid.'">
<input type="hidden" name="item_name" value="Lemon Squad - '.$orderitems.' Inspections Ordered" />
<input type="hidden" name="amount" value="'.$orderamount.'" />
<input type="hidden" name="return" value="http://www.lemonsquad.com/thankq.php">
<input type=hidden name="notify_url" value="http://www.lemonsquad.com/checking.php">
<input type="hidden" name="cancel_return" value="http://www.lemonsquad.com/order-inspection.php"/>
<input type="hidden" name="cpp_header_image" value="http://www.lemonsquad.com/images/paypalbanner.jpg"/>
</form>
<script type="text/javascript">
document.payment.submit();
</script>';
}
print '<form method="get" action="order-inspection.php" name="orderform1" id="orderform1" /><input type="hidden" name="process" value="final" /><input type="hidden" name="lsid" value="'.session_id().'" /><input type="hidden" name="paypro" value="paypal" />';
print '<a href="#" onClick="recordOutboundLink(this, \'Outbound Links\', \'paypal.com\');document[\'orderform1\'].submit();return false;"><img src="/images/paypal_checkout.png" /></a>';
print '<br /><br /></form>';
1 个解决方案
#1
0
May be a quick and dirty fix, but why not add a submit button to the form with something like: "Please click here if you are not redirected in 10 seconds" Does it submit then?
可能是一个快速而又脏的修复,但为什么不在表单中添加一个提交按钮,例如:“如果你没有在10秒内重定向,请点击这里”是否提交了?
#1
0
May be a quick and dirty fix, but why not add a submit button to the form with something like: "Please click here if you are not redirected in 10 seconds" Does it submit then?
可能是一个快速而又脏的修复,但为什么不在表单中添加一个提交按钮,例如:“如果你没有在10秒内重定向,请点击这里”是否提交了?