ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to retrieve entry_id from an IPN response

July 26, 2009 12:02am

Subscribe [3]
  • #1 / Jul 26, 2009 12:02am

    aimbot

    36 posts

    Hey all, i used on0 and os0 to send paypal the entry_id which it shows at the top of the webpage under the item information (entryid: 15) as an example. The IPN response sends a huge dump of information, and it doesnt look like it puts it into any kind of order.

    a:52:{s:8:"business";s:36:"[email protected]";s:14:"receiver_email";s:36:"[email protected]";s:11:"receiver_id";s:13:"AWSEEKRH94Z7S";s:9:"item_name";s:7:"Deposit";s:11:"item_number";s:1:"4";s:8:"quantity";s:1:"1";s:7:"invoice";s:0:"";s:6:"custom";s:2:"34";s:4:"memo";s:0:"";s:3:"tax";s:4:"0.00";s:12:"option_name1";[b]s:7:"entryid";s:17:"option_selection1";s:2:"15";[/b]s:12:"option_name2";s:4:"test";s:17:"option_selection2";s:2:"OK";s:14:"num_cart_items";s:0:"";s:8:"mc_gross";s:4:"5.50";s:6:"mc_fee";s:4:"0.46";s:11:"mc_currency";s:3:"USD";s:13:"payment_gross";s:4:"5.50";s:11:"payment_fee";s:4:"0.46";s:14:"payment_status";s:9:"Completed";s:14:"pending_reason";s:0:"";s:11:"reason_code";s:0:"";s:12:"payment_date";s:25:"18:04:04 Jul 25, 2009 PDT";s:6:"txn_id";s:17:"21465131TE911843A";s:8:"txn_type";s:10:"web_accept";s:12:"payment_type";s:7:"instant";s:10:"first_name";s:4:"Test";s:9:"last_name";s:4:"User";s:19:"payer_business_name";s:0:"";s:12:"address_name";s:9:"Test User";s:14:"address_street";s:9:"1 Main St";s:12:"address_city";s:8:"San Jose";s:13:"address_state";s:2:"CA";s:11:"address_zip";s:5:"95131";s:20:"address_country_code";s:2:"US";s:15:"address_country";s:13:"United States";s:14:"address_status";s:9:"confirmed";s:11:"payer_email";s:36:"[email protected]";s:8:"payer_id";s:13:"AZSJYBAUN85YY";s:12:"payer_status";s:8:"verified";s:9:"member_id";s:2:"34";s:11:"verify_sign";s:56:"ACUe-E7Hjxmeel8FjYAtjnx-yjHAAXLEcx37bDfWhW2vNclc-iQm4WHp";s:8:"test_ipn";s:1:"1";s:22:"protection_eligibility";s:8:"Eligible";s:7:"charset";s:12:"windows-1252";s:14:"notify_version";s:3:"2.8";s:17:"residence_country";s:2:"US";s:15:"handling_amount";s:4:"0.00";s:19:"transaction_subject";s:2:"34";s:8:"shipping";s:4:"0.00";s:11:"screen_name";s:4:"fyr3";}

    Does anyone have any thoughts on how to easily extract this information (the s🔢“15”; part). Ive thought of trying to load this into an array, or just doing a strpos but if anyone has a better way id love to know. Im basically trying to track what the person for and what weblog does it apply to. Thanks.

  • #2 / Jul 26, 2009 3:55am

    Ingmar

    29245 posts

    I’s a so-called serialized array. You’ll need to unserialize it, as it were, then use that array.

  • #3 / Jul 26, 2009 6:13am

    aimbot

    36 posts

    Awesome, thanks for the reply. After I posted this I read the extension dev docs and encountered this again for its settings so this clears things up 😊.

  • #4 / Jul 26, 2009 11:21am

    Mark Bowen

    12637 posts

    Just as a quick note if an IPN callback to your site index.php is successful from using the Simple Commerce Module then you can perform a quick SQL query joining the two tables - exp_simple_commerce_purchases and exp_simple_commerce_items to get at the entry_id too.

    I’ve done that a few times before but only really because I’m not very good with serialised data at the moment 😉

    Best wishes,

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases