http://wallet.gooddollar.org:3000/? code=eyJtIjoiM2RQQjRxUjNBZUoyY0tzalJnYWp3dE1hUms3TjI0aFVMZzYiLCJhIjoiM...the query param code is the base64 encrypted value returned from generateCode
The generated code should return an object with the paymenDetails params and the ones that we already have
Same as above but create a QR containing the payment link from the generatePaymentLink method described above.
I suggest https://www.npmjs.com/package/qrcode for generating the image
[ ] 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)
Motivation
Sellers should be able to process Gooddollar payments through our API.
For example:
A Seller like e-commerce for "brand" would like to be able to request payment from his customers at Gooddollar.
Details
Seller API
Create a typescript NPM module that works both on browser/node that implements the following methods
[ ]
generatePaymentLink(PaymentDetails):string
generateCode + readCode
)Should include extra details from PaymentDetails
Example:
http://wallet.gooddollar.org:3000/? code=eyJtIjoiM2RQQjRxUjNBZUoyY0tzalJnYWp3dE1hUms3TjI0aFVMZzYiLCJhIjoiM...
the query param code is the base64 encrypted value returned from generateCode
The generated code should return an object with the paymenDetails params and the ones that we already have
Example:
[ ]
generatePaymentQR(PaymentDetails):image
generatePaymentLink
method described above. I suggest https://www.npmjs.com/package/qrcode for generating the image[ ]
validateTx(TxData):boolean
amount
+sha3(invoiceid/data)
paid torecipient
in event log data[ ]
async onPayment(recipient,invoiceid):Promise
Types
TxData: { txHash, recipient, amount invoiceId, data? }