Web: Expose an endpoint for providing Kudo claim links.

Created on 26 Dec 2018  路  2Comments  路  Source: gitcoinco/web

User Story

As a user that wants to give a Kudo, I want there to be a way to generate a claim link through which a recipient can claim the kudo.

Why Is this Needed

Currently, as far as I understand, there are three ways to send a Kudo:

  1. Sending a Kudo by sending it to a Github user.
  2. Sending a Kudo by sending it to a Gitcoin user.
  3. An admin generating an airdrop link that anyone can use to claim a Kudo.

This is needed so that users (not Admins) can generate their own airdrop links that their recipients can claim.

Description

Type: Feature

Current Behavior

Currently, there is no way for a user to generate a claim/airdrop link for a Kudo.

Expected Behavior

There should be a tool or endpoint that allows user to generate claim/airdrop links for Kudos.

Additional Information

To be provided by @owocki in comments. Discussion in slack.

Most helpful comment

IMHO the easiest way for this to work would be to have the user purchase the kudos from gitcoin, and then gitcoin's server generates an airdrop link for you to just put on the card.

basically we could expose an endpoint where you POST a txid and we validate that it is correct and give you a claim link.

validations to perform:

  • tx is successful
  • tx has not been used to create a BulkTransferCoupon before
  • tx is to the gitcoin kudos address
  • tx is for at least the cost of the Kudos + gas costs

if validation passes, create a BulkTransferCoupon object with a num_uses_total of 1, and give the code back to the API

All 2 comments

IMHO the easiest way for this to work would be to have the user purchase the kudos from gitcoin, and then gitcoin's server generates an airdrop link for you to just put on the card.

basically we could expose an endpoint where you POST a txid and we validate that it is correct and give you a claim link.

validations to perform:

  • tx is successful
  • tx has not been used to create a BulkTransferCoupon before
  • tx is to the gitcoin kudos address
  • tx is for at least the cost of the Kudos + gas costs

if validation passes, create a BulkTransferCoupon object with a num_uses_total of 1, and give the code back to the API

well, we have to secure that link, so we need to have the API also provide a "key" that needs to be added. Else someone can just go and grab all TXIDs and get the BulkCoupons from there.

Basically we'd want it to have the Gitcoin-Kudos-Pay route, with an extra flag that generates an link (as mentioned by owocki).
As soon as the TX comes back as successful (sync) and the flag is set in the ipfs json object, we:

  • generate a new secret (password) consisting of at least 8 chars (or add the field to BulkTransferCoupon)
  • generate the BulkTransferCoupon
  • send out the mail, or notify kudos-kards/subscriber -> maybe add a "callback" object to the json call which consist of a URL that gets called as soon as the call is done?

Basically I see the workflow as the following:

  • User selects a Kudos Card (for example)
  • --> User gets transfered to Kudos Payment Page, add "generate link" flag, "callback: Kudos Card URL"
  • --> User pays the transfer fee as usual with buying kudos
  • --> User returns to a "Thank you, please wait until the transaction is done" page, AJAX call to a backend to check for the API callback being called
  • (Gitcoin) System waits for confirmation on blockchain
  • --> Confirmation received:
  • --> Generate BulkTransferCoupon
  • --> Call callback with hash and key
  • (3rd Party / Kudos Card) --> received callback
  • --> store returned hash and key object, send mail
  • --> inform user action is done.

Like this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

frankchen07 picture frankchen07  路  4Comments

abitrolly picture abitrolly  路  4Comments

kuhnchris picture kuhnchris  路  4Comments

IgorPerikov picture IgorPerikov  路  3Comments

thelostone-mc picture thelostone-mc  路  4Comments