Open jpaulet opened 2 months ago
Useful links for Strip integration: https://docs.stripe.com/payments/checkout/how-checkout-works https://docs.stripe.com/checkout/embedded/quickstart
Stripe faucet PR: https://github.com/vocdoni/vocfaucet/pull/14
Stripe scaffold PR: https://github.com/vocdoni/ui-scaffold/pull/702
Stripce scaffold PR moved to calculator PR: https://github.com/vocdoni/ui-scaffold/pull/673
User Story:
As Vocdoni we want our potential clients, specially the integrator's to be able to estimate the election costs in tokens and in fiat. For that reason we need to create a new component to let, in a easy and quick way estimate the price of the election and purchase the needed tokens either with fiat or crypto.
To do so, we will introduce a new "calculator" component where the user can select the following parameters to estimate the election cost:
Once the user has introduced the values and click the "Estimate cost", it will trigger the calculation and show the needed tokens, the price per token and the price in fiat, and offer 2 ways of purchasing the tokens: fiat (stripe) and crypto (loop).
The results component will have 3 different tabs:
If the user wants to purchase any token (one-time or package) they need to be logged and with a valid organization. If the user is not logged, first we need to log-in. Once if logged, if the user has no org, a popup for create the org should appear. Once is logged and with a valid org, we can proceed with the purchase of the tokens, sending the needed info (e.g: orgName and wallet Address) to the payment platform:
Acceptance Criteria:
Frontend:
price_per_token
is 0.15. Also, the discounts from the "Package" tab should apply, i.e if a voting process costs 10K tokens, a 15% discount should apply.Backend:
Ops:
Ref:
Designs:
![Screenshot 2024-04-10 at 10-55-08 uizard](https://github.com/vocdoni/interoperability/assets/6894329/7e084104-c19e-4438-a77c-f2fdbb4002e7)