Invictusintl / coinbase-commerce-whmcs

A simple WHMCS gateway that uses the new Coinbase Commerce merchant tools https://commerce.coinbase.com/
GNU General Public License v3.0
17 stars 15 forks source link

over payment suggestion #6

Open PowerChaos opened 2 years ago

PowerChaos commented 2 years ago

hi, as i look true the code i think i found a solutiuon for the overpayment and the notice

it depends on what callback it sends , if it sends a failed callback or a pending callback or any kind of callback it can be logged

based on that log you can assign the invoice to pending or to a other status then "paid"

as you need the code that the user get is it impossible to get that code from the callback, as it is never sended in the callback

so to fix that , the user can assign a certain % in there account that can be over/under payment ofcourse if paid way to mutch , then it still fails but no way to get that to check or you need to write a lot of code to get that fixed

you should add then a way to check the bitcoin amount and the recieved amount, but also a converter to see how mutch it should actualiy need to be then that amount could be applied to the invoice then a user get under/over payment and no fails anymore

this also means that you need to add the option in coinbase to set error marge on 100% if you want to be able to over/under pay by 100%

so not sure if that is worth it , in meantime i rewrote the script a bit so it now logs everything and gives a warning on the user in case they over/under paid , i guess that warning should trigger if they also get a code from coinbase for the refund

Greetings from PowerChaos