=== AuxPAY Payment Gateway ===
Contributors: auxpay
Tags: woocommerce, payment, hosted page, credit card, ach, text-to-pay
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.2
Stable tag: 6.2.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept card, ACH and text-to-pay payments in WooCommerce with AuxPAY — secure checkout without sending shoppers off your store.

== Description ==

AuxPAY Payment Gateway lets your customers pay without leaving your store, using:

* **Secure Online Payment** — a slide-out checkout drawer on the same page
* **Credit Card Payments**
* **ACH Payments**
* **Text to Pay** links

It works with both the **classic WooCommerce checkout** and the **WooCommerce Blocks checkout**, and shows the AuxPAY brand at checkout so shoppers recognise who is handling the payment.

The card logos shown at checkout follow the brands your AuxPAY gateway actually accepts, so your storefront never advertises a card that would be declined.

= Features =

* **Secure Online Payment** — same-page slide-out iframe drawer; customers never leave your store
* Securely accept credit card payments
* ACH payments (no tokenization required)
* Text to Pay option that generates a secure link
* Payrix integration for card payments through PayFields
* Full and partial refunds for all gateways
* Optional technology/convenience fee
* Signed webhook (HMAC-SHA256) for authoritative payment confirmation
* Accepted card brands resolved from your gateway, not a separate list to keep in step
* Debug logs option for monitoring

= Requirements =

* WordPress 6.0+
* WooCommerce 7.0+
* PHP 7.2+
* An AuxPAY merchant account — https://auxpay.net/

== Installation ==

1. Install through the **WordPress Plugins screen**, or upload the plugin files to `/wp-content/plugins/auxpay-payment-gateway-lr`.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Navigate to **WooCommerce → Settings → AuxPAY Gateway**.
4. Enter your **API URL** and **API Key** from your AuxPAY merchant account, then save.
5. Click **Test Connection**, then **Fetch Configuration** to pull your merchant settings, fees and accepted card brands.
6. Go to **WooCommerce → Settings → Payments** and enable the methods you want (Secure Online Payment, Credit Card, ACH, Text to Pay).
7. For **Secure Online Payment**: set the **Iframe Origin** and the **Webhook Secret** (generate a random string and copy it into your AuxPAY dashboard alongside the displayed Webhook URL).
8. Save changes and start accepting payments.

== Usage ==

After installation and configuration:

1. Customers see **Secure Online Payment**, **Credit Card Payment**, **ACH Payment**, or **Text to Pay** at checkout, with the AuxPAY brand shown under the method.
2. Selecting **Secure Online Payment** opens a secure checkout drawer on the same page.
3. Paying with **Credit Card** or **ACH** collects the details securely during checkout.
4. Selecting **Text to Pay** sends a secure payment link to the customer's phone number.
5. Orders are updated in WooCommerce automatically when the payment is processed.
6. Transaction details appear on the WooCommerce **Order Details** page.

== Frequently Asked Questions ==

= Does this plugin work with WooCommerce Checkout Blocks? =
Yes, both the classic checkout and the Checkout Block are supported.

= Do I need SSL on my site? =
Yes. Your site must use HTTPS when accepting live payments.

= Where do I find my API credentials? =
In your AuxPAY merchant account. Contact AuxPAY support if you do not have them.

= Does this plugin store card data? =
No. Card and ACH details are handled by AuxPAY's API; the plugin does not store them.

= Why are some card brands missing from the checkout icons? =
The icons follow the card brands your AuxPAY gateway is boarded for. If a brand is missing, correct the gateway's Card Brand Configuration in the AuxPAY portal and click **Fetch Configuration** again.

= I already run the white-label AuxCORE build. Can I run both? =
No — but switching is one click. Activating this plugin deactivates the white-label build and tells you it did; your API key and settings are shared, so they survive the move, and you can switch back the same way. Only if both are somehow left active at once does the white-label build take precedence and this one stand down with a notice.

== Screenshots ==

1. AuxPAY gateways listed in WooCommerce
2. AuxPAY gateway settings in WooCommerce
3. Checkout page with AuxPAY payment methods

== Changelog ==

= 6.2.2 =
* Supports AuxPAY **Velocity Rules**. When one of the merchant's rules flags a payment, the processor approves it but AuxPAY holds it until the merchant reviews it. The order is now set to **On hold** with a note instead of being marked paid. It moves to Processing when the merchant approves the payment and is cancelled when they deny it
* The customer is told the payment was received and is being reviewed, then taken to their order. The order page shows On hold until the review is done
* Applies to Secure Online Payment, Credit Card and ACH. The hold comes from the new `transaction.in_review` notification, from the payment response, and from the payment-status check the drawer runs when no notification arrives
* After updating, the plugin re-registers its payment-notification webhook once so it receives the new event. You do not need to save the settings again

= 6.2.1 =
* The **Donation** option is now in the **Product data** header, next to Virtual and Downloadable. It used to sit at the bottom of the General tab, where it was easy to miss. Products already marked as donations stay marked
* Donations are charged on the AuxPAY gateway your merchant reserves for donations (its own MID and rate), through Secure Online Payment. A donation must be checked out separately from other items. If the merchant has no donation gateway, the plugin warns you and the payment is refused rather than charged on your sales account

= 6.2.0 =
* Adds **Merchant accounts**: one store can now take payments on more than one AuxPAY merchant account, each with its own MID, fees and statement — for example donations on a nonprofit account and event tickets on your main one. Add an account's API key in the plugin settings under **Merchant accounts**
* Choose what each account takes with the **Payment account** setting on a product, or by assigning product categories to an account. Anything not assigned stays on your main account (**Default**)
* Every order is charged on exactly one account; items from different accounts must be checked out separately. Confirmations and refunds use the account that took the payment
* Refused payment notifications now return a real error status so they are retried, and a webhook that cannot be registered is reported on the settings page
* A store with a single account works exactly as before
* Fixes paying from a pay-for-order link with Secure Online Payment, which used to stop with "Starting your payment took too long"
* Fixes refunds made from the WooCommerce order screen being recorded twice once AuxPAY confirmed them
* Fixes **Test connection** and **Fetch configuration** on a merchant account not refreshing its WooCommerce status: both now re-read it from AuxPAY and update the row straight away
* Warns when an account's store URL in AuxPAY does not match this store — every account needs this store's URL, or its payment page will not open here

= 6.1.1 =
* The AuxPAY branding at checkout is now driven by a **Payment branding** setting rather than by which build is installed. On this build it stays fixed on and is shown read-only, so nothing about your checkout changes
* Both distributions now run identical code and differ only in their defaults — the last hard-coded difference between them is gone
* No change to payments, fees, webhooks, refunds or the checkout drawer

= 6.1.0 =
* First store release of the AuxPAY-branded build. The AuxPAY name, logo and website are shown at checkout and are not overwritten by the merchant branding fetched from the AuxPAY portal
* Built from the same codebase as the white-label build, so payments, fees, webhooks, refunds and the checkout drawer behave identically
* Only one of the two builds can be active at a time. Activating this one deactivates the white-label build and says so in wp-admin; settings are shared and carry over
* The accepted-card icons at checkout come from the card brands your gateway is boarded for, so the storefront cannot advertise a brand that would be declined

== Upgrade Notice ==

= 6.2.2 =
Upgrade in place; settings are kept. Payments flagged by the merchant's AuxPAY Velocity Rules now leave the order On hold until the merchant approves or denies them. The webhook re-registers itself once after the update.

= 6.2.1 =
Upgrade in place; settings and donation-marked products are kept. The Donation option moves to the Product data header.

= 6.2.0 =
Upgrade in place; your settings and checkout are unchanged. New: Merchant accounts, for stores that charge some products on a different merchant account. Nothing changes unless you add one.

= 6.1.1 =
Upgrade in place. The AuxPAY branding at checkout is now a setting rather than a build difference, and on this build it stays switched on and read-only — your checkout is unchanged.

= 6.1.0 =
First store release. If you already run the white-label build, deactivate it before activating this one — the two share the same settings and only one can be active at a time.
