I'm a little lost here. This issue has been going on sporadically for at least two years so wiping out our database to restore even one month old records is a non starter.
Here's some more information that I'm finding as I try to understand the issue. The baskets show proof that a membership and/or a donation was made. The missing member even has given us records of the missing payment from their end as evidence of them appearing in the Baskets section of CB Subs. The subscription is not showing up in the Subscriptions section of CB Subs, and of course the users are not showing up in the Users area of Joomla.
I've written SQL code to find all missing members that are not in the users table but are in the cbsubs_payment_baskets. Here's the script:
Code:
SELECT payment_date,
id,
user_id,
item_name,
first_name,
last_name,
address_name,
address_street,
address_city,
address_state,
address_zip,
payer_email,
contact_phone
FROM `dto85_cbsubs_payment_baskets` AS pb
WHERE pb.user_id NOT IN
(
SELECT id FROM dto85_users
) AND
item_name like '%Member%';
This shows that the members are in the subscriptions table despite not showing up in the admin portal:
Code:
SELECT id,
user_id,
subscription_date
FROM `dto85_cbsubs_subscriptions` as s
WHERE s.user_id NOT IN
(
SELECT id FROM dto85_users
)
There's something going on in the process of a
NEW member signing up at the same time they are subscribing through CB Subs. In other words, the same form that takes subscription information for a NEW user collects NEW user information for the Joomla insert. This means that the process of subscribing handles the creation of the new member. I get that you're not on the hook for actually creating the user in the user table, but you must be calling the PHP Joomla routine somewhere in the sequence of the subscription. I would think that you'd create the user first, then process the subscription using the user ID returned from the Joomla service. My feeling is the transaction of creating a user, creating a basket, and then creating a subscription is not atomic.
Here's what I'd like some help in.
- Can you explain the sequence of how you create a new user at the same time you create a subscription and payment? Specifically how you know of the user ID to insert it into the subscription and baskets tables.
- My prevailing thought is we've had some server resource issues during these times as we get spikes in membership signups and renewals. It is seasonal. Assuming you WILL get failures in the process described above, what type of checks should you make to ensure that a payment has a corresponding user? How do you make this create user/payment/subscription an atomic transaction or short of making it atomic, log the fact that something went amiss?
- We need to restore members so they exist in Joomla. You must know how this is done as you are likely making this call to Joomla services. If you do not want to help us with the above, at least point out where in your code you create the user, create a basket, and create a subscription record. We will need to recreate it to restore the user information manually.