I am having some trouble creating a handler. What I need is similar to what I would need if I was using a PayPal IPN handler. Here is my code:
$time = date("m/j/Y g:i:s");
$email = $_POST['payer_email'];
$item = $_POST['item_name'];
$qty = $_POST['quantity'];
$code = $_POST['key'];
mysql_query("INSERT INTO orders (paydate, username, items, qty, code) VALUES ('$time', '$email', '$item', '$qty', '$code')");
It works, unless someone orders two different products at the same time. If someone orders the same item x2 it is also fine. Just when two different items are purchased then the item field is entered blank and the qty field is set to 0.
The guide says this for item specific:
Here, X represents the in-cart position of the item in this order:
item_nameX
item_numberX - item number you have set in product configuration
quantityX - quantity sold
and
item_cart_position - Only sent to Payment Variable Information URL (not Common Notification URL), this provides you with the value of X (in the names above) of the specific item for which order data is being sent your URL (since data for all items in the order will be included in the transmission)
I am lost on how to add cart position into my handler. I do not understand if it should be a column of its own in the database or if I somehow need to mix it in with what I already have.
$time = date("m/j/Y g:i:s");
$email = $_POST['payer_email'];
$item = $_POST['item_name'];
$qty = $_POST['quantity'];
$code = $_POST['key'];
mysql_query("INSERT INTO orders (paydate, username, items, qty, code) VALUES ('$time', '$email', '$item', '$qty', '$code')");
It works, unless someone orders two different products at the same time. If someone orders the same item x2 it is also fine. Just when two different items are purchased then the item field is entered blank and the qty field is set to 0.
The guide says this for item specific:
Here, X represents the in-cart position of the item in this order:
item_nameX
item_numberX - item number you have set in product configuration
quantityX - quantity sold
and
item_cart_position - Only sent to Payment Variable Information URL (not Common Notification URL), this provides you with the value of X (in the names above) of the specific item for which order data is being sent your URL (since data for all items in the order will be included in the transmission)
I am lost on how to add cart position into my handler. I do not understand if it should be a column of its own in the database or if I somehow need to mix it in with what I already have.