You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the web monetization extension (and very likely other use cases), we should know how much has already been spent on the outgoing payment grant.
Whenever we create an outgoing payment, we determine whether the amount for the payment fits within the limits of the issued outgoing payment grant (by summing up all of the other payment that have been created under that said grant). If not, we reject the payment, otherwise, we create it. This accounting is done in the Open Payment resource server (the backend package), because that is where all of the outgoing payments are stored. In the auth server, we only know what the limit for the grant is, but not how much has been spent on it already.
This concerns the Open Payments outgoing payment, meaning there will be no changes in the Admin GraphQL API.
Return grantSpentDebitAmount: Amount and grantSpentReceiveAmount: Amount. Both of these values are optional (since it is optional to specify the limit amounts when creating the outgoing payment grant in the first place.
The text was updated successfully, but these errors were encountered:
mkurapov
changed the title
Return the remaining balance on the outgoing payment grant
Return amount spent on the outgoing payment grant during outgoing payment creation
May 8, 2024
We talked about the reason for only returning on outgoing payment create, and that is because that is where the accounting is happening. We don't want to repeat that logic in a GET (especially for an entire page). We also concluded that returning in the create is sufficient for the webmon use-case.
Out of scope for this task but I wonder if there would ever be a use case for looking it up later. In that case I guess we could store it in the db on create. Although I imagine that could be stale by the time it's looked up.
Context
For the web monetization extension (and very likely other use cases), we should know how much has already been spent on the outgoing payment grant.
Whenever we create an outgoing payment, we determine whether the amount for the payment fits within the limits of the issued outgoing payment grant (by summing up all of the other payment that have been created under that said grant). If not, we reject the payment, otherwise, we create it. This accounting is done in the Open Payment resource server (the
backend
package), because that is where all of the outgoing payments are stored. In the auth server, we only know what the limit for the grant is, but not how much has been spent on it already.This concerns the Open Payments outgoing payment, meaning there will be no changes in the Admin GraphQL API.
Todos
grantSpentDebitAmount: Amount
andgrantSpentReceiveAmount: Amount
. Both of these values are optional (since it is optional to specify thelimit
amounts when creating the outgoing payment grant in the first place.The text was updated successfully, but these errors were encountered: