Azuriom / Plugin-Shop

A shop plugin to sell in-game items on your website.
https://market.azuriom.com/resources/1
MIT License
17 stars 30 forks source link

Remove expired pending payments from database #191

Closed crashzk closed 5 months ago

crashzk commented 5 months ago

Currently, when a payment is marked as status pending in the database, it is not displayed on the website in the payments tab. image

As you can see in the screenshot below, it only shows payments that have received a status other than pending. image

It would be interesting if even payments with a pending status were shown on the website in the payments tab.

And make sure that with these purchases with pending payment status, run a check again to check the payment status at least X times or mark it as status Error.

MrMicky-FR commented 5 months ago

Pending payments are just payment started but without any "real" payment yet, what would be the point of displaying them?

MrMicky-FR commented 5 months ago

Also it would very confusing to see a lot of pending/error payments, it suggests an issue with the payment gateway integration, while it’s 100% normal and only corresponds to incomplete payments.

For error payments, it’s a also a statut where a true error is associated (usually in the logs), and should never appear, or otherwise should be investigated (unlike incomplete payments which are expected on a production website)

crashzk commented 5 months ago

I understand, regarding these Pending payment statuses. It may at some point be changed, to Error for example.

In other words, after X amount of time it changes since it has not identified payment or anything.

Or does this status change need to be done by the payment method plugin in question that I'm using?

MrMicky-FR commented 5 months ago

I guess the solution would be to just delete these unused payments after some time as they are no longer necessary

crashzk commented 5 months ago

I guess the solution would be to just delete these unused payments after some time as they are no longer necessary

Yes, I thought about that too... In this case, I can delete these payments using the method I use, right, plugin in question?

Or do you think it's better to implement this feature directly in the Shop plugin so that it becomes the default for all payment methods you have that can be made?

MrMicky-FR commented 5 months ago

Yes makes more sense in the shop plugin as it's common to all gateways

crashzk commented 5 months ago

Yes makes more sense in the shop plugin as it's common to all gateways

Perfec @MrMicky-FR, I'll leave this issue to you, but it would take a long time to mark these pending payments, with an Error status.

Since some payment methods may take 3 business days to confirm payment, an example would be a bank slip. Anyway, curious to see how this issue will be handled in all payments.

In any case, thanks for now.