Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment validation #6

Open
olanod opened this issue Mar 6, 2022 · 0 comments
Open

Payment validation #6

olanod opened this issue Mar 6, 2022 · 0 comments
Milestone

Comments

@olanod
Copy link
Member

olanod commented Mar 6, 2022

I propose creating another interface that acts like a pre-payment hook which does an early validation of the payment information and rejects it if it doesn't fulfill some requirements.
We pass it the payment info preferably wrapped in a struct to avoid breaking changes in the trait definition,

struct PaymentIntent<T: Config> {
    from: T::AccountId,
    recipient: T::AccountId,
    asset: AssetIdOf<T>,
    amount: BalanceOf<T>,
    remark: Option<&[u8]>,
}

Early payment validation has several uses like being able to reject payments based on the amount, check if the remark has the right structure, check if recipients are allowed to receive a payment with a given remark(i.e. is a merchant registered in the marketplace?), check if a kind of product is allowed, etc.

@olanod olanod added the payments label Mar 6, 2022
@olanod olanod transferred this issue from virto-network/virto-node Mar 20, 2022
@olanod olanod added this to the Payments V1 milestone Mar 20, 2022
@olanod olanod removed the payments label Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant