将Paypal集成到我的购物车中

时间:2013-08-09 00:38:47

标签: php session paypal checkout

我开发了自己的购物车,现在我想在用户点击结帐按钮后整合Paypal。

我需要根据客户添加到购物车的内容将商品详细信息传递给Paypal。我相信下面的代码会执行此操作,但是单击时结帐按钮不会执行任何操作。尝试了一切,但由于某种原因,表格甚至没有看到结帐按钮!

<?php
$checkout = "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>";
$checkout .= "<input type='hidden' name='cmd' value='_cart'><input type='hidden' name='upload' value='1'>";
$checkout .= "<input type='hidden' name='business' value='craig@biosboss.com'>";

$count = 1;
$checkout .= "<input type='hidden' name='item_name_" + $count + "' value='" + $item['name']+ "'>";
$checkout .= "<input type='hidden' name='item_number_" + $count + "' value='" + $count + "'>";
$checkout .= "<input type='hidden' name='quantity_" + $count + "' value='" + $item['qty'] + "'>";
$checkout .= "<input type='hidden' name='amount_" + $count + "' value='" + $item['price'] + "'>";
$count = $count + 1;
?>

<input type='hidden' name='currency_code' value='GBP'>
<input type='hidden' name='lc' value='GB'>
<input type='hidden' name='return' value='http://www.biosboss.com/checkout?confirm=Confirm&confirmTerms=on'>
<input type='hidden' name='cancel_return' value='http://www.biosboss.com/checkout'>
<input type='hidden' name='notify_url' value='http://www.biosboss.com/checkout?confirm=Confirm&confirmTerms=on'>
<input class='securePaymentButton' type='submit' value='here'>
<?php $checkout .= "</form>"; ?>

0 个答案:

没有答案