Skip to Content Skip to Menu

[SOLVED] Incorrect ID assigned to subscription

  • solferry
  • solferry
  • OFFLINE
  • Posts: 26
  • Thanks: 1
  • Karma: 0
8 years 6 months ago - 8 years 6 months ago #280112 by solferry
Dear,

Currently I am troubleshooting some issues with payments where it seems CBSUbs applies the incorrect ID towards the subscription.
Current situation is when a user pays, he activates the previous user subscription.

It makes sense it goes wrong as when I check the current index in my database it says:

Next Autoindex ID = 48

Where if I check the CB Paid Subscriptions: General plugin settings -> Invoices,
it says:

Next invoice [NUMBER] that will be used 47

How can it be the GUI says 47 and the database 48?

Thanks in advance!
Last edit: 8 years 6 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • solferry
  • solferry
  • OFFLINE
  • Posts: 26
  • Thanks: 1
  • Karma: 0
8 years 6 months ago #280114 by solferry
Replied by solferry on topic Incorrect user assigned to subscription
As an addition.. I tried overwriting the thing by editing the "Reset next Invoice [NUMBER] to".

I used 50 just to test... but for some reaon it still used 47 ?! ...

Please Log in or Create an account to join the conversation.

  • solferry
  • solferry
  • OFFLINE
  • Posts: 26
  • Thanks: 1
  • Karma: 0
8 years 6 months ago #280118 by solferry
Replied by solferry on topic Incorrect user assigned to subscription
one step further...

I altered the AutoIncrement index to -1.
I expect while editing the database a record was added or duplicate entered (not sure what happened.. but the database AutoIncrement index was 1 ahead of what CBSUbs Thought it was).

Eventually ending up in having to alter the AutoIncrement Index value in the database

SQL: alter table tablename AUTO_INCREMENT={value}

This seems to 'solve' the issue for now.. but I have my concerns regarding the $_POST value used to create the subscription.

Where does CBSubs get this value from?
It seems the invoice number is not the custom variable but just the invoice number and my guess is CBSubs Assumes the AutoIncrement is identical or am I incorrect?

For me, as said, it works for now.. but I don't want such a thing happening again in the future and trying to understand what the reason was for the mismatches.

Could you guys shed any light on this one?
Thanks!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
8 years 6 months ago - 8 years 6 months ago #280146 by krileon
Replied by krileon on topic Incorrect user assigned to subscription
Renewals do not generate a new invoice. For CBSubs a Basket = Invoice. Renewals simply renew the existing basket. Auto incremented ID is not the invoice number. The invoice number is stored in the invoice column of _cbsubs_payment_baskets. I highly suggest you do not alter the database.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 8 years 6 months ago by krileon.
The following user(s) said Thank You: solferry

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • OFFLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
8 years 6 months ago #280151 by beat
Replied by beat on topic Incorrect user assigned to subscription
To be complete:
- Autorecurring renewals do not generate a new invoice for 2nd to last payment.
- Manual renewals do generate a new basket and invoice, but not a new subscription (if it is a renewal or a re-activation and not an upgrade)

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info
The following user(s) said Thank You: krileon, solferry

Please Log in or Create an account to join the conversation.

  • solferry
  • solferry
  • OFFLINE
  • Posts: 26
  • Thanks: 1
  • Karma: 0
8 years 6 months ago - 8 years 6 months ago #280164 by solferry
Replied by solferry on topic Incorrect user assigned to subscription
thanks guys for clearing that out.. I did indeed mistaken the invoice number with the id field in the database.

From your remarks I could see I made a wrong assumption based on maybe a bad explanation form my side :).

When a user registers, a new user is added within '__cbsubs_subscriptions'.
As i had to create a own method for my users to be able to pay with a dutch payment gateway I simply used the $_POST-custom variable as i thought this was the ID used in '__cbsubs_subscriptions'.... but it is used for the payment_basket.

As these tables where 1 ID of (payment basket AI_number was 47 and cbsubs_subscriptions was 48_.. it would result in such a behavior that user #48 would activate the account of user#47 bij paying.

Unfortunately I don't have the money to invest so you guys could create a proper payment gateway.. but I understand that with my limited knowledge about CB Subs that would be great investment when we receive a couple of payments :-).

thanks again guys.
Last edit: 8 years 6 months ago by solferry.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum