=== VeilNebula Crypto Payments ===
Contributors: veilnebula
Tags: cryptocurrency, payment gateway, usdt, usdc, woocommerce
Requires at least: 6.0
Tested up to: 6.8
WC requires at least: 7.0
Requires PHP: 8.1
Stable tag: 0.2.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Hosted USDT and USDC payments for WooCommerce with signed payment notifications.

== Description ==

Customers pay with USDT or USDC on Tron, Ethereum, Solana, TON, Polygon, Arbitrum or Base.
Available asset/network pairs: https://api.veilnebu.la/v1/services.

VeilNebula is a custodial gateway. Payments reach platform addresses; the merchant balance is an amount owed by the platform. Payouts and refunds are not live yet.

The plugin redirects buyers to the payment page, keeps the project key on your server and updates orders from verified webhooks. It supports the classic checkout, Checkout block and WooCommerce order API, including HPOS.

== Installation ==

1. Upload the plugin ZIP in Plugins → Add New → Upload Plugin, or copy the supplied folder to wp-content/plugins/nebula-gateway/.
2. Activate VeilNebula Crypto Payments.
3. Open WooCommerce → Settings → Payments → Crypto (VeilNebula).
4. Enter the API base URL (https://api.veilnebu.la), project API key and Webhook secret. Choose USDT or USDC under Receive payouts in. Tick Test mode only with a test project key.
5. Register the webhook URL shown under Webhook secret in your project and enable the gateway.

== Fields ==

Title: Pay with crypto.
Project API key: Starts with ncp_test_ (test project) or ncp_live_ (live project). Keep it private.
Webhook secret: Copy the secret for your endpoint; its URL is shown under the field.
Receive payouts in: USDT or USDC. Payouts are not live yet.
Test mode: Tick while you use a test project key.

== Order statuses ==

Pending / confirming: order remains unpaid.
Paid / overpaid: a matching live payment completes payment through WooCommerce.
Partially paid: order remains unpaid; a note records received and expected invoice amounts.
Expired / cancelled: an unpaid order is cancelled.
Failed: an unpaid order is marked failed.
Chain reorganisation: an order paid by that invoice is put on hold for review.
Test payments and mismatched payment details: review the order and gateway log.

== Frequently Asked Questions ==

= What happens on an underpayment? =

The order stays unpaid. Review the received and expected amounts in its notes before fulfilling it.

= Are refunds or payouts available? =

Neither feature is live yet. The plugin does not offer a WooCommerce refund action.

= Where are technical errors recorded? =

WooCommerce logs under nebula-gateway. Buyers receive a retry or alternative-payment instruction instead of API details.

= How do I get support? =

Telegram only: https://t.me/veilnebula_bot.

== External services ==

This plugin connects to the VeilNebula payment API at https://api.veilnebu.la to create invoices when a buyer chooses Pay with crypto. It sends the order identifier, amount, currency, chosen balance asset and return URLs. The project key authenticates server-side requests and is not sent to the buyer's browser.

Buyers open the checkout URL returned by the API. Signed payment notifications are delivered to your store's webhook URL to update orders.

Service information: https://api.veilnebu.la/v1/services
Terms and privacy information: https://veilnebu.la/legal
Documentation: https://veilnebu.la/docs

== Screenshots ==

1. Gateway settings under WooCommerce → Settings → Payments → Crypto (VeilNebula): API base URL, project API key, webhook secret, payout asset and test mode.
2. The Pay with crypto option on the store checkout page.
3. The hosted VeilNebula payment page the buyer is redirected to.

== Uninstall ==

Deleting the plugin from the Plugins screen removes its stored settings (woocommerce_nebula_settings) and its activation timestamp. Orders, order notes and WooCommerce logs are kept.

== Changelog ==

= 0.2.0 =
* Added Checkout block integration and HPOS compatibility declarations.
* Scoped invoice references and idempotency keys to the store, order total and balance asset.
* Added expired-invoice handling and paid-order replay handling.
* Checked live payment amounts, currencies and references before completing orders.
* Added payment review notes, received/expected partial amounts and chain-reorganisation handling.

= 0.1.0 =
* Initial hosted-checkout and signed-notification integration.
