THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

How to Accept Bitcoin Payments in WooCommerce

permalink THAMER
#bitcoin#ghost#payments#wordpress

A WooCommerce gateway should create a pending order, persist a unique invoice address and a locked satoshi quote, then reconcile trusted chain evidence on the server. Only after sufficient confirmations should an authenticated worker call the order payment_complete method. The helper checks a normalized confirmed total; the upstream reconciler must deduplicate outpoints, enforce confirmation depth and handle reorganizations. This is not a registered WooCommerce gateway or a callback endpoint.

Source code

PHP · 11 lines
1<?php
2function stage25_paid(array $invoice, array $evidence): bool {
3    return $invoice['network'] === $evidence['network']
4        && $invoice['address'] === $evidence['address']
5        && is_int($evidence['confirmed_sat']) && is_int($invoice['expected_sat'])
6        && $invoice['expected_sat'] > 0
7        && $evidence['confirmed_sat'] >= $invoice['expected_sat'];
8}
9$i=['network'=>'test','address'=>'fixture','expected_sat'=>1000];
10$e=['network'=>'test','address'=>'fixture','confirmed_sat'=>1000];
11if (PHP_SAPI === 'cli' && (!stage25_paid($i,$e) || stage25_paid($i,array_replace($e,['confirmed_sat'=>999])))) exit(1);

Validation and deployment

Use a staging site and testnet first. Verify the destination, test duplicate payment notifications and keep fulfillment separate from browser requests. This example was checked locally, not inside a live CMS.

Related documentation

https://thamer.org/api

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects