If we reached the grant limit - we cannot create outgoing payments anymore, we display a screen in the popup (inactive icon + orange dot - user interaction) where the user will have the options to:
Set a new one time amount: we create a new grant for the amount that the user is going to specify and revoke the previous grant
Set a recurring amount: we create a new grant for the amount that the user is going to specify with a recurring interval (30d) and revoke the previous grant
When the user runs out of funds we need to update the extension state (new property in the storage - out_of_funds
User has a recurring amount
If we reached the grant limit, we display the same screen as in the one time amount scenario (same options + inactive icon - orange dot)
If the user sets a new recurring amount, we revoke the previous grant and create a new one with the specified amount
If the user wants to set a one time amount, we need to keep the previous grant, create a new one for the specified amount and use the one time grant for all future payments until the recurring amount is available again
When the recurring amount is available again we need to sum up the remaining amounts and we use recurring one until it runs out of funds again - no need to show the out_of_funds screen if we still have funds in the one time amount grant.
User has a one time amount
If we reached the grant limit - we cannot create outgoing payments anymore, we display a screen in the popup (inactive icon + orange dot - user interaction) where the user will have the options to:
User has a recurring amount
If we reached the grant limit, we display the same screen as in the one time amount scenario (same options + inactive icon - orange dot)
TODO:
out_of_funds
) - blocked by RS error codes (Rafiki + SDK update)