Full lesson
solana-pay-wordpress
What it does
From the project README:
https://github.com/sidwyn/solana-pay-wordpress/assets/103864/cd0a420e-3a11-4f68-a115-8475d2cbc107
- Original
- sidwyn/solana-pay-wordpress
- SuperStack fork
- Blockchains/solana-pay-wordpress @
fd02c2a - Stars
- 2
- Last push (original)
- 2024-04-14
- Languages
- PHP, TypeScript, JavaScript, CSS
- Detected stack
- Solana Payweb3.js
- Categories
- Payments
- Licence
- Apache-2.0
Architecture
6 source files. By extension: .tsx ×4, .js ×2.
| Top-level directory | Source files |
|---|---|
core | 4 |
(root) | 2 |
🟡 Builds, verified 2026-11-02 Tested on 2026-11-02: full log results.json
Build it yourself: step-by-step guide
Every command below was run on 2026-11-02 by tests/run_fork.py against the pinned commit, and the results come from that run. The full output is in the committed log.
1. Prerequisites (versions we tested with)
- Rust:
rustc 1.99.1 (58cf8f9c3 2026-10-13) - Solana CLI (Agave):
solana-cli 1.18.17 (src:c027cfc3; feat:4215500110, client:Agave) - Node.js:
v24.22.1 - npm:
11.21.1 - pnpm:
10.34.6
2. Clone at the tested commit
git clone https://github.com/Blockchains/solana-pay-wordpress.git && cd solana-pay-wordpress
git checkout fd02c2ab79d2d18f82f3538ad257eae399564c663. Configure
No environment file is needed.
Fixes we had to apply to the pinned commit before it would build or run, with the reason for each:
npm pkg set devDependencies.typescript=^5. the build calls tsc but typescript is not declared
4. Install dependencies
| Directory | Command | Result | Time |
|---|---|---|---|
. | npm install --no-audit --no-fund --legacy-peer-deps | ✅ pass | 14s |
5. Build
| Directory | Command | Result | Time |
|---|---|---|---|
. | npm run build | ✅ pass | 7s |
7. Deploy to a local validator
Extend it
- Add an integration test that runs the main flow end to end and asserts every account state change.
- Add a negative test: call each instruction with the wrong signer or account and check that it fails.
- Make the frontend read the cluster from an env var, deploy it to GitHub Pages and point it at your devnet program.
- Wire the build into CI by copying this site's verify-forks workflow.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
core/includes/assets/js/solana-pay-button.tsx L49–72 @ fd02c2a · Apache-2.0 · original } const payAddress = process.env.SHOP_SOL_ADDRESS; if (payAddress == null || payAddress.length === 0) { alert("Payer address not found. Please define it in your .env file."); } setHasErrorMessage(null); const lamports = await connection.getMinimumBalanceForRentExemption(0); const transaction = new Transaction().add( SystemProgram.transfer({ fromPubkey: publicKey, toPubkey: new PublicKey(payAddress), lamports: payAmount * LAMPORTS_PER_SOL ?? lamports, }) ); const { context: { slot: minContextSlot }, value: { blockhash, lastValidBlockHeight }, } = await connection.getLatestBlockhashAndContext(); const signature = await sendTransaction(transaction, connection, {- Line 70
} = await connection.getLatestBlockhashAndContext();: Fetches a recent blockhash. Transactions expire if it gets too old. - Line 72
const signature = await sendTransaction(transaction, connection, {: Submits the signed transaction to the cluster.
How to run, build and test
These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.
| Directory | Command | Runs |
|---|---|---|
. | npm run build | webpack --mode production |
What you could build from it
- Fork the SuperStack copy and extend it within the Payments gaps listed on the idea page.
- Learn the pattern first: SPL Tokens: mints, accounts and transfers
- Learn the pattern first: Building and sending transactions from a client