Beschrijving
Melalweb Pay with Bale adds Bale wallet checkout to WooCommerce using the official Bale Bot payment methods (sendInvoice, answerPreCheckoutQuery, and inquireTransaction).
Bale no longer supports bot card-to-card money requests. Wallet payment is the supported way for bots to receive money. This plugin can still offer an optional store-managed card-to-card method (destination card + receipt upload) that does not use Bale’s removed bot card-to-card API.
This plugin is an independent Melalweb integration. It is not affiliated with, endorsed by, or officially connected to Bale, WooCommerce, or Automattic. Bale and WooCommerce are trademarks of their respective owners.
Features
- Bale wallet invoices via
sendInvoicewith automatic webhook confirmation - Pre-checkout validation within Bale’s 10-second window (
answerPreCheckoutQuery) - Transaction inquiry via
inquireTransactionwhen a shopper checks payment status - Optional
createInvoiceLinkAPI helper for mini-app style flows - Test wallet token support:
WALLET-TEST-1111111111111111(same flow, no real transfer) - Optional store card-to-card with secure receipt upload and manager review
- Admin dashboard for transactions, linked users, events, and CSV export
- Optional percentage discounts per payment method
- Automatic expiry of unpaid payment requests
- Bundled Persian (
fa_IR) translations for WordPress sites set to فارسی
How Bale wallet pay works
- The customer signs in and links their account to the Bale bot with a 15-minute one-time code.
- At checkout the plugin creates a payment payload and calls Bale
sendInvoicewith the walletprovider_tokenfrom @botfather. - Bale sends
pre_checkout_query. The plugin re-checks the linked account, amount (IRR), order status, and expiry, then answers withanswerPreCheckoutQuery. - After payment,
successful_paymentis received. The charge ID is stored uniquely and the order is completed. Status checks can also callinquireTransaction.
Requirements
- WordPress 6.5 or later
- WooCommerce 7.0 or later
- Store currency set to Iranian Rial (IRR) or Toman (IRT / TOMAN)
- A Bale bot token and wallet payment token (
provider_token) from @botfather
Localization
Source strings are English (WordPress.org standard). When the site language is Persian (fa_IR), the bundled translation in /languages is loaded automatically via load_plugin_textdomain and Domain Path: /languages.
External services
This plugin connects to Bale (an Iranian messenger and payments platform) so a store can send wallet invoices, confirm payments, inquire transactions, register a webhook, and optionally send status messages in Bale.
Bale Bot API
- What it is used for: creating wallet invoices (
sendInvoice), answering checkout queries (answerPreCheckoutQuery), inquiring transactions (inquireTransaction), optionally creating invoice links (createInvoiceLink), registering the store webhook, testing the bot connection, sending optional order-status messages, and receiving payment updates. - When data is sent: only after a store manager saves a bot token and wallet payment token, and only when a shopper pays with Bale, links their account, checks payment status, or a manager tests/registers the connection. Store card-to-card checkout does not call this API unless a Bale notification template is used.
- Data sent to Bale: bot token and provider token in API request URLs (stored on this WordPress site, not sent to Melalweb); invoice title, description, amount in IRR, a random payment identifier, and the customer’s Bale chat ID; transaction ID for inquiry; webhook URL of this site; optional notification text about an order.
- Service: Bale, API host
https://tapi.bale.ai - Terms of service: https://bale.ai/terms
- Privacy policy: Bale publishes its privacy terms in the same document (sections on user privacy / حریم خصوصی): https://bale.ai/terms
- Bot API documentation: https://docs.bale.ai/
Bale deep links
- What it is used for: opening the merchant’s Bale bot so a signed-in customer can link their store account with a one-time code.
- When data is sent: when a signed-in customer views checkout or the account linking page and a bot username is configured.
- Data sent: the bot username and a short-lived one-time linking code in a
https://ble.ir/{bot}?start={code}URL opened by the customer. - Service: Bale deep links on
https://ble.ir - Terms of service: https://bale.ai/terms
- Privacy policy: https://bale.ai/terms
This plugin does not send store, customer, or payment data to Melalweb.
فارسی
درگاه Melalweb Pay with Bale پرداخت کیفپول الکترونیکی بله را با متدهای رسمی بازو (sendInvoice، answerPreCheckoutQuery و inquireTransaction) به ووکامرس اضافه میکند.
درخواست پول کارتبهکارت از طریق بازوها دیگر توسط بله پشتیبانی نمیشود؛ روش پایدار دریافت پول در بازو، کیفپول است. این افزونه همچنان میتواند یک روش اختیاری کارت به کارت فروشگاهی (نمایش کارت مقصد + بارگذاری رسید) ارائه دهد که از API حذفشده کارتبهکارت بازو استفاده نمیکند.
اگر زبان سایت وردپرس روی «فارسی» باشد، ترجمههای همراه افزونه در پوشه languages بهصورت خودکار بارگذاری میشوند.
سازوکار پرداخت کیفپول بله
- مشتری وارد حساب میشود و با کد یکبارمصرف ۱۵ دقیقهای به ربات بله متصل میشود.
- هنگام تسویه، افزونه متد
sendInvoiceرا باprovider_tokenکیفپول فراخوانی میکند. - بله رویداد
pre_checkout_queryرا میفرستد؛ افزونه ظرف حداکثر ۱۰ ثانیه باanswerPreCheckoutQueryپاسخ میدهد. - پس از پرداخت موفق،
successful_paymentمیرسد و سفارش تکمیل میشود. دکمه «بررسی وضعیت» میتواند ازinquireTransactionهم استفاده کند.
تست بدون انتقال پول واقعی
توکن آزمایشی WALLET-TEST-1111111111111111 را بهعنوان provider_token وارد کنید.
Installatie
- Install and activate WooCommerce.
- Upload the plugin ZIP via Plugins Add New, or copy the
melalweb-pay-with-bale-for-woocommercefolder intowp-content/plugins/. - Activate Melalweb Pay with Bale.
- Set the site language to فارسی if you want the Persian admin and checkout UI.
- Open Melalweb Pay with Bale in the WordPress admin menu.
- Enter the bot username, bot token, and wallet payment token (
provider_token), then save. - Click Register webhook with Bale.
- Optionally enable store card-to-card and add destination cards.
- Set WooCommerce currency to IRR or Toman.
FAQ
-
Is this an official Bale or WooCommerce plugin?
-
No. It is an independent Melalweb plugin that talks to the public Bale Bot API. Melalweb is not affiliated with Bale or WooCommerce.
-
Does wallet pay support guest checkout?
-
No. Bale wallet pay needs a logged-in WordPress user linked to a Bale chat. The optional store card-to-card method does support guests.
-
How do I test payments without transferring money?
-
Use the Bale test wallet token
WALLET-TEST-1111111111111111asprovider_token. It follows the same flow without a real transfer. -
Where are receipt files stored?
-
Receipts are stored privately under
uploads/melalweb-balepay-receipts/and are served only through a capability or order-key check. -
Can I keep payment data after uninstalling?
-
Yes. Tables and settings are kept unless you enable the uninstall option on the Appearance tab.
Beoordelingen
Er zijn geen beoordelingen voor deze plugin.
Bijdragers & ontwikkelaars
“Melalweb Pay with Bale for WooCommerce” is open source software. De volgende personen hebben bijgedragen aan deze plugin.
BijdragersVertaal “Melalweb Pay with Bale for WooCommerce” in je eigen taal.
Interesse in ontwikkeling?
Bekijk de code, haal de SVN repository op, of abonneer je op het ontwikkellog via RSS.
Changelog
1.1.0
- Align with current Bale wallet payment docs:
sendInvoice,answerPreCheckoutQuery,inquireTransaction, andcreateInvoiceLink. - Store PreCheckoutQuery ID and use
inquireTransactionwhen shoppers check payment status. - Document wallet payment token from @botfather and the official test token.
- Clarify that Bale bot card-to-card money requests are discontinued; keep optional store card-to-card as a separate feature (disabled by default for new installs).
- Add WordPress.org-standard i18n:
Domain Path,load_plugin_textdomain, and bundledfa_IRtranslations.
1.0.1
- WordPress.org review updates: display name and slug, prefixes, nonce on receipt viewing, and Bale service disclosure.
1.0.0
- Initial release.
