GoodDollar Payments
The GoodWallet works using payment links. Any vendor can create a simple payment request link that can be used on its website to start the payment process.
G$ wallet works using payment links. Any vendor can create a simple payment request link that can be used on its website to start the payment process.
Payment Flow
User press on payment link on vendor website
GoodDollar wallet is opened with a confirmation screen showing payment details
Once user confirms, wallet sends transaction details via callback url defined by the vendor
vendor website upon receiving response via callback closes the wallet window and continues the checkout flow
Generating The Payment Link
The payment link has the form of:
https://wallet.gooddollar.org/?code=<safebase64encodedparams>
The code parameter is a base64 encoded object with the following fields
Example:
Next, to encode it, you can run the following javascript code:
The final payment link would be: https://wallet.gooddollar.org/?code=eyJtIjoiM2RNa3lFWjFRRkx3aTJhb1VOa2ZWNkI4WGU1czVlRncybmQiLCJhIjoyNS4zLCJyIjoiVGhlIENvbW1vbmlzdHMgTWFuaWZlc3RvIiwiY2F0IjozLCJ2ZW4iOnsiY2J1IjoiaHR0cHM6Ly9ib29rc3RvcmUueHl6L2JhY2tlbmQvcGF5bWVudGNhbGwiLCJpbmQiOiIxMjM0LXVyZyIsIndlYiI6Imh0dHBzOi8vYm9va3N0b3JlLnh5eiIsInZlbiI6IlRoZSBDb21tb25zIiwiZCI6InRoaXMgY2FuIGJlIHJlYWQgZnJvbSB0aGUgRVJDNjc3IFRyYW5zZmVyIGV2ZW50In19
Handling Callback Response From Wallet
The wallet will send a POST
request to the callback url defined in the ven.cbu
field.
Make sure your endpoint handles POST requests
The POST request send a JSON object with:
invoiceId: specified by the vendor in
ven.ind
fieldtransactionId: the transaction hash of the payment on the Fuse blockchain
Verifying The Payment On The Fuse Blockchain
It is recommended to verify that the transactionId reported by the wallet did happen and that it matches the payment details.
Use any web3 library to read the events from the transaction.
The contract event ABI is: (See Smart Contracts to get the G$ token contract address)
The last data
field will contain the data supplied in the extra data field, if that field is omitted or empty then it will contain the data supplied in the invoice id field. This way you can verify that the transaction matches the specific payment.
Verify that the fields to, value and data match what you expect for the payment to prevent fraud.
Need a hand?
Fill out this form to request support:
Last updated