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):stringSimilar to (lib/share/index.js generateCode + readCode) Should include extra details from PaymentDetails - [ ]
generatePaymentQR(PaymentDetails):imageSame as above but create a QR containing above url - [ ]
validateTx(TxData):booleanReads fuse blockchain for txhash and check it has a Transfer log with theamount+sha3(invoiceid/data)paid torecipientin event log data - [ ]
async onPayment(recipient,invoiceid):PromiseListens 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 ?