0

我在一个网站上工作,我有一个自定义订单表格,在结帐时会显示一个 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>';
4

1 回答 1

0

可能是一个快速而肮脏的修复,但为什么不向表单添加一个提交按钮,例如:“如果您在 10 秒内没有被重定向,请单击此处”然后提交吗?

于 2013-04-16T12:58:53.740 回答