homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Little help with a paypal variable

Msg#: 4512047 posted 2:20 am on Oct 25, 2012 (gmt 0)

Hello all,

I am well aware that this question could very well NOT belong here but I visited one of paypal's support forums and it made me wanna cry so I'll try my luck here.

I am setting up a payment system and want to automate it as much as possible so I'm setting up paypal's Instant Payment Notification (IPN), if I use the Instant Payment Notification (IPN) simulator and give it a specific value on the "txn_id" field I get what I want, which is to update the status of a transaction on my DB.

Now, if I place a test order on paypal's sandbox everything is fine but it seems that paypal is not receiving my txn_id value and is sending the IPN with another value.

I am sending the txn_id like so:

<input type="hidden" name="txn_id" value="<?php echo $txn_id ?>" />

$txn_id is being retrieved from $txn_id = mysql_insert_id(); (I'm inserting the data of the order prior to sending the client to paypal) just so I can update the status from pending to completed when I receive the IPN.

I guess the final question is why is Paypal replacing or not using the data I'm passing as txn_id?

Thanks for any help provided :)



Msg#: 4512047 posted 5:07 pm on Oct 25, 2012 (gmt 0)

Looks like I've found it.

You can pass a unique ID like this:

<input type="hidden" name="invoice" value="<?php echo $invoice ?>" />



WebmasterWorld Senior Member vincevincevince us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4512047 posted 2:44 am on Nov 1, 2012 (gmt 0)

You can do that, but be careful, as it isn't hard for your customer to change that invoice ID in your hidden field before sending it to PayPal. You probably want to be signing your transactions as wel.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved