0
我在一個網站上工作,我有一個自定義訂單,在結帳時顯示一個PayPal Express結帳按鈕。該按鈕可正確重定向到FireFox中的PayPal,但是在Safari和Chrome中,當我點擊按鈕時,沒有任何反應。使用Chrome開發者工具,我可以看到GET請求正在處理,當我點擊按鈕,但立即取消。我已經嘗試將表單目標更改爲target =「_ self」和target =「paypal」,這沒有幫助。這裏是我的貝寶快速結賬按鈕代碼和重定向到PayPal:貝寶快速結賬按鈕不適用於Chrome和Safari
//////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="[email protected]">
<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>';
是的,謝謝你的建議! – user2102919