Title: Melalweb Pay with Bale for WooCommerce
Author: Mohammad Reza Rezaei
Published: <strong>27 augustus 2026</strong>
Last modified: 7 september 2026

---

Plugins zoeken

![](https://ps.w.org/melalweb-pay-with-bale-for-woocommerce/assets/banner-772x250.
png?rev=3668490)

![](https://ps.w.org/melalweb-pay-with-bale-for-woocommerce/assets/icon-256x256.
png?rev=3668490)

# Melalweb Pay with Bale for WooCommerce

 Door [Mohammad Reza Rezaei](https://profiles.wordpress.org/rezaei1374/)

[Download](https://downloads.wordpress.org/plugin/melalweb-pay-with-bale-for-woocommerce.1.1.0.zip)

 * [Details](https://nl.wordpress.org/plugins/melalweb-pay-with-bale-for-woocommerce/#description)
 * [Beoordelingen](https://nl.wordpress.org/plugins/melalweb-pay-with-bale-for-woocommerce/#reviews)
 *  [Installatie](https://nl.wordpress.org/plugins/melalweb-pay-with-bale-for-woocommerce/#installation)
 * [Ontwikkeling](https://nl.wordpress.org/plugins/melalweb-pay-with-bale-for-woocommerce/#developers)

 [Ondersteuning](https://wordpress.org/support/plugin/melalweb-pay-with-bale-for-woocommerce/)

## 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 `sendInvoice` with automatic webhook confirmation
 * Pre-checkout validation within Bale’s 10-second window (`answerPreCheckoutQuery`)
 * Transaction inquiry via `inquireTransaction` when a shopper checks payment status
 * Optional `createInvoiceLink` API 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

 1. The customer signs in and links their account to the Bale bot with a 15-minute 
    one-time code.
 2. At checkout the plugin creates a payment payload and calls Bale `sendInvoice` with
    the wallet `provider_token` from @botfather.
 3. Bale sends `pre_checkout_query`. The plugin re-checks the linked account, amount(
    IRR), order status, and expiry, then answers with `answerPreCheckoutQuery`.
 4. After payment, `successful_payment` is received. The charge ID is stored uniquely
    and the order is completed. Status checks can also call `inquireTransaction`.

#### 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`
به‌صورت خودکار بارگذاری می‌شوند.

#### سازوکار پرداخت کیف‌پول بله

 1. مشتری وارد حساب می‌شود و با کد یک‌بارمصرف ۱۵ دقیقه‌ای به ربات بله متصل می‌شود.
 2. هنگام تسویه، افزونه متد `sendInvoice` را با `provider_token` کیف‌پول فراخوانی می‌کند.
 3. بله رویداد `pre_checkout_query` را می‌فرستد؛ افزونه ظرف حداکثر ۱۰ ثانیه با `answerPreCheckoutQuery`
    پاسخ می‌دهد.
 4. پس از پرداخت موفق، `successful_payment` می‌رسد و سفارش تکمیل می‌شود. دکمه «بررسی
    وضعیت» می‌تواند از `inquireTransaction` هم استفاده کند.

#### تست بدون انتقال پول واقعی

توکن آزمایشی `WALLET-TEST-1111111111111111` را به‌عنوان `provider_token` وارد کنید.

## Installatie

 1.  Install and activate [WooCommerce](https://wordpress.org/plugins/woocommerce/).
 2.  Upload the plugin ZIP via Plugins  Add New, or copy the `melalweb-pay-with-bale-
     for-woocommerce` folder into `wp-content/plugins/`.
 3.  Activate Melalweb Pay with Bale.
 4.  Set the site language to فارسی if you want the Persian admin and checkout UI.
 5.  Open Melalweb Pay with Bale in the WordPress admin menu.
 6.  Enter the bot username, bot token, and wallet payment token (`provider_token`),
     then save.
 7.  Click Register webhook with Bale.
 8.  Optionally enable store card-to-card and add destination cards.
 9.  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-1111111111111111` as `provider_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.

Bijdragers

 *   [ Mohammad Reza Rezaei ](https://profiles.wordpress.org/rezaei1374/)

[Vertaal “Melalweb Pay with Bale for WooCommerce” in je eigen taal.](https://translate.wordpress.org/projects/wp-plugins/melalweb-pay-with-bale-for-woocommerce)

### Interesse in ontwikkeling?

[Bekijk de code](https://plugins.trac.wordpress.org/browser/melalweb-pay-with-bale-for-woocommerce/),
haal de [SVN repository](https://plugins.svn.wordpress.org/melalweb-pay-with-bale-for-woocommerce/)
op, of abonneer je op het [ontwikkellog](https://plugins.trac.wordpress.org/log/melalweb-pay-with-bale-for-woocommerce/)
via [RSS](https://plugins.trac.wordpress.org/log/melalweb-pay-with-bale-for-woocommerce/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1.0

 * Align with current Bale wallet payment docs: `sendInvoice`, `answerPreCheckoutQuery`,`
   inquireTransaction`, and `createInvoiceLink`.
 * Store PreCheckoutQuery ID and use `inquireTransaction` when 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
   bundled `fa_IR` translations.

#### 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.

## Meta

 *  Versie **1.1.0**
 *  Laatst geüpdatet **2 maanden geleden**
 *  Actieve installaties **50+**
 *  WordPress versie ** 6.5 of nieuwer **
 *  Getest t/m **7.0.8**
 *  PHP versie ** 7.4 of nieuwer **
 *  Taal
 * [English (US)](https://wordpress.org/plugins/melalweb-pay-with-bale-for-woocommerce/)
 * Tags
 * [bale](https://nl.wordpress.org/plugins/tags/bale/)[checkout](https://nl.wordpress.org/plugins/tags/checkout/)
   [Iran](https://nl.wordpress.org/plugins/tags/iran/)[payments](https://nl.wordpress.org/plugins/tags/payments/)
   [woocommerce](https://nl.wordpress.org/plugins/tags/woocommerce/)
 *  [Geavanceerde weergave](https://nl.wordpress.org/plugins/melalweb-pay-with-bale-for-woocommerce/advanced/)

## Waarderingen

Er zijn nog geen beoordelingen ingediend.

[Je beoordeling](https://wordpress.org/support/plugin/melalweb-pay-with-bale-for-woocommerce/reviews/#new-post)

[Bekijk alle beoordelingen](https://wordpress.org/support/plugin/melalweb-pay-with-bale-for-woocommerce/reviews/)

## Bijdragers

 *   [ Mohammad Reza Rezaei ](https://profiles.wordpress.org/rezaei1374/)

## Ondersteuning

Iets te melden? Hulp nodig?

 [Het supportforum bekijken](https://wordpress.org/support/plugin/melalweb-pay-with-bale-for-woocommerce/)

## Doneren

Wil je de groei van deze plugin ondersteunen?

 [ Doneer aan deze plugin ](https://melalweb.com)