Page 1 of 1

Payment time field clarifications

PostPosted: September 22nd, 2011, 11:50 am
by PseudoNyhm
I was under the impression that get_user_field("s2member_paid_registration_times") would give me all the past payments received for a user. However, it only appears to include:

  1. The initial Level 0 registration time
  2. The first Level 1 registration time

Any recurring payments are not included. Nonetheless, get_user_field("s2member_last_payment_time") will return the last known actual payment time.

For example, suppose the user first subscribed for Level 1 on Jul 9 (with monthly billing). Suppose this is billed again on Aug 9; get_user_field("s2member_last_payment_time") returns Aug 9, as expected. However, get_user_field("s2member_paid_registration_times") does not include Aug 9 (it only ever returns Jul 9 for the initial Level 1 payment).

  1. Can you clarify these fields for me?
  2. If the user's Level 1 subscription lapses (demoted to Level 0), then they re-subscribe at Level 1, will the "s2member_paid_registration_times" array replace the Level 1 timestamp with the new one (or will there be a second Level 1 timestamp)?
  3. Is there any way to get the full payment history (of each monthly recurring payment made)?

UPDATE: Another confusion: It seems that get_user_field("s2member_last_payment_time") will not return anything if the user is not currently a Level 1+ (even if they had paid recently). Is this accurate?

Re: Payment time field clarifications

PostPosted: September 25th, 2011, 5:09 pm
by Cristián Lávaque
Payment times, and other time logs, will be improved soon. This is something Jason is working on to allow for better content dripping control.

b. If they resubscribe, the original time won't be replaced, it remains as the first time it was paid.

c. You can create your own logs with a custom script and the Notifications API.

Re: Payment time field clarifications

PostPosted: September 25th, 2011, 6:17 pm
by PseudoNyhm
Thank you for the guidance. Collecting payment events via the Notification API is a fine idea. I look forward to the bookkeeping enhancements.

Re: Payment time field clarifications

PostPosted: September 27th, 2011, 9:31 pm
by Jason Caldwell
UPDATE: Another confusion: It seems that get_user_field("s2member_last_payment_time") will not return anything if the user is not currently a Level 1+ (even if they had paid recently). Is this accurate?
Yes, that's about it. Actually, this is a result of the EOT. When/if a Member is demoted, s2member_last_payment_time is dropped from the database, but this remains always: s2member_paid_registration_times

You can search for delete_user_option inside this file to see what is dropped during an EOT event. viewtopic.php?f=40&t=12996&src_doc_v=110927#src_doc_line_98

Re: Payment time field clarifications

PostPosted: September 27th, 2011, 9:51 pm
by PseudoNyhm
OK, thanks for the clarification. I think I understand the philosophy behind these fields now. (For the moment, I'm not going to dig any deeper, but I look forward to seeing what time log enhancements are included later.)