GoodDAPP icon indicating copy to clipboard operation
GoodDAPP copied to clipboard

seller should have a payment api SDK

Open sirpy opened this issue 3 years ago • 1 comments

Seller SDK

  • Create a typescript npm module that works both on browser/node that implements the following methods
    • [ ] 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(invoiceid/data) paid to recipient in event log data
    • [ ] async onPayment(recipient,invoiceid):Promise Listens to Transfer event with to=recipient and data=sha3(invoiceid/data) resolves promise once event detected
Types
PaymentDetails: {
  recipient,
  amount,
  reason,
  category,
  invoiceId,
  data?,
  sellerName?,
  sellerWebsite?,
  callbackurl
}

TxData: {
  txHash,
  recipient,
  amount
  invoiceId,
  data?
}

sirpy avatar Jul 20 '21 11:07 sirpy

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

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