=== TNetPay Card to Card (کارت به کارت تی‌نت‌پی) – Auto-Confirm Payments for WooCommerce ===
Contributors: tnetmadadi
Tags: card to card, کارت به کارت, payment gateway, woocommerce, درگاه پرداخت
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Auto-confirm Iranian card-to-card payments in WooCommerce with TNetPay SMS-based verification.

== Description ==

درگاه کارت به کارت ووکامرس تی نت پی با تأیید خودکار واریز.

TNetPay Card to Card lets Iranian WooCommerce stores accept bank card-to-card transfers that are confirmed automatically. For each order the plugin creates a payment on TNetPay, sends the customer to the TNetPay hosted payment page that shows the destination card and exact amount, and marks the order paid as soon as the transfer is verified.

Features:

* Fully automatic order statuses following WooCommerce conventions: "Pending payment" while waiting, `payment_complete()` when the transfer is verified (WooCommerce chooses Processing or Completed and reduces stock), and "Cancelled" when the payment expires. Every step is recorded as an order note with the payment ID and amount.
* "Test connection" button: validates the API key and shows the merchant name, whether card-to-card is enabled, approved cards and the paired Android app.
* Webhook address is sent automatically with every payment, plus a 5-minute background check and a re-check on the thank-you page.
* Warnings for unsupported store currency and disabled WP-Cron.
* Built-in step-by-step setup guide and FAQ on the settings page.
* Classic and block-based checkout, HPOS compatible.
* Persian (fa_IR) translation included.

A TNetPay merchant account with card-to-card enabled is required.

= فارسی =

افزونهٔ تی‌نت‌پی (TNet Pay) یک درگاه کارت به کارت برای ووکامرس است. در کارت به کارت ووکامرس با تی نت پی، مشتری مبلغ دقیق سفارش را به کارت فروشگاه واریز می‌کند و تأیید خودکار کارت به کارت با پیامک بانک انجام می‌شود؛ سفارش بدون بررسی دستی رسید، پرداخت‌شده می‌شود. وضعیت سفارش‌ها خودکار است و دکمهٔ «آزمایش اتصال» و راهنمای فارسی داخل تنظیمات قرار دارد. کارمزد تی‌نت‌پی فقط برای پرداخت‌های تأییدشده کسر می‌شود.

== External services ==

This plugin connects to the TNetPay API (https://tnetpay.com/api), operated by TNetPay, to create and verify card-to-card payments. It is required for the plugin to work.

* When a customer places an order with this payment method, the plugin sends the order amount (in Toman), the order number, a short description, the store's webhook and return URLs, and metadata containing the WooCommerce order ID and site URL. The customer is then redirected to the TNetPay payment page.
* When a payment notification (webhook) arrives, when the customer returns to the thank-you page, and every 5 minutes for open orders (WP-Cron), the plugin sends the TNetPay payment ID to verify its status.
* When the store administrator clicks "Test connection" in the settings, the plugin sends the API key to read the merchant's connection status.

The store's API key is sent with every request for authentication. No customer card numbers are sent by the plugin.

* Terms of service: https://tnetpay.com/terms
* Privacy policy: https://tnetpay.com/privacy

== Installation ==

1. Upload and activate the plugin (Plugins → Add New → Upload Plugin).
2. Go to WooCommerce → Settings → Payments → TNetPay Card to Card.
3. Paste your API key from the TNetPay merchant panel (API keys).
4. In the TNetPay panel add your bank card and pair the TNetPay Android app on the phone that receives the bank SMS.
5. Save and click "Test connection", then place a small test order.

Full documentation: https://tnetpay.com/developers/card-to-card

== Frequently Asked Questions ==

= Which currencies are supported? =

Iranian Toman (IRT), Iranian Rial (IRR), thousand Toman (IRHT) and thousand Rial (IRHR). For other currencies the method is hidden at checkout.

= The customer paid but the order is still pending. =

Check that the Android app is online and has SMS permission and that the bank SMS reached the phone. The transfer must go to the displayed card for the exact amount. If the webhook cannot reach your site, the 5-minute background check confirms the order.

= Where did the order status settings go? =

Since 1.1.0 statuses are automatic and follow WooCommerce conventions. Previously saved values are ignored.

= Do I need the webhook signing secret? =

No. Leave it empty unless TNetPay support gave you one. Orders are always re-verified with the TNetPay API before being marked paid.

== Screenshots ==

1. Settings page with connection test and setup guide.

== Changelog ==

= 1.1.2 =
* Settings page script is now loaded with wp_enqueue_script; bundled translation files removed (translations come from translate.wordpress.org).

= 1.1.1 =
* TNetPay logo at checkout (classic and blocks) and on the settings page.
* Old English default title and description are replaced with the current (translated) defaults.
* WordPress.org readme and compliance updates.

= 1.1.0 =
* Automatic order statuses, Persian translation, connection test, webhook URL with copy button, currency and WP-Cron warnings, built-in guide.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.2 =
Code quality updates for WordPress.org.

= 1.1.1 =
Adds the TNetPay logo and fixes the default title/description migration.
