Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Little help with a paypal variable

2:20 am on Oct 25, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:June 18, 2010
posts: 170
votes: 1

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 :)
5:07 pm on Oct 25, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:June 18, 2010
posts: 170
votes: 1

Looks like I've found it.

You can pass a unique ID like this:

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

2:44 am on Nov 1, 2012 (gmt 0)

Senior Member from MY 

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

joined:Apr 1, 2003
votes: 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.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members