vocdoni / interoperability

Private repository to manage the interoperability between protocol, API, SDK, UIs and documentation
1 stars 0 forks source link

Election cost Calculator & Payment Gateways #180

Open jpaulet opened 2 months ago

jpaulet commented 2 months ago

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:

Packs (Nº Tokens) | Discount (%) | TOTAL (€) 1000 | 1% | 149€ 5000 | 7% | 697€ 10.000 | 15% | 1275€ 50.000 | 21% | 5925€ +100.000 | 30% | 10.500€

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:

Backend:

Ops:

Ref:

Designs: Screenshot 2024-04-10 at 10-54-52 uizard Screenshot 2024-04-10 at 10-55-23 uizard Screenshot 2024-04-10 at 10-55-08 uizard

emmdim commented 2 months ago

Useful links for Strip integration: https://docs.stripe.com/payments/checkout/how-checkout-works https://docs.stripe.com/checkout/embedded/quickstart

emmdim commented 1 month ago

Stripe faucet PR: https://github.com/vocdoni/vocfaucet/pull/14

emmdim commented 1 month ago

Stripe scaffold PR: https://github.com/vocdoni/ui-scaffold/pull/702

emmdim commented 3 weeks ago

Stripce scaffold PR moved to calculator PR: https://github.com/vocdoni/ui-scaffold/pull/673