=== CatCode Payroc Payments for WooCommerce ===
Contributors: catcodestudio
Tags: payroc, credit card, payment gateway, hosted payment page, woocommerce
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Take card payments on the Payroc Hosted Payment Page and refund them from WooCommerce.

== Description ==

Adds Payroc as a card payment method to WooCommerce. At the checkout the buyer is sent to the Payroc [Hosted Payment Page](https://docs.payroc.com/guides/payments/hosted-payment-page/overview), so card details never touch your shop, and comes back to the order confirmation. You use your own Payroc merchant account and terminal.

* **Hosted Payment Page** — the request is signed with your terminal secret (SHA-512); every payment attempt of an order gets its own order reference, so a second try after a decline is not refused.
* **Two ways back** — the signed answer on the receipt page, and background validation that Payroc posts to the shop even when the buyer closes the page right after paying. Both are checked with the terminal secret, and the approved amount is compared with the order total: a different amount puts the order on hold.
* **Plain results** — a declined card gives a failed order with the reason in words, and the buyer is back at the payment step with the cart intact; a repeated answer changes nothing.
* **Refunds from WooCommerce** — full or partial, through the Payroc API (a payment still in an open batch is cancelled by Payroc instead).
* **Check payment status** — a button on the order screen asks Payroc about the order if no answer reached the shop.
* **Check connection** — confirms the API key and that the terminal is active.
* Test and live mode, the classic and the block checkout, HPOS. The terminal secret and the API key are stored encrypted. US dollars or Canadian dollars, one terminal.
* Language: English.

= Pro =

The Pro version is sold on [catcode.com.ua](https://catcode.com.ua/modules/catcode-payroc-payments-for-woocommerce/), with a 7-day trial that never starts by itself:

* **Payment links** — a single-use Payroc link for any unpaid order (for example a phone order), e-mailed to the buyer by Payroc; the order is paid when the link is paid, and the link is switched off when the order is paid or cancelled.
* **Authorize now, capture later** — the amount is held on the card at the checkout and captured automatically when the order is marked Completed or Processing, or with a Capture button; a cancelled order releases the hold.
* **Bulk actions** on the orders list — refund in full, capture held payments, check payment status.
* **Background check** — every hour the shop asks Payroc about orders still waiting for payment.
* **Payments report** — Payroc payments of a period next to the shop orders (approved but unpaid, different amount, unknown to the shop), settled or not, with CSV export.
* **More terminals** — one Payroc terminal per further currency.
* Updates from catcode.com.ua.

The licence runs for 1-5 years and includes updates and support for that term; a purchased licence keeps its Pro features after the term ends. One key covers two sites: the shop and its test copy.

Payroc is a trademark of its owner. This plugin is an independent integration made by CatCode; it is not an official plugin of Payroc and is not affiliated with or endorsed by it. You need your own Payroc merchant account.

== External services ==

The plugin connects to Payroc (Payroc WorldAccess, LLC, [payroc.com](https://payroc.com/), documentation at [docs.payroc.com](https://docs.payroc.com/)), and only after you enter your terminal or API key.

* At the checkout the buyer's browser posts to the Payroc Hosted Payment Page (`payments.payroc.com`, in test mode `payments.uat.payroc.com`): your terminal ID, an order reference made of the order number and a random part, the currency, the amount, the time of the request and a signature made with your terminal secret (the secret itself is not sent). Payroc collects the card details on its page.
* Payroc sends the result back to the shop: to the receipt address in the buyer's browser, and to the validation address from its servers.
* With the API key (`identity.payroc.com` for an access token, `api.payroc.com` for the calls): on a refund the payment ID, the amount and the reason; on "Check payment status" the terminal ID and the order reference; on "Check connection" the terminal ID.
* Pro: for a payment link the amount, currency, order reference, shop name and order number, and for e-mailing it the buyer's name and e-mail address; for capture or release the payment ID and the amount; for the report the terminal ID and the dates.

[Payroc privacy policy](https://payroc.com/legal/privacy-policy/)

== Installation ==

1. Upload the plugin and activate it. WooCommerce must be active, and the shop currency US or Canadian dollars.
2. In WooCommerce → **Payroc** choose test or live mode, enter the terminal ID and the terminal secret from the Payroc Self-Care Portal (Settings → Terminal), and the API key from the Payroc Developer Portal.
3. In the Self-Care Portal (Settings → Terminal) paste the two addresses the plugin shows: the Receipt Page URL, and the Validation URL with "Enable Validation" ticked.
4. Press "Check connection", save, and enable "Payroc (card)" in WooCommerce → Settings → Payments. Place a test order with a Payroc test card.

== Frequently Asked Questions ==

= Do I need a Payroc account? =

Yes, a Payroc merchant account with a terminal set up for the Hosted Payment Page. The plugin does not open the account.

= Why does the order stay "Pending payment"? =

No answer from Payroc has reached the shop yet. Check that the Validation URL is set in the Self-Care Portal, or press "Check payment status" on the order.

= Can I take payments without the API key? =

Yes, the checkout needs only the terminal ID and the terminal secret. Refunds and the status check need the API key.

= Does it work with the block checkout? =

Yes, with the block and the classic checkout.

== Changelog ==

= 1.0.0 =
* First release.
