graph LR
Funding -- funding transaction is rejected --> Failure
Funding -- funding transaction is accepted --> Funded
Funded -- payment attempt expires --> Refunding
Funded -- gateway cancels payment attempt --> Refunding
Funded -- payment is confirmed --> Success
Refunding -- payment is confirmed --> Success
Refunding -- ecash is minted --> Refunded
Refunding -- minting ecash fails --> Failure
graph LR
Pending -- payment is confirmed --> Claiming
Pending -- invoice expires --> Expired
Claiming -- ecash is minted --> Claimed
Claiming -- minting ecash fails --> Failure
it returns the preimage as a response to the post request so the payment can be shown to the user as settled as quickly as possible.
The forfeit signature is needed to proof to the federation that the gateway agrees to cancel the outgoing contract.