=== Payments with Eway for Paid Memberships Pro ===
Contributors: awesoft
Donate link: https://ko-fi.com/awesoft
Tags: pmpro, paid memberships pro, memberships, payments, eway
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://awesoft.dev/license/

Accept one-time and recurring Paid Memberships Pro payments through Eway, with Secure Fields on your checkout page or Eway's hosted payment page.

== Description ==

Payments with Eway for Paid Memberships Pro adds Eway as a payment gateway for [Paid Memberships Pro](https://www.paidmembershipspro.com/), so membership sites in Australia and New Zealand can take card payments for one-time and recurring levels.

Card details are entered into fields or pages served by Eway and never pass through your server. Your site keeps only a token, which the plugin uses to charge renewals automatically when they fall due.

= Two ways to collect card details =

**Secure Fields** keeps members on your checkout page. Each card field is an iframe served by Eway, so your site only ever sees a token. 3D Secure 2 can be switched on for these checkouts.

**Responsive Shared Page** sends members to a payment page hosted by Eway and returns them to your site when they are done. 3D Secure is built in, and you can set the page's theme, heading and logo.

= Features =

* One-time and recurring membership levels
* Automatic renewals charged against the member's saved card
* Declined renewals retried three times, one hour apart, before the membership is cancelled
* Members can replace the card on file from the Membership Billing page
* Full refunds from the Paid Memberships Pro order screen
* Separate sandbox and live credentials, following the Gateway Environment in Paid Memberships Pro
* Connection test button on the settings page
* Optional debug log that never records card data, passwords or API keys
* Admin notice if renewals have not been processed for several hours
* Shared Page orders that a member abandons are reconciled with Eway automatically

= How renewals work =

Eway does not run subscriptions for you. At checkout the plugin saves the member's card as an Eway token customer. When a payment falls due, Paid Memberships Pro's hourly task charges that token through Action Scheduler. Renewals therefore depend on WP-Cron (or a system cron calling it) running on your site.

= External services =

This plugin connects to Eway's Rapid API to take payments, save cards, process refunds and check transaction results. Checkout and renewal requests send the member's name, billing address, email, phone number and IP address, the order amount, currency and order code, and the site's Paid Memberships Pro, WordPress, PHP and plugin versions. Requests go to `https://api.ewaypayments.com` (live) or `https://api.sandbox.ewaypayments.com` (sandbox).

With Secure Fields, the checkout page loads Eway's Secure Fields script from `https://secure.ewaypayments.com` and, when 3D Secure is enabled, Eway's 3D Secure script from `https://static.assets.eway.io`. Card details are entered directly into Eway's iframes. With the Responsive Shared Page, the member is redirected to a page on an Eway domain to enter their card.

Eway's terms and privacy policy: https://www.eway.com.au/legal/

This plugin is developed independently and is not affiliated with, endorsed by or supported by Eway or Paid Memberships Pro.

= Support this plugin =

If this plugin saves you time, you can support its development on Ko-fi or Buy Me a Coffee.

[![Support me on Ko-fi](https://ps.w.org/awesoft-pmpro-eway/assets/kofi.png)](https://ko-fi.com/awesoft) [![Buy me a coffee](https://ps.w.org/awesoft-pmpro-eway/assets/buymeacoffee.png)](https://buymeacoffee.com/awesoft)

== Installation ==

1. Install and activate Paid Memberships Pro 3.6 or newer.
2. Install and activate Payments with Eway for Paid Memberships Pro.
3. Go to Memberships > Settings > Payments, choose Eway as the payment gateway and save.
4. In the Eway settings that appear, enter your API key and API password for the environment you are using. Secure Fields also needs the public API key, which starts with `epk-`.
5. Save, then click Test connection.

Your API key and password are in MYeWAY under My Account > API Key. To refund from WordPress, the key's role needs the "Rapid API Refunds" permission.

== Frequently Asked Questions ==

= Where do I get help? =

For help with the plugin, use its support forum on WordPress.org. For questions about your Eway account, merchant facility or settlements, contact Eway.

= Do I need an Eway account? =

Yes. Sign up at eway.com.au or eway.io, then create an API key in MYeWAY. A sandbox account lets you test without charging real cards.

= Which should I choose, Secure Fields or the Responsive Shared Page? =

Secure Fields gives the smoothest experience because members never leave your site, and it supports 3D Secure 2. The Responsive Shared Page needs no public API key and handles 3D Secure on Eway's side, which is the simplest setup.

= Does it support recurring memberships? =

Yes. The card is saved as an Eway token customer and the plugin charges renewals when they fall due. Renewals run through WP-Cron and Action Scheduler, so cron must be working on your site. The plugin shows an admin notice when renewals have not been checked for more than six hours.

= What happens when a renewal payment is declined? =

The plugin retries three times, at least one hour apart. If every retry fails, the subscription is cancelled and the member is notified through the usual Paid Memberships Pro emails. If the member updates their card in the meantime, the next retry runs straight away.

= Can members update their card? =

Yes, from the Membership Billing page. The new card replaces the saved token at Eway.

= Can I refund an order? =

Yes, from the order's edit screen in Paid Memberships Pro. Refunds are for the full order total. The API key must have the "Rapid API Refunds" permission in MYeWAY.

= Does it support 3D Secure? =

Yes. The Responsive Shared Page handles it automatically. For Secure Fields, turn on 3D Secure in the plugin settings and in your Eway account; cards that are not enrolled continue without it.

= Are trial periods supported? =

Custom trial periods are not supported. A recurring level with nothing to pay today saves the card and charges from the first renewal.

= Which currencies are supported? =

The currency set in Paid Memberships Pro is sent to Eway as-is, so it must be one your Eway account accepts.

= Does cancelling a membership tell Eway? =

Eway has no subscription to cancel. Cancelling in Paid Memberships Pro stops the plugin from charging the card.

= Is anything sensitive stored on my site? =

Card details are never stored. The plugin keeps the Eway token customer ID and the card's brand, last four digits and expiry so members can see which card is on file. API credentials are stored in the WordPress options table.

= What is removed on uninstall? =

The plugin's settings. Orders, subscriptions and their Eway references are left in place.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
