6
votes

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

2
Can you confirm that you are indeed receiving an IPN to your IPN URL? For instance, are any other PayPal $_POST variables set?Josh
Yes I got all other data in POST, even the txn_type so that's weird that I don't have the txn_idJerome Ansia
Thanks for the edit. That helps a lot. My explanation below should clear up your problem.Josh

2 Answers

6
votes

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.

0
votes

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