1 / 7
Oct 2010

I have been having a lot of problems trying to get the HTTP POST to send the correct data to my database after it is sent to my website. I have been trying to figure it out for a long time and still cannot. Anyways I took the data that was sent to my site and sent it to a .txt file and this is my result for a purchase of two items.



Array

(

[residence_country] =>

[payer_business_name] =>

[first_name] => removed

[last_name] => removed

[payer_email] => removed

[payer_phone] =>

[payer_street] =>

[payer_city] =>

[payer_state] =>

[payer_zip] =>

[payer_country_code] =>

[address_name] =>

[address_business_name] =>

[address_phone] =>

[address_street] =>

[address_city] =>

[address_state] =>

[address_zip] =>

[address_country_code] => US

[address_country] => US

[payment_date] => 10:28:20 Sep 10, 2010 MST

[custom] =>

[mc_currency] => USD

[business] => f3f04d0fd4818dd82cf93551993adef4

[mc_gross] => 0

[mc_shipping] => 0

[tax] => 0

[txn_type] => ejgift

[payment_type] => Instant

[invoice] => 2lugd9atv151231jvdq6pwf8aso80wgs040ogow

[buyer_ip] =>

[card_last_four] =>

[card_type] =>

[mailing_list_status] => false

[charset] => utf-8

[item_name1] => handlertest1

[item_number1] => 799225

[mc_gross_1] => 0

[quantity1] => 1

[item_name2] => handler test 2

[item_number2] => 799226

[mc_gross_2] => 0

[quantity2] => 1

[num_cart_items] => 2

[txn_id] => jg-l8jedkb730f3a53

[payment_status] => Completed

[pending_reason] =>

[handshake] => ca48389c1752a983a0c8948e583c0023

[discount_codes] =>

[from_name] => GSG

[from_email] => removed

[client_shipping_method_id] => 0

[item_cart_position] => 2

[item_number] => 799226

[sku] =>

[expiry_hours] => 120

[max_downloads] => 5

[key] => 546

)



There is a key for both items in this purchase, but there is only one key field?

If you're using the product-specific Payment Variable Information URL, then only the key issued for that product would be sent to that URL.



E.g., here you have [item_cart_position] => 2, so that indicates this particular submission was POSTed for [item_number2] => 799226, so that tells you which product the [key] => 546 was issued for. If the other product in the order also issued a key, that key would be disclosed in a separate submission to the Payment Variable Information URL you'd configured for that other product, so you'd want to look for another submission where [item_cart_position] => 1 for the same [txn_id] => jg-l8jedkb730f3a53, and get the [key] value from that submission.

So all the other information other than the second key is there?

Im am just using product specific for now, IF I can ever figure out how to make this handler work then it will be a general URL for all items.

Let's suppose you have two products that each issue a key and send the order data to a URL.



The order-data submission that is sent to the URL specified in Product 1's settings would only include the key issued for Product 1. The submission sent to the URL specified for Product 2 would only include the key issued for Product 2. If both products happen to be configured to submit data to the same URL, then that URL would receive two submissions, one for each product.

Yeah I actually figured out last night that my biggest problem was actually that I had it set to product specific. I just forgot to post that here.



However now that I do have it pretty much working, it is posting the correct information to my database, but then it is reposting the second information just without the key. All other info is there, just not the key, and it is a duplicate row. I cannot find anything in my code that should make it do that (not saying its not there) but I was wondering if e-junkie did send it twice or something along those lines.

Could it be sending once as an order and then again as completed?

If you have set up a Common Notification URL (in Seller Admin > Account Preferences), that would receive a submission of order data in addition to any product-specific Payment Variable Information URLs you may have configured for items in the order.