virto-node icon indicating copy to clipboard operation
virto-node copied to clipboard

Payment operations (superset of fee handler)

Open olanod opened this issue 6 months ago • 0 comments

The FeeHandler in payments pallet returns a list of fees, that is, percentages of the total amount being transferred that need to be credited from the sender/receiver and sent to designated accounts(e.g. a community's treasury)

To account for more use cases such as discounts and other incentives we can generalize the concept more using something like:

enum PaymentOperation {
    Fee { ... }, // sender/receiver are credited funds sent to third-party account
    Discount { ... }, // third-party account sponsors part of the payment
    DerivedTransfer { ... }, // third-party account transfers funds to another third-party
}

The DerivedTransfer can cover cases like affiliate rewards where a given entity(e.g. a token issuer) wants to incentivize another entity(e.g. a community) based on the parameters of the payment(e.g. utilizing a token)

olanod avatar Aug 01 '24 10:08 olanod