Ctrlpanel-gg / panel

CtrlPanel offers an easy-to-use and free billing solution for all starting and experienced hosting providers that seamlessly integrates with the Pterodactyl panel.
https://ctrlpanel.gg/
MIT License
390 stars 141 forks source link

[Bug]: purchase failed successfully #901

Closed kenshin133 closed 9 months ago

kenshin133 commented 11 months ago

What is your request about?

because of previous issues I do not have email setup, and that's important for the following issue.

when buying credits via the store (using a 100% off coupon) image I see there was an error image the coupon has NOT BEEN USED according to the panel, but an invoice was created, and also marked "paid" image image

The error complains basically about needing a "from" and "to" address, so Its expected this would fail, however its not expected that the invoice would be set paid when the coupon was not marked as used.

working : coupons, purchasing

Branch

development

Solution idea

its a bit complex but I would expect one of the following :

  1. coupon gets used, payment is taken, credits are awarded regardless of email failure.
  2. due to email failure no invoice is created, no coupon is deducted, and an error is given to user.

My vote is 1. since email is likely meant to be one of the last steps. and as a user I would rather everything else go right and I just don't get an invoice.

Alternatively a good 90% solution may to be stricter pre-purchase checks, I have no email settings set at all so that should be an easy red-flag.

Controlpanel Logs

[2023-07-29 22:06:16] production.ERROR: An email must have a "From" or a "Sender" header.

Additional Info

No response