=== Tranzak for WooCommerce ===
Contributors: tranzak
Tags: payments, woocommerce, moncash, natcash, haiti
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 8.0
WC tested up to: 11.1
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept MonCash, NatCash, bank cards and LakayPay Card payments in WooCommerce through Tranzak.

== Description ==

Tranzak for WooCommerce adds four payment methods to your checkout. Each one is a separate WooCommerce payment method, so you can enable them independently and your customers choose directly at checkout:

* **MonCash** (HTG; a store priced in USD is converted to HTG by Tranzak)
* **NatCash** (HTG; a store priced in USD is converted to HTG by Tranzak)
* **Credit / debit card** (HTG and USD) - card details are entered on a secure page hosted by Tranzak and never reach your shop
* **LakayPay Card** (HTG and USD)

Features:

* Works with the WooCommerce Cart and Checkout blocks and with the classic shortcode checkout.
* Compatible with High-Performance Order Storage (HPOS).
* Payment status is always verified with the Tranzak API; return URLs and webhooks are never trusted on their own.
* Signed webhooks (HMAC-SHA256) with automatic, idempotent order updates, including late payments.
* Double-click protection: one order never creates two payments for the same attempt.
* Test mode with `tk_test_` keys.
* English and French.

= Requirements =

* A Tranzak merchant account and a website with an API key and a webhook secret (Tranzak dashboard > Developers).
* Store currency set to HTG or USD.
* A public https address for your shop, so Tranzak can send webhooks (card payments in live mode also require Tranzak approval).

= External service =

This plugin sends payment data (order amount and currency, order reference and description, and the customer's name, email and phone number) to the Tranzak API (https://tranzak.mykaypa.com) to create and verify payments. See the Tranzak terms of service and privacy policy on https://tranzak.mykaypa.com.

== Installation ==

1. Upload the plugin and activate it (WooCommerce must be active).
2. Go to **WooCommerce > Tranzak**, choose the mode, enter your API key and your webhook secret, and save.
3. Copy the **Webhook URL** and the **Return URL** shown on that page into your Tranzak dashboard (your website's "Webhook URL" and "Return URL").
4. Click **Test connection**.
5. Go to **WooCommerce > Settings > Payments** and enable the Tranzak methods you want.

== Frequently Asked Questions ==

= Does it support refunds from WooCommerce? =

Not yet. Refund a payment from your Tranzak dashboard, then update the order in WooCommerce.

= Which currencies are supported? =

HTG and USD. MonCash and NatCash charge in gourdes (HTG): if your store is priced in USD, Tranzak converts the order total to HTG at its own exchange rate (rounded up to the next gourde) and the customer is told the rate at checkout. The card and LakayPay Card accept HTG and USD. If your store uses another currency, the Tranzak methods are hidden.

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

The order updates automatically when Tranzak's webhook arrives. Check that the Webhook URL is registered in your Tranzak dashboard and that the webhook secret in the plugin matches. Enable the debug log (WooCommerce > Tranzak) and read WooCommerce > Status > Logs (source: tranzak).

= Can the same Tranzak website be used by several shops? =

Yes, but set a different "Order reference prefix" in each shop.

== Changelog ==

= 1.0.2 =
* Payment method logos (MonCash, NatCash, card, LakayPay Card) in the classic and block checkouts.

= 1.0.1 =
* MonCash and NatCash now stay available when the store is priced in USD: Tranzak converts the total to HTG at its rate, the checkout shows the rate, and the order records the conversion.

= 1.0.0 =
* First release: MonCash, NatCash, card and LakayPay Card; Cart & Checkout blocks; HPOS; signed webhooks.
