The redirect after return to shop did not handle the case of when the invoice was settled. This happens with LN payments that settle immediately. Also if you click on the redirect link in the BTCPay invoice details after an on-chain invoice is settled.
This only handles that case and fixes above mentioned issue. Ideally all possible invoice states should be covered, e.g. partial payment, invalid etc. Would need a bit more refactor to structure things a bit better, - should I do that or we good for now? What you think @woutersamaey?
We may also want to cover the default case. The error happens because redirect initialized but not followed by ->setUrl() afterwards if the invoice status is not handled. See https://magento.stackexchange.com/a/333061
Fixes #11
The redirect after return to shop did not handle the case of when the invoice was settled. This happens with LN payments that settle immediately. Also if you click on the redirect link in the BTCPay invoice details after an on-chain invoice is settled.
This only handles that case and fixes above mentioned issue. Ideally all possible invoice states should be covered, e.g. partial payment, invalid etc. Would need a bit more refactor to structure things a bit better, - should I do that or we good for now? What you think @woutersamaey?