Jerome Ansia
Jerome Ansia

Reputation: 6884

PayPal IPN $_POST['txn_id'] not set

I'm using the PayPal sandbox to do a subscribe button and then when I get the IPN response for a subscription or a subscription cancelation $_POST['txn_id'] is never set.

So I don't know how to identify transactions to only accept unique ones

Thanks!

EDIT: for example all the info that I have in POST for a subscr_cancel are : amount1, amount3 , address_status, subscr_date, payer_id, address_street, mc_amount1, mc_amount3, charset, address_zip, first_name, reattempt, address_country_code, address_name, otify_version subscr_id custom payer_status business address_country address_city verify_sign payer_email btn_id last_name address_state receiver_email recurring txn_type item_name mc_currency residence_country test_ipn period1 period3 correlation_id

Upvotes: 6

Views: 4331

Answers (2)

johncc
johncc

Reputation: 918

Have you checked $_REQUEST['txn_id'] as this may be sent to your server via GET.

Upvotes: 0

Josh
Josh

Reputation: 8191

According to Table 2. Summary of subscription variables:

For subscription variables, the transaction ID (txn_id) is only available for USD Payment and Multi-Currency Payment transaction types (txn_type).

As expected, PayPal will not send the txn_id to your IPN for the transaction type, subscr_cancel, and will only send txn_id if the transaction type is subscr_payment.

For further explanation on which variables are sent to your IPN URL based on your transaction, please check out IPN and PDT Variables.

Upvotes: 6

Related Questions