bitcoinbrisbane / bitcoinpokertour

https://www.bitcoinpokertour.com/
Creative Commons Zero v1.0 Universal
1 stars 7 forks source link

Show payment QR code #10

Closed bitcoinbrisbane closed 2 months ago

bitcoinbrisbane commented 3 months ago

After the user POST the registration #6 show the Payment QR code. Poll the blockchain for a payment tx then show a "Green Tick" once the payment is seen in the mempool.

Like BTCPay server...

image

bitcoinbrisbane commented 3 months ago

Some notes https://docs.btcpayserver.org/CustomIntegration/

<script src="https://your.btcpay.url/modal/btcpay.js"></script>
const axiosClient = axios.create({
  baseURL: BTCPAY_URL,
  timeout: 5000,
  responseType: 'json',
  headers: {
    'Content-Type': 'application/json',
    Authorization: BTCPAY_AUTH
  }
})

const invoiceCreation = {
  price: 12345,
  currency: 'USD',
  orderId: 'something',
  itemDesc: 'item description',
  notificationUrl: 'https://webhook.after.checkout.com/goeshere',
  redirectURL: 'https://go.here.after.checkout.com'
}

const response = await axiosClient.post('/invoices', invoiceCreation)
const invoiceId = response.data.data.id