GoodDAPP
GoodDAPP copied to clipboard
seller should have a payment api SDK
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 theamount
+sha3(invoiceid/data)
paid torecipient
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 @patpedrosa Does it still relevant or could be closed / moved to the IceBox ?