2
は、私はあなたが見ることができるようにサンドボックスpaypal IPNでitem_numberを取得する方法は?ここ
Array
(
[address_city] => San Jose
[address_country] => United States
[address_country_code] => US
[address_name] => Test User
[address_state] => CA
[address_status] => confirmed
[address_street] => 1 Main St
[address_zip] => 95131
[business] => [email protected]
[charset] => windows-1252
[custom] =>
[first_name] => Test
[form_charset] => UTF-8
[item_name1] => iPod Touch
[item_name2] => Giant Hamburger, the world's biggest
[item_number1] => 2
[item_number2] => 1
[last_name] => User
[mc_currency] => USD
[mc_fee] => 0.79
[mc_gross] => 17.00
[mc_gross_1] => 7.00
[mc_gross_2] => 10.00
[mc_handling] => 0.00
[mc_handling1] => 0.00
[mc_handling2] => 0.00
[mc_shipping] => 2.00
[mc_shipping1] => 2.00
[mc_shipping2] => 0.00
[merchant_return_link] => click here
[notify_version] => 3.4
[num_cart_items] => 2
[payer_email] => [email protected]
[payer_id] => TRCLJTHLNCJ7Q
[payer_status] => verified
[payment_date] => 23:14:45 Jan 02, 2012 PST
[payment_fee] => 0.79
[payment_gross] => 17.00
[payment_status] => Completed
[payment_type] => instant
[protection_eligibility] => Eligible
[quantity1] => 1
[quantity2] => 1
[receiver_email] => [email protected]
[receiver_id] => 74PV23B8KSK84
[residence_country] => US
[tax] => 0.00
[tax1] => 0.00
[tax2] => 0.00
[test_ipn] => 1
[transaction_subject] => Shopping CartiPod TouchGiant Hamburger, the world's biggest
[txn_id] => 4BK63214AG342352Y
[txn_type] => cart
[verify_sign] => A0Jk1FY.7aHd-VRk44a4grBP7kE.A0Azn34Obs6QiSJKuCvAWSWyItkH
)
を使用して、カートの支払いを完了した後、item_name1ありますペイパルからのサンプル応答だと、これらの項目の値はのは、私が持っていた例を言わせて取得する方法をitem_name2 10項目を支払った?それは私がこの
<?php
$i = 1;
foreach($_SESSION['cart'] as $id => $qty):
$product = find_product($id);
?>
<input type="hidden" name="item_name_<?php echo $i; ?>" value="<?php echo $product['ProductDescription']; ?>">
<input type="hidden" name="item_number_<?php echo $i; ?>" value="<?php echo $product['ProductID']; ?>">
<input type="hidden" name="amount_<?php echo $i; ?>" value="<?php echo $product['ProductOverridePrice']; ?>">
<input type="hidden" name="quantity_<?php echo $i; ?>" value="<?php echo $qty; ?>">
<?php
$i++;
endforeach;
?>
のように、私のPHPコードを介して、項目の番号を生成し、サンプルPayPalの応答を見れば、mc_gross_1、mc_gross_2がある...
をitem_name10するitem_name1からのようになります税金1、税金2など..どのように数字を増やしてその値をデータベースに保存するのですか?
つの小さな注意点をループを実行します。 'num_cart_items'パラメータは、PayPalのIPNシミュレータによって提供されていません。ちょうど私が誰かがテストのためにそれを使用している場合に言及したいと思った。 –
Paypalボタンフォームで複数のアイテムを送信する方法 – Karthik
PHPで連結するには '.'を使用します。 – Aborted