P2Flux for Blesta
Blesta invoices paid in USDC on Base, straight to your own wallet, including automatic payments for recurring services.
A Blesta invoice is paid in P2Flux’s checkout from the client’s own wallet; the money lands in your wallet in the same transaction. Blesta records the payment only after the P2Flux API has confirmed that transaction on chain. There is no P2Flux account, no API key and no balance to withdraw.
Overview
The gateway adds P2Flux (USDC) to Blesta’s non-merchant gateways. Clients pay invoices in USDC on Base with MetaMask, Rabby or a phone wallet (by QR code). For recurring services the client can also choose automatic payment: they approve once, and P2Flux collects every period.
Both networks are supported: Base Sepolia for testing with faucet money, and Base Mainnet for real USDC.
Requirements
Installation
- Download p2flux-blesta-1.0.0.zip from the GitHub releases (or the Blesta Marketplace).
- Unzip it into components/gateways/nonmerchant/ — you get components/gateways/nonmerchant/p2flux/.
- In Blesta: Settings → Company → Payment Gateways → Available, install P2Flux (USDC).
- Enter your wallet address, choose the network, tick USD under Accepted Currencies, save.
Settings
P2Flux has no API key. The gateway signs the links on your pay page with Blesta’s own system key, so a client cannot change who or what a payment is for.
One-time payments
On the invoice’s payment page the client clicks Pay with USDC. P2Flux’s checkout opens in a small window, the client pays from their wallet, and the window hands the transaction back to Blesta, which shows its “payment received” page. If the window is closed early, the payment is still recorded when P2Flux’s confirmation arrives (retried for about 18 hours).
A second click on an unpaid invoice reuses the same payment; an invoice that is already paid shows “already paid” instead of a new payment.
Automatic payments
When an invoice belongs to a recurring service, the client can choose Pay automatically every …. They approve once in their wallet; P2Flux charges the first period immediately (applied to that invoice) and then collects every period by itself. Each later charge is recorded as a payment to the client’s account and applied to the open renewal invoice by Blesta’s Auto Apply Credits (on by default).
How payments are recorded
- Only what the P2Flux API confirms on chain is recorded. Client, invoices and amount come from the gateway’s own record, never from the request.
- The Blesta transaction ID is the blockchain transaction hash. Each transaction is recorded once, even when the client’s browser and P2Flux’s confirmation arrive at the same moment.
- A payment of a different amount than the invoice is recorded as credit, not applied.
- Every confirmation is in Blesta’s gateway log.
Changing settings later
Switching the network or the wallet invalidates every payment page started before (pay pages are valid for a day). A test payment is never recorded once the gateway is on Mainnet. Uninstalling the gateway stops all active automatic payments first.
Refunds
Blesta cannot send a P2Flux refund: a refund is a transfer from your own wallet. Use the P2Flux refund page (see Refunds); for automatic payments, send it to an address the client gives you.