=== Scanandpay Payments via PayID for WooCommerce ===
Contributors: scanandpay
Donate link: https://scanandpay.com.au/
Tags: woocommerce, payment gateway, payid, qr code, australia
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
WC requires at least: 7.0
WC tested up to: 9.5
Stable tag: 1.2026.184
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Accept PayTo PayID payments in your WooCommerce store. Customers scan a QR code and confirm instantly.

== Description ==

**Scan & Pay** enables Australian WooCommerce stores to accept PayTo PayID payments directly. Customers scan a QR code at checkout, first-time customers approve a one-time PayTo agreement in their banking app, and returning customers confirm with a passkey.

= How It Works =

1. Customer selects "Scan & Pay" at checkout
2. A unique QR code is displayed for their order
3. Customer scans the QR code and confirms on the payment page - first-time customers approve PayTo once, returning customers use a passkey
4. Payment is verified in real-time by Scan & Pay API
5. Order is automatically marked as paid when payment is confirmed

= Features =

* **Unified SDK Architecture** - Now uses the official Scan & Pay PHP SDK logic internally
* **Instant PayTo PayID Payments** - Real-time payment confirmation via webhooks
* **QR Code Checkout** - Mobile-friendly payment experience
* **Returning Customer Passkeys** - Faster repeat checkout after one-time PayTo setup
* **WooCommerce Blocks Support** - Works with classic and block-based checkout
* **Secure** - HMAC-signed webhooks with replay protection, encrypted API communication
* **Fallback Polling** - Automatic status checks if webhooks are delayed

= Requirements =

* WooCommerce 7.0 or higher
* PHP 7.4 or higher
* A Scan & Pay merchant account ([Sign up here](https://business.scanandpay.com.au/))
* Australian PayID configured with your bank

= External Services =

This plugin connects to the **Scan & Pay API** to:

* Create payment sessions when customers checkout
* Generate QR codes for PayTo PayID payments
* Receive payment confirmation webhooks
* Verify payments in real-time
* Check payment status

**Service Provider:** Scan & Pay
**Payment Verification:** Scan & Pay API
**Terms of Service:** [https://scanandpay.com.au/terms/](https://scanandpay.com.au/terms/)
**Privacy Policy:** [https://scanandpay.com.au/privacy-policy/](https://scanandpay.com.au/privacy-policy/)

Data transmitted to the service includes: order amount, currency, order reference, and merchant credentials. No customer personal data is sent to the external service.

All QR codes are generated securely by the Scan & Pay backend infrastructure - no third-party QR code services are used.

== Installation ==

= Video Tutorial =

Watch our complete installation and setup guide:

[youtube https://www.youtube.com/watch?v=xw1xEp2M2tc&vq=hd720]

= Automatic Installation =

1. Log in to your WordPress admin dashboard
2. Go to **Plugins → Add New**
3. Search for "Scan & Pay Gateway"
4. Click **Install Now**, then **Activate**

= Manual Installation =

1. Download the plugin ZIP from [WordPress.org](https://wordpress.org/plugins/scanandpay-payments-via-payid-for-woocommerce/)
2. Go to **Plugins → Add New → Upload Plugin**
3. Upload the ZIP file and click **Install Now**
4. Activate the plugin

= Configuration =

1. Go to **WooCommerce → Settings → Payments**
2. Click **Scan & Pay** to configure
3. Log in to your [Scan & Pay Merchant Dashboard](https://business.scanandpay.com.au/) and navigate to the **Settings** page to find your credentials
4. Enter your credentials from the settings dashboard:
   * **API Base URL** - https://api.scanandpay.com.au
   * **Merchant ID** - Your unique merchant identifier
   * **PayID** - Your registered PayID (email, ABN, or phone)
   * **API Secret** - For authenticating API calls
   * **Webhook Secret** - For verifying payment confirmations
5. Enable the gateway and save

== Frequently Asked Questions ==

= Do I need a Scan & Pay merchant account? =

Yes. You need to [register as a merchant](https://business.scanandpay.com.au/) to get your API credentials. This is free to set up.

= Does this work with WooCommerce Blocks checkout? =

Yes! The plugin fully supports both classic checkout and the new WooCommerce Blocks-based checkout.

= What happens if the webhook fails? =

The plugin includes automatic fallback polling that checks payment status every 5 minutes for pending orders.

== Screenshots ==

1. Payment method selection at checkout
2. QR code payment page
3. Admin settings configuration
4. Order details with payment status

== Changelog ==

= 1.2026.184 =
* Updated: Installation video now points to the latest WooCommerce setup walkthrough.
* Updated: Manual installation instructions now link to the canonical WordPress.org plugin page.
* Maintenance: Normalized shell release scripts for macOS/Linux packaging.

= 1.2026.140 =
* Compatibility: Tested up to WordPress 7.0.
* Maintenance: Excluded development and debug files from the distributed package.

= 1.2026.128 =
* Stability: Bring plugin version in line with the rest of the Scan & Pay app suite (CalVer 1.2026.128).

= 1.2026.123 =
* Stability: Version constant now matches plugin header across all files
* Stability: Readme stable tag synced with plugin version
* Compatibility: Verified against WooCommerce 9.5 and WordPress 6.9

= 1.2026.115 =
* New: Dedicated /scanpay-pay/ payment page with custom rewrite endpoint
* Enhancement: Full-page QR code display with real-time payment status polling
* Enhancement: PayTo + PayID dual-logo branding panel on payment page
* Enhancement: Fallback payment link to pay.scanandpay.com.au for mobile users
* Security: WordPress Transients-backed nonce store for multi-request replay protection
* Performance: Instant QR code display from cached session data on payment page
* Performance: Separated payment polling from QR generation for faster page loads
* Fix: Payment status now checks both WooCommerce order status and backend session status
* Fix: QR code validation ensures correct base64 data URI format before display

= 1.2.1 =
* Technical: Unified API logic with official Scan & Pay PHP SDK
* Architecture: Extracted API client into a dedicated namespace-aware SDK internal to the plugin
* Security: Enhanced webhook verification with mandatory replay protection (timestamp + nonce checks)
* Stability: Improved error handling and connection testing using SDK exceptions
* Performance: Optimized API calls using standardized session and status retrieval paths

= 1.2.0 =
* Enhancement: New branding panel on payment page — PayTo and PayID white wordmarks side-by-side on a black pill, replacing the old "Scan & Pay" heading
* Enhancement: Retina-quality logo rendering using high-resolution source PNGs
* Enhancement: Cleaner checkout — removed PayID logo from the gateway option, leaving just "Scan & Pay" text in brand teal
* Enhancement: Updated default customer-facing description to drop the "PayID" mention for a simpler message
* Consistency: Matches T6D dual-screen and Android POS branding

= 1.1.9 =
* Enhancement: Premium BNPL-style checkout display matching Afterpay/Klarna
* Enhancement: Refined PayID logo to elegant 24px height (from 26px)
* Enhancement: Improved spacing with 12px margin-right for professional look
* Enhancement: Removed "(PayID)" suffix from title - logo provides branding
* Enhancement: Mobile optimization - 20px logo with 8px margin for compact layout
* Fix: Better browser compatibility using margin-right instead of container gap

= 1.1.8 =
* Enhancement: Upgraded to high-quality SVG PayID logo (85% smaller, retina-ready)
* Enhancement: Standardized branding sizes across all platforms (16px text, 24px logo)
* Enhancement: Added fallback text display if logo fails to load
* Fix: Improved vertical alignment of "Scan & PayID" header

= 1.1.7 =
* Enhancement: Removed "Refresh QR Code" button for cleaner UI
* Fix: Mobile menu (hamburger) compatibility - adjusted z-index and page wrapper
* Fix: Improved responsive layout on mobile devices

= 1.1.6 =
* Fix: Force cache refresh for JavaScript assets to remove session ID display
* Enhancement: Increased QR code section top margin to 6cm for better spacing

= 1.1.5 =
* Fix: Cron fallback now properly handles EXPIRED and FAILED payment statuses
* Enhancement: Cleaned up payment page - removed session ID and order details for better UX
* Fix: Expired orders are now automatically marked as failed instead of staying pending

= 1.1.4 =
* Fix: Added missing 'source' field to API requests for better backend tracking
* Fix: Improved error reporting by displaying actual API error messages in checkout
* Fix: Enhanced API key security by automatically trimming whitespace from settings
* Enhancement: Added support for 11-digit ABNs as valid PayIDs
* Enhancement: Updated admin interface with clear API key format reminders

= 1.1.3 =
* Fix: Installation video URL field now shows the official YouTube URL (read-only)

= 1.1.2 =
* Enhancement: Removed installation video URL customization field - now uses official video only
* Enhancement: Simplified installation guide settings

= 1.1.1 =
* Fix: Corrected QR code generation to use backend-generated QR codes consistently
* Fix: Removed duplicate QR processing logic that was causing issues
* Enhancement: Improved error handling when QR code is missing from backend response

= 1.1.0 =
* New: Configurable installation video URL in plugin settings
* Enhancement: Updated default installation video to latest version
* Improvement: Admins can now customize the installation guide video for their needs

= 1.0.9 =
* Security: Removed external QRServer API dependency - all QR codes now generated by Scan & Pay backend
* Documentation: Updated external services disclosure to accurately reflect QR code generation
* Fix: Removed fallback code that called third-party api.qrserver.com service

= 1.0.8 =
* New: Added installation video tutorial (720p HD) to Installation section
* Enhancement: Added video guide to admin settings page
* Documentation: Updated changelog to remove backend implementation details

= 1.0.7 =
* Security: Enhanced admin interface security and privacy
* Improvement: Cleaner payment method descriptions without technical details
* Documentation: Updated webhook configuration text to reference merchant dashboard
* Fix: Removed HTML entity encoding issues with ampersands in admin display
* Enhancement: Improved admin settings clarity and consistency

= 1.0.6 =
* Compatibility: Declared HPOS (High-Performance Order Storage) support for WooCommerce
* Documentation: Updated API endpoint reference to id.scanandpay.com.au
* Technical: Added FeaturesUtil compatibility declaration for custom_order_tables

= 1.0.5 =
* Performance: Removed 5-second QR code loading delay on payment page
* Improvement: QR code now appears instantly (< 1 second) after checkout
* Technical: QR code loads immediately from cached session data instead of waiting for status poll

= 1.0.4 =
* Added distribution build scripts for cleaner plugin packaging
* Improved development workflow with automated build tools
* Enhanced documentation for plugin distribution and deployment

= 1.0.3 =
* Updated plugin name to "Scanandpay Payments via PayID for WooCommerce" to comply with WordPress.org naming guidelines
* Updated text domain to "scanandpay-payments-via-payid-for-woocommerce"
* Improved plugin naming to clearly distinguish from other plugins and show integration relationship with PayID

= 1.0.2 =
* Updated plugin name to "Scan & Pay PayID Gateway for WooCommerce" for WordPress.org compliance
* Added "Requires Plugins" header for WooCommerce dependency
* Updated text domain to match new plugin slug
* Enhanced external services documentation
* Renamed main plugin file to match directory slug

= 1.0.1 =
* Improved QR code display on payment page
* Added connection test button in admin
* Enhanced error logging

= 1.0.0 =
* Initial release
* PayID payment support via QR codes
* WooCommerce Blocks integration
* Webhook payment confirmations
* Cron fallback for missed webhooks

== Upgrade Notice ==

= 1.2026.128 =
Version aligned with the rest of the Scan & Pay app suite. Recommended for all users.

= 1.2026.123 =
Stability update: version consistency fixes. Recommended for all users.

= 1.2026.115 =
New dedicated payment page with improved QR display and real-time polling. Enhanced replay protection using WordPress Transients.

= 1.2.1 =
Major architectural update: unified API logic with official SDK. Highly recommended for improved security and stability.

= 1.1.4 =
Bug fixes and stability improvements. Recommended update for better error reporting and support for ABN-based PayIDs.

= 1.0.9 =
Security update: Removed external QR code service dependency. All QR generation now handled securely by Scan & Pay infrastructure.

= 1.0.8 =
Added installation video tutorial for easier setup. Watch the step-by-step guide directly from the Installation tab.

= 1.0.7 =
Security and UI cleanup update. Enhanced admin interface for better security and cleaner professional appearance.

= 1.0.6 =
HPOS compatibility update. Removes WooCommerce incompatibility warning for stores using High-Performance Order Storage.

= 1.0.5 =
Performance improvement: QR code loads 85-95% faster on payment page. Highly recommended update for better customer experience.

= 1.0.4 =
Maintenance update with improved build tooling and distribution workflow.

= 1.0.3 =
WordPress.org naming compliance update. Plugin name updated to meet directory guidelines and clearly show PayID integration.

= 1.0.2 =
WordPress.org compliance update. Includes updated plugin name and slug for official directory listing.

= 1.0.1 =
Recommended update with improved QR code handling and admin tools.

= 1.0.0 =
Initial release. Configure your Scan & Pay credentials to start accepting PayID payments.
