Welcome to WebmasterWorld Guest from 54.159.2.45

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Little help with a paypal variable

     

Sub_Seven

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

5+ Year Member



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 :)

Sub_Seven

5:07 pm on Oct 25, 2012 (gmt 0)

5+ Year Member



Looks like I've found it.

You can pass a unique ID like this:

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

...!

vincevincevince

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

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



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.