GoodDAPP icon indicating copy to clipboard operation
GoodDAPP copied to clipboard

Bounty: Wallet payment API

Open sirpy opened this issue 3 years ago • 21 comments

GoodDollar is a non-profit project, delivering digital basic income to tens of thousands of daily users in the form of the G$ token. This bounty is about improving the wallet (wallet.gooddollar.org), adding a simple serverless payment API capabilities with retailers.

Motivation

  • User should be able to pay online with his G$ wallet
  • Sellers should be able to request payment in G$ on their websites

Details

  • contact us on discord/telegram for help setting up dev env for the wallet and walkthrough the bounty
  • you can complete tasks separately for the specified bounty for each task

User Flow and wallet specificaitons

  • User scans QR or press on payment link

  • Link will contain extra information (see below PaymentDetails)

  • [x] Task1 (1 hour = 30$) - parse the following data from payment link (lib/share/index.js generateCode + readCode)

    • [x] Callback url - notify seller backend once payment has been sent
    • [x] Invoice # - seller identifier of tx
    • [x] website - seller website
    • [x] seller/store name
  • User then sees the payment request summary page

  • [x] Task2(8 hours = 240$) - In payment confirmation screen (SendLinkSummary.js, SummaryGeneric.js) also show :

    • [x] Callback url/website
    • [x] Invoice #
    • [x] Show notification that TX details + email + name will be sent back to website + seller
    • [x] Editable field for email + name (so seller can contact you)
  • Once user confirms TX is created and details sent to seller and saved in feed

  • [x] Task 3 (4 hours = 120$) - support saving extra information and calling seller callback url

    • [x] Add to feed item (SendLinkSummary.js onTransactionHash) the following data
      • senderEmail - email entered by user
      • senderName - name entered by user
      • invoiceId - invoice # from seller read from link/qr
      • sellerWebsite - website from seller read from link/qr
      • sellerName - seller/store name read from link/qr
    • [x] When calling sendAmount (in SendLinkSummary.js) add parameter txIdentifier and pass invoice #
      • In GoodWallet sendAmount when invoice is not empty use transferAndCall with txIdentifier hash (sha3) as data
    • [ ] Send in callback url via POST
      • [ ] senderEmail
      • [ ] senderName
      • [x] Tx hash
      • [x] Invoice #
  • Seller should see payment extra details on his G$ wallet. If you did task 3 correctly, the seller wallet should have those details once TX is received. the fields will be in feed item item.data

  • [ ] Task 4 (4 hours = 120$) - show payment details in feed item and in feed item modal (FeedListItem.js, FeedModalItem.js)

    • [ ] In feed item show under name of sender: invoiceId + sellerWebsite
    • [ ] In feed item modal show: senderEmail + invoiceId + sellerWebsite

Seller SDK

  • Create a typescript npm module that works both on browser/node that implements the following methods
  • [ ] Task 5 (16 hours = 480$)
    • [ ] generatePaymentLink(PaymentDetails):string Similar to (lib/share/index.js generateCode + readCode) Should include extra details from PaymentDetails
    • [ ] generatePaymentQR(PaymentDetails):image Same as above but create a QR containing above url
    • [ ] validateTx(TxData):boolean Reads fuse blockchain for txhash and check it has a Transfer log with the amount + sha3(data | invoiceid) paid to recipient in event log data
    • [ ] async onPayment(recipient,invoiceid):Promise Listens to Transfer event with to=recipient and data=sha3(data | invoiceid) resolves promise once event detected
Types
PaymentDetails: {
  recipient,
  amount,
  reason,
  category,
  invoiceId,
  sellerName?,
  sellerWebsite?,
  callbackurl
}

TxData: {
  txHash,
  recipient,
  amount
  invoiceId
}

sirpy avatar Mar 17 '21 10:03 sirpy

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 6000000.0 G$ (1200.0 USD @ $0.0/G$) attached to it as part of the GoodDollar fund.

gitcoinbot avatar Mar 21 '21 09:03 gitcoinbot

@bertux Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Mar 25 '21 16:03 gitcoinbot

@bertux Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Hello, yes I still work on this issue and I will a WiP PR to track the progress. I am still waiting for environment configuration file from @sirpy but it's not blocking me yet to setup the development environment needed.

bertux avatar Mar 28 '21 11:03 bertux

@bertux Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Mar 31 '21 16:03 gitcoinbot

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@bertux due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] reminder (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Apr 03 '21 16:04 gitcoinbot

Hello, I've received the needed file for tests and I work to be able to test locally before doing any modification. I will submit changes in PR when I will have some.

bertux avatar Apr 05 '21 18:04 bertux

@bertux Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Apr 09 '21 16:04 gitcoinbot

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@bertux due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] reminder (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Apr 12 '21 16:04 gitcoinbot

I'm not working full time on it and there is no time constraints imposed, that explains why I'm not very active on it yet but I'm still contributing to GoodDollar projects.

bertux avatar Apr 15 '21 08:04 bertux

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 265 years, 5 months from now. Please review their action plans below:

1) nicholascioli has started work.

Hello,

I like the purpose of this coin and would love to contribute.

Let me know what is left to do. -- Nick

Learn more on the Gitcoin Issue Details page.

gitcoinbot avatar Apr 19 '21 19:04 gitcoinbot

Hey, you can read my my statement above. Can someone please create a repo under this org for the typescript sdk that I can push or update with PR in?

sno2 avatar Apr 26 '21 20:04 sno2

@sno2 https://github.com/GoodDollar/PaymentSDK

sirpy avatar Apr 27 '21 06:04 sirpy

@sirpy Sorry, I can't work on the bounty. I couldn't figure out a way to asynchronously generate images as QR codes in Uint8Array. All of the qr code npm packages I could find were using callbacks which I could of course promisifiy, but they injected the qr codes into an HTML canvas. However, you can't access the canvas any DOM elements in Node.js which blocked my entire work.

sno2 avatar Apr 29 '21 04:04 sno2

@sno2 lets skip the QR part for now, i'll research it. i'm not sure why you have an issue, you can use the same QR package we use on the wallet. but in the meantime generating payment link is enough

sirpy avatar Apr 29 '21 06:04 sirpy

@sno2 this package seems to support async/await and nodejs https://www.npmjs.com/package/qrcode

sirpy avatar Apr 29 '21 08:04 sirpy

this works perfectly fine in the above package, it returns an image in base64 that can be used directly in <img>

qr.toDataURL("https://xx.com").then(console.log)

sirpy avatar Apr 29 '21 08:04 sirpy

@sno2 ??

sirpy avatar May 03 '21 12:05 sirpy

@sno2 ??

Sorry I have exams this week. I had time to do it last week but not now. I already cancelled my offer.

sno2 avatar May 03 '21 12:05 sno2

  1. finish current PR (need design #3279)
  2. move 3.4.5. to the separate tasks

serdiukov-o-nordwhale avatar Jul 15 '21 11:07 serdiukov-o-nordwhale

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 6000000.0 G$ (1200.00 USD @ $0.0/G$) attached to this issue has been cancelled by the bounty submitter

gitcoinbot avatar Nov 21 '21 13:11 gitcoinbot

@sirpy @patpedrosa Does it still relevant or could be closed / moved to the IceBox ?

johnsmith-gooddollar avatar Aug 16 '22 12:08 johnsmith-gooddollar