Page 1 of 1

Not Handling Recurring Payments Cancellation

PostPosted: January 19th, 2011, 6:35 pm
by smitchell360
S2Member Pro is handling refunds just fine. However, if a recurring payments profile is cancelled, the message is not process appropriately. For example, I received the following message ... but this test user still has all membership levels and capabilities:

www.grccertify.org/?s2member_paypal_notify=1
array (
'payment_cycle' => 'Yearly',
'txn_type' => 'recurring_payment_profile_cancel',
'last_name' => 'Mitchell',
'next_payment_date' => 'N/A',
'residence_country' => 'US',
'initial_payment_amount' => '0.00',
'rp_invoice_id' => '1295479711:0 D:1 Y~www.grccertify.org~1:take_grc_professional_exam,take_grc_professional_exam_beg20110119_end20110126',
'currency_code' => 'USD',
'time_created' => '15:28:32 Jan 19, 2011 PST',
'verify_sign' => 'XXXXXXXXXXXXXXXXXXX',
'period_type' => 'Regular',
'payer_status' => 'unverified',
'test_ipn' => '1',
'tax' => '0.00',
'payer_email' => 'scott1@xxx.xxx',
'first_name' => 'Scott1',
'receiver_email' => 'proz_1295469628_biz@xxx.xxx',
'payer_id' => 'S4HAVWSGHW8M6',
'product_type' => '1',
'shipping' => '0.00',
'amount_per_cycle' => '189.00',
'profile_status' => 'Cancelled',
'charset' => 'windows-1252',
'notify_version' => '3.0',
'amount' => '189.00',
'outstanding_balance' => '0.00',
'recurring_payment_id' => 'I-LYV8YM3VL92B',
'product_name' => 'GRC Professional Certification Exam',
's2member_log' =>
array (
0 => 'IPN received on: Wed Jan 19, 2011 11:30:51 pm UTC',
1 => 's2Member POST vars verified through a POST back to PayPal®.',
2 => 's2Member originating domain ( _SERVER[HTTP_HOST] ) validated.',
3 => 's2Member txn_type identified as subscr_cancel|recurring_payment_profile_cancel.',
4 => 'Auto-EOT Time for this account: Fri Jan 20, 2012 11:29 pm UTC',
),
'custom' => 'www.grccertify.org',
'item_number' => '1:take_grc_professional_exam,take_grc_professional_exam_beg20110119_end20110126',
'period1' => '0 D',
'period3' => '1 Y',
'subscr_id' => 'I-LYV8YM3VL92B',
'item_name' => 'GRC Professional Certification Exam',
'ccaps' => 'take_grc_professional_exam,take_grc_professional_exam_beg20110119_end20110126',
'level' => '1',
)

Re: Not Handling Recurring Payments Cancellation

PostPosted: January 19th, 2011, 7:46 pm
by smitchell360
If I go ahead and issue a refund to that same customer (the one that I cancelled in the above transaction). All membership levels and capabilities are removed. This is the IP that I receive which is properly processed:

www.grccertify.org/?s2member_paypal_notify=1
array (
'mc_gross' => '-189.00',
'period_type' => 'Regular',
'outstanding_balance' => '0.00',
'next_payment_date' => 'N/A',
'protection_eligibility' => 'Ineligible',
'payment_cycle' => 'Yearly',
'payer_id' => 'S4HAVWSGHW8M6',
'payment_date' => '16:43:11 Jan 19, 2011 PST',
'payment_status' => 'Refunded',
'product_name' => 'GRC Professional Certification Exam',
'charset' => 'windows-1252',
'rp_invoice_id' => '1295479711:0 D:1 Y~www.grccertify.org~1:take_grc_professional_exam,take_grc_professional_exam_beg20110119_end20110126',
'recurring_payment_id' => 'I-LYV8YM3VL92B',
'first_name' => 'Scott1',
'mc_fee' => '-5.78',
'notify_version' => '3.0',
'amount_per_cycle' => '189.00',
'reason_code' => 'refund',
'currency_code' => 'USD',
'business' => 'proz_1295469628_biz@xxx.xxx',
'verify_sign' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'payer_email' => 'scott1@xxx.xxx',
'parent_txn_id' => '11903914M63402154',
'initial_payment_amount' => '0.00',
'profile_status' => 'Cancelled',
'amount' => '189.00',
'txn_id' => '9HX10935LM002344E',
'payment_type' => 'instant',
'last_name' => 'Mitchell',
'receiver_email' => 'proz_1295469628_biz@xxx.xxx',
'payment_fee' => '-5.78',
'receiver_id' => 'WPMD93LJ32ENA',
'mc_currency' => 'USD',
'residence_country' => 'US',
'test_ipn' => '1',
'receipt_id' => '3154-1967-8277-0980',
'transaction_subject' => '',
'payment_gross' => '-189.00',
'shipping' => '0.00',
'product_type' => '1',
'time_created' => '15:28:32 Jan 19, 2011 PST',
's2member_log' =>
array (
0 => 'IPN received on: Thu Jan 20, 2011 12:43:47 am UTC',
1 => 's2Member POST vars verified through a POST back to PayPal®.',
2 => 's2Member originating domain ( _SERVER[HTTP_HOST] ) validated.',
3 => 's2Member txn_type identified as [empty or irrelevant] w/ payment_status (refunded|reversed|reversal) - or - new_case w/ case_type (chargeback).',
4 => 'Member Level/Capabilities demoted to: Subscriber.',
),
'custom' => 'www.grccertify.org',
'item_number' => '1:take_grc_professional_exam,take_grc_professional_exam_beg20110119_end20110126',
'subscr_id' => 'I-LYV8YM3VL92B',
'item_name' => 'GRC Professional Certification Exam',
)

Re: Not Handling Recurring Payments Cancellation

PostPosted: January 24th, 2011, 3:40 pm
by geekstress
Hi Scott,

s2Member does this by design. When you or a user cancels a subscription, s2member considers that they have still payed for the current term and so they should continue to receive access. Their access is automatically removed at the end of the term that was paid for. A refund/reversal or chargeback gives the user back their money for the initial subscription period, so their access is immediately stripped. I don't see any options in s2member to alter this behavior, so I think if you want to do so it would require some custom modifications. It freaked me out in testing on my server, too, but once I saw the note in the API/Notifications section of the s2member administration menu, I realized this was actually the behavior I wanted, and is probably the correct behavior in most cases.

Re: Not Handling Recurring Payments Cancellation

PostPosted: January 24th, 2011, 3:43 pm
by smitchell360
Thanks.

After reflection...that probably makes sense. Any other exceptions can be handled manually.

Re: Not Handling Recurring Payments Cancellation

PostPosted: January 28th, 2011, 1:49 pm
by Cristián Lávaque
Yeah, I believe it's explained here, iirc.

http://www.s2member.com/paypal-modifica ... ons-video/