• This is in sellImportedLicenseKeys

    if (!is_array($licenses) || count($licenses) <= 0) {
    throw new Exception(‘License Keys are invalid.’);
    }

    It should not throw an exception when count($licenses) == 0
    Or the code should make a check for ($availableStock !=0) before call

    Because this is normal situation when keys are over.
    For example user bought 2 products. And for one of them keys are over. He will not get keys for another product.
    Another exmpple is when user boughts 2 keys and only 1 key is available. And another user boughts 1 key and no keyas are available. The first order will be OK. But for the second order my plugin breaks and order status was not changed to complete. But here should be similar behaviour.

    Or the user bought 3 products. And there no keys for the second product. The keys will be sold for the first product and not for the 3rd product. And this is not clear.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Exception when there no keys availabe’ is closed to new replies.