=== StackAPI for WooCommerce ===
Contributors: stacktechnology
Tags: woocommerce, payments, nigeria, naira, sms
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept naira payments through StackAPI's checkout and send order SMS, email and phone confirmation codes from your StackAPI account.

== Description ==

StackAPI for WooCommerce connects a WooCommerce shop to a StackAPI account.

* **Payments.** Customers pay on StackAPI's secure checkout page. An order is marked paid only after StackAPI confirms the payment: the plugin reads the payment back from StackAPI before it changes any order. No card details ever reach your site.
* **Order SMS and email.** Send a text or a plain-text email to the customer and to your own team when an order is processing, completed, on hold, refunded, failed or cancelled.
* **Phone confirmation for Cash on Delivery.** Ask for a code sent by SMS before a Cash on Delivery order is placed (classic checkout).

The plugin is free. You pay for what you use at your StackAPI prices (Pricing page in the StackAPI dashboard), from your StackAPI wallet.

What it does not do (1.0.0):

* Partial refunds. StackAPI refunds whole payments; refund part of an order another way.
* Payments in any currency but the Nigerian naira (NGN).
* Phone confirmation in the Checkout block (it works with the classic checkout).
* Multisite networks were not tested.

Moving from another payment plugin? The StackAPI dashboard's Migration Centre (Developer Tools) explains the differences.

== Installation ==

1. Plugins > Add New > Upload Plugin, choose `stackapi-for-woocommerce-1.0.0.zip`, Install, Activate. WooCommerce must be installed and active.
2. In the StackAPI dashboard, API keys: create a test key pair with Payments (and Notifications for SMS and email).
3. WooCommerce > StackAPI: choose Test, paste the secret key and the public key, Save, then Check connection.
4. In the StackAPI dashboard, Webhooks: add the webhook URL shown on the plugin's page with the events payment.success, payment.failed, payment.refunded and refund.failed, turn on test events, and paste its signing secret in the plugin.
5. WooCommerce > Settings > Payments: turn on StackAPI.
6. Run the sandbox test on the plugin's page, then place a test order and pay it with a StackAPI test card.
7. When StackAPI has approved your account for live use: create a live key pair, enter it under Live keys with the live webhook secret, choose Live, Save, Check connection.

== Frequently Asked Questions ==

= Is an order ever marked paid from the customer's browser? =

No. When the customer comes back from the checkout, the plugin asks StackAPI for the payment by its own reference and checks the amount, currency, email and mode. Webhooks are verified by their signature and are also only a reason to ask StackAPI again.

= What if StackAPI cannot reach my site's webhook? =

Orders are still confirmed: the plugin rechecks unpaid orders on a schedule for a day (WooCommerce's Action Scheduler).

= Where are my keys stored? =

In your site's database, sealed with a key derived from your site's own security keys (wp-config.php). They are never shown again after you save them.

== External services ==

This plugin connects to StackAPI (https://api.stackapi.app), the payment, messaging and verification service of Stack Technology Limited, because that is the service it exists to use. Nothing is sent until you save your StackAPI keys.

* When you check the connection: your public key and secret key (in request headers) to read which services your key allows.
* When a customer pays: the order's amount, currency, the customer's email, the order reference and the return address, to open StackAPI's checkout; later the reference, to read the payment's status.
* When you refund: the payment reference and the reason.
* When order messages are on: the customer's or your team's phone number or email address and the message text.
* When phone confirmation is on: the customer's phone number, to send and check the code.
* StackAPI sends signed payment events back to your site's webhook address.

StackAPI terms: https://stackapi.app/terms
StackAPI privacy policy: https://stackapi.app/privacy

== Changelog ==

= 1.0.0 =
* First release: StackAPI checkout for classic checkout and the Checkout block, full refunds, scheduled rechecks, signed webhooks, order SMS and email, phone confirmation for Cash on Delivery.
