Hello everyone here

I am making project on bids and offer ,in which payment gateway i need to use is bitcoin ,so any one help me to guide from where i start

Thanks

Dani AI

Generated

Quick roadmap for (building on ’s JSON‑RPC suggestion) — three realistic approaches, what to change in your database/workflow, and practical gotchas to test.

Option summary (pick one)

  • Run a Bitcoin node and poll or call JSON‑RPC from your backend for payments (full control, more ops).
  • Use a hosted processor (Coinbase Commerce / BitPay) that creates invoices/hosted checkouts and sends webhooks (fast to integrate, custody/fee tradeoffs).
  • Self‑host a non‑custodial gateway (BTCPay) that issues per‑invoice addresses while you keep keys offline (non‑custodial, more setup than hosted). (bitcoincore.org)

Database + flow (minimal practical design)

  1. Create an order row when checkout starts. Store: order_id, user_id, fiat_amount, btc_amount, currency, status (pending/paid/confirmed/complete), receive_address, invoice_id (processor), txid, confirmations, created_at, updated_at.
  2. When user chooses BTC: either (a) create an invoice via gateway API and save invoice_id, or (b) derive / reserve a receive_address (xpub or pre-generated) and save it against the order.
  3. React to webhook (preferred) or poll the node: verify signature, idempotently update txid + confirmations, and only fulfill once your confirmation threshold is reached. Example order table and a tiny webhook handler sketch are below. (docs.btcpayserver.org)
-- example (MySQL)
CREATE TABLE orders (
  id INT AUTO_INCREMENT PRIMARY KEY,
  order_token VARCHAR(64) UNIQUE,
  user_id INT,
  fiat_amount DECIMAL(10,2),
  btc_amount DECIMAL(18,8),
  receive_address VARCHAR(128),
  invoice_id VARCHAR(128),
  txid VARCHAR(128),
  confirmations INT DEFAULT 0,
  status ENUM('pending','paid','confirmed','complete') DEFAULT 'pending',
  created_at DATETIME,
  updated_at DATETIME
);

Security & confirmations (practical rules)

  • For low‑value/fast flows you might accept 0–1 confirmations; for higher value wait more. Many processors treat 1–2 confirmations as “paid/confirmed”; enterprise merchants commonly require 6 confirmations for full settlement. Test your risk tolerance. (support.bitpay.com)
  • Do not keep private keys on your web server. Use an xpub/watch‑only setup (or a processor) so the web app can derive addresses but cannot spend funds. See BIP32 for HD/xpub behavior. (bips.dev)

Practical checklist before go‑live

  • Test everything on testnet.
  • Verify webhook signatures and make handlers idempotent.
  • Handle under/overpayment, invoice expiry and reorgs (confirmations can drop on rare reorgs).
  • Log every webhook and poll result for troubleshooting.

If preferred, say whether you want a short PHP webhook example (PDO + signature verification) or a sample flow using BTCPay or Coinbase Commerce and I’ll post a compact, ready‑to‑drop snippet. (docs.btcpayserver.org)

Recommended Answers

All 2 Replies

Hello,

Assuming that you already written the codes for your site, including the payment processor script ready to be integrated with the desired payment gateways.

Visit this site .Click Here.

Download the JSON RPC PHP file.

Sign up for your account at the payment gateway site..

Basic implementation as shown on their wiki

  require_once 'jsonRPCClient.php';

  $bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');

  echo "<pre>\n";
  print_r($bitcoin->getinfo()); echo "\n";
  echo "Received: ".$bitcoin->getreceivedbylabel("Your Address")."\n";
  echo "</pre>";

thanks oop ,i read the links u gave above but i am not getting how i exactly use it with my database and what changes are required ?

thanks again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.