Payment gateway

#Liberland payment gateway

##MVP Liberland payment gateway is unique in that it handles most of the data on chain and does not keep permanent records on the server itself, both for legal and decentralization reasons. It is merely a middleman telling the buyer how to pay the merchant, and then notifying the merchant of the payment.

The merchant will build a link similar to this

http://testnet.liberland.org/home/wallet/gateway/557?price=4&toId=5Cz12KQKCmLMg7GULaJfAEe78DtTHSfs7LjaJKtWSA1DtwQg&callback=https%3A%2F%2Fgoogle.com&remark=%27Get%20citizenship%20now%27&failure=https%3A%2F%2Fseznam.cz&hook=https%3A%2F%2Fwebhook.site%2F06892882-f63f-4bfb-a57d-632d2953e631

  • The first number is the order id created by the merchant.

  • Second number price is the price in LLD

  • Third argument toId is the merchants address on the Liberland chain

  • Callback is the redirect after successful payment

  • Remark is the note that will be recorded onchain and it can contain identifying info

  • Failure is the redirect on failure

  • Hook is a webhook that will return the data about the payment

A payment is considered complete when a payment is sent to the correct address with the correct remark and amount within the next 10000 blocks.

The happy path works in this order:

  1. Merchant creates the payment link

  2. User clicks on the link and executes the payment

  3. User is redirected to the site and a webhook provides data about the payment - address, price and remark

  4. The merchant verifies that the webhook data received matches the order regarding address, price and (optionally) remark

  5. Merchant executes the order

Any failed orders where LLD was sent can be easily handled manually via https://chainscan.mainnet.liberland.org/

###TODO verifying payment Webhook gets data from api.blockchain.liberland.org signed with public key. Verify it with TODO

Alternatively the merchant can check the chain directly or call the API call TODO

Upcoming v1.5

Upcoming version 1.5 will integrate with companies on Liberland chain. The hook, success and fail callbacks will be setup during company registration and will not be included in the link generated by merchant but read from the chain directly to add additional layer of security.

Companies will be able to have multiple addresses.

Companies will be able to see a history of transactions on the blockchain for all addresses as well as failed transactions, acting as history and metrics.

Upcoming v2.0

Each order will be an unique walletaddress that the company controls, so the orders will be able to be completed not only in blockchain.liberland.org but any substrate wallet

Last updated