Bagisto
The Orboni package adds crypto to Bagisto’s checkout. The buyer chooses Crypto as the payment method, places the order and pays on Orboni’s payment page, picking a coin and paying from any wallet or exchange. The money goes to the wallets you set in the dashboard, and the order is invoiced by itself once the payment is final.
It is a payment method for Bagisto 2.5 (Laravel 13, PHP 8.4), tested end to end on Bagisto 2.5.2. It is free, and its source is open, under the MIT licence: orboni/bagisto-payment on GitHub. Install it with Composer in your Bagisto’s folder; Laravel finds it by itself:
composer require orboni/bagisto-payment
php artisan migrate
php artisan optimize:clearSet it up
- 1In the Orboni dashboard, set the wallets you want to be paid to under Wallets, and copy a secret key under Developers → API keys — a test key (
sk_test_…) first. - 2In Bagisto’s admin, open Configure → Sales → Payment Methods → Orboni (crypto), paste the key into Secret key and save. Crypto now shows at checkout as “Crypto (USDT, USDC, BTC, ETH and more)”; change its title, description or place in the list on the same page if you like.
- 3In the Orboni dashboard, under Developers → Webhooks, add an endpoint at the Webhook address the settings show, with the
checkout.session.*events, and paste its signing secret (whsec_…) into Webhook signing secret. Save. - 4Make sure Laravel’s scheduler runs, as Bagisto asks anyway: every ten minutes the package reads back payments whose webhook did not arrive and cancels orders left unpaid.
- 5Place an order with Crypto, and on its payment page, signed in to the dashboard, press Simulate payment: the order is invoiced and moves to Processing. Then swap in your live key (
sk_live_…) and the live endpoint’s secret. The key decides test or live at Orboni.
* * * * * cd /path/to/bagisto && php artisan schedule:run >> /dev/null 2>&1How orders move
Placing the order with Crypto makes it at once, as Pending Payment, through Bagisto’s own checkout: the stock is held for it, Bagisto sends its order email, and the buyer goes to Orboni’s payment page for its total. The package reads the payment back from Orboni before it changes anything, so the order follows the payment as it is now — whether the webhook, the buyer’s return or the scheduled check comes first, twice or out of order. What happened is written in the order’s comments, for you; the buyer is not told.
| Payment | Orboni says | In Bagisto |
|---|---|---|
| Paid in full | complete, paid | Invoiced and Processing, the session among the order’s transactions, a comment naming the coin and the network; Bagisto sends its invoice email |
| On the chain, not final yet | processing | Pending Payment, with a comment; invoiced once final |
| Held for your review | held | Pending Payment, giving the reason; accept it in the dashboard and the order is invoiced |
| Part paid | partially_paid | Pending Payment, saying how much came; the payment page asks the buyer for the rest |
| Left by the page’s back link, nothing sent | expired, unpaid | Cancelled, the stock back, the buyer at checkout with their cart to pay another way |
| Ran out with nothing paid | expired, unpaid | A comment; cancelled after the hours set in the settings (24 by default, 0 keeps it) |
| Ran out part paid | expired, partially_paid | Pending Payment, saying what arrived of what was due; settle the rest with the buyer |
| Paid for an order changed after its page opened | complete, paid | Not invoiced, with what was paid and what the order totals; check it before shipping |
| Paid after the order was cancelled | complete, paid | Left cancelled, with a comment: place a new order for the buyer or send the money back |
| Money that paid it left the chain | payment_reversed | Back to Pending Payment, told not to ship until the dashboard shows it paid again |
| More came after it was paid | extra_received | A comment saying what came in all; send the extra back from your wallet if the buyer asks |
Back from the payment page, the buyer lands on Bagisto’s order confirmation once the payment is seen; before that they go back to the same payment page. An order you cancel in the admin closes its payment page, so money that still comes is held for your review in the dashboard instead of paying it. Without the webhook a payment is still recorded once the buyer comes back or the scheduled check reads it; set it up all the same.
Good to know
- The currency: the one the buyer shops in — US dollars, euros, pounds, yen or any other currency a checkout session takes (Currencies in the API reference). The payment page shows the order’s total in it, and the buyer pays its worth in the coin they pick. Crypto is offered only in one of them.
- The least is worth $1.00. Below it the buyer is told so at checkout and keeps their cart to choose another way to pay.
- Refunds: the money is in your wallet, so send it back from there, record the refund in the dashboard, and refund the order in Bagisto.
- Several Bagisto stores can share one Orboni project: each adds its own endpoint and acts only on its own orders.
- The secret key and the signing secret are kept with Bagisto’s other settings and never shown again in its admin: leave a field empty to keep what is saved. Errors go to Laravel’s log; keys and secrets never do.
What the package sends
Each order makes a checkout session through POST /v1/checkout/sessions, with an idempotency key of the store, the order and the try, so a retry never makes a second one. Nothing is sent until the package has your key and a buyer pays with it.
- amountinteger
- The order’s grand total with shipping and taxes, in the currency’s smallest unit: cents, or whole yen.
- currencystring
- The order’s currency, in lower case: usd, eur, jpy…
- descriptionstring
- The order’s products, as “Mug × 2, Poster”, cut at 250 characters.
- detailsstring
- The order number and your channel’s name: “Order 1042 at Example Store”.
- client_reference_idstring
- Bagisto’s id of the order: “1042”.
- metadataobject
- bagisto_order_id, bagisto_order_number and bagisto_site — a key made from your app’s own APP_KEY, so two stores on one project never act on each other’s events.
- customer_emailstring
- The buyer’s email, where Orboni sends the receipt when your project sends receipts.
- localestring
- The buyer’s language in your store, as en.
- success_url, cancel_urlstring
- The package’s return address, with the order and a token of its own, which reads the payment back and shows Bagisto’s order confirmation; and its cancel address, which closes the page, cancels the order and gives the cart back.
No address, phone number or other buyer data is sent. A payment in the dashboard, an export or a webhook leads to its order by client_reference_id and the order number in its metadata, and an order to its payment by the session id in its comments and among its transactions.
This page as Markdown, for a program or an AI assistant: /docs/bagisto.md. Something missing or unclear? Write to us from the dashboard’s Help & Support.