Okay
  Public Ticket #4517308
Credit
Open

Comments

  • Bartłomiej started the conversation

    Hello,

    I am using the B2BKing Company Credit addon and I would like to request an enhancement to the credit logic that would be very useful for real-world net payment / credit terms.

    Currently, B2BKing stores the credit data in user meta, for example:

    • b2bking_user_credit_limit – user credit limit
    • b2bking_user_credit_consumed_balance – used credit
    • available credit = limit - consumed

    I would like to ask you to add an optional time-based blocking logic, based on a configurable number of days and a default credit amount:

    1. Global “days to block” setting (for example 7 days)

      • In the Company Credit settings, please add a global option such as:
        “Number of days to restore credit before blocking the account (X days)”
      • Example: 7 days.
    2. Block the account if, after 7 days, the credit is not restored to the default amount

      • When a customer places an order using the Company Credit payment method and the order reaches a specific status (for example “Completed”), the system should start a countdown period for that user (e.g. save a “credit period start” date in user meta).
      • If, after the configured number of days (for example 7), the customer’s available credit is still not equal to the default/initial amount (i.e. the credit has not been fully restored), their account should automatically be blocked:

        • the customer should no longer be able to place new orders on credit,
        • optionally, they could be prevented from accessing checkout or from seeing the credit payment method.
    3. 0 days as a test mode (instant block)

      • If the “days to block” setting is 0, the logic should work in an instant mode:

        • as soon as the user’s available credit is different from the default amount, the account is immediately blocked,
        • this is useful for testing or very strict credit policies.
    4. Changing order status to “Completed” restores the credit and unblocks the account

      • I would also like an option where, when a specific order is marked as “Completed” (for example after the customer pays the invoice), the system automatically restores the credit and unblocks the account.
      • In practice this could mean:

        • resetting b2bking_user_credit_consumed_balance to 0 (or to a value where available credit again equals the default/limit),
        • clearing the “credit period start” meta,
        • changing the account status from blocked/expired back to active,
        • so as soon as the invoice is paid and the order is completed, the customer regains their full credit and can place new orders again.
    5. Summary of the expected behaviour
    • Placing an order with Company Credit and changing its status to “Completed” starts the time period (e.g. 7 days).
    • If, within those 7 days, the available credit returns to the default value (the full credit is restored), the account stays active and the period can be reset.
    • If after 7 days the available credit is still not back to the default value, the account is automatically blocked.
    • If the “days to block” setting is 0, the account is blocked immediately as soon as the credit deviates from the default amount (instant test mode).
    • Changing the order status to “Completed” in the context of payment/settlement should be able to restore the full credit and unblock the account.

    This kind of logic would perfectly match real credit terms in B2B: the customer has a defined credit limit and a defined time window to restore it; otherwise, the account is blocked until payment is registered.

    Could you please consider adding such a feature to the B2BKing Company Credit addon (for example as an optional setting)? It would be extremely helpful for B2B shops working with 7/14/30 days payment terms and would make automated risk and credit control much easier.

    Thank you in advance for your response and for letting me know if this can be implemented in a future update.

    Best regards

  • Bartłomiej replied

    The current version of the crediting system is very, very limited. I drafted a sketch with the help of AI, and it would be really great if something like this could be implemented in their plugin.

    https://pastebin.com/jFxuQGKF