Merchant payment API gateway on a Firebase function.
Works like this:
- Merchant signs in with Google (can be extended to other providers)
- Merchant generates API key and configures wallet address
- Customer navigates to Merchant Shop and initiates a payment
- Payment API generates random wallet and returns address and checkoutUrl
- Customer navigates to checkoutUrl and sends payment to generated address
- Payment API transfers incoming payment (minus tx fee) to configured wallet address and returns a success message and navigates to redirectUrl
- Transactions to address is visible in Merchant Admin UI
- Demo: https://reef-payment-api.web.app/
- Merchant Shop Demo: https://reef-payment-api.web.app/shop
- Video: https://www.loom.com/share/c1dae7c082c74de5bcf2fa849cc26958
- Refund payments (this must be done in the browser with the merchant wallet signed in with polkadot ext.)
- Admin UI to manage merchants
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
cd functions
npm run serve
API is now available at: http://localhost:5001/reef-payment-api/us-central1/api
- Go to http://localhost:3000 and sign in
- Create API key
- Enter wallet address
- Go to http://localhost:3000/shop and initiate a payment
- Copy the generated address and amount
- Pay in browser with Polkadot extension