This plugin adds “Pay with NYVA” as a WooCommerce payment method. When the customer chooses NYVA Pay and places the order:
- The plugin creates a payment session via the NyvaPay API (POST /api/merchant/payment-links).
- The customer is redirected to the NyvaPay hosted checkout page.
- After payment, NyvaPay sends a webhook to your site; the plugin marks the order as paid and WooCommerce sends the order confirmation email.
Requirements
- WordPress 5.0 or later
- WooCommerce 4.0 or later (tested with WooCommerce 8.x)
- PHP 7.4 or later
- A NyvaPay merchant account with Pro subscription and an API key from the NyvaPay dashboard
API used
- Create payment session:
POST {base_url}/api/merchant/payment-links
- Headers:
X-Merchant-Email, X-API-Key, Content-Type: application/json
- Body: amount, currency, product_name, order (WooCommerce order ID), webhook_url, success_redirect_url, customer_email, customer_name, optional metadata
- Response: pay_url (redirect URL), payment_request_id
Webhook
When payment completes, NyvaPay POSTs to your webhook URL with a JSON body:
- Event:
payment.succeeded
- Fields: order (your WooCommerce order ID), amount, currency, payment_request_id, transaction_id, status (“paid”), product_name, customer_email, customer_name, metadata
The plugin registers the webhook at: https://yoursite.com/wc-api/nyva_callback/ (WooCommerce builds this from your site URL). You do not need to configure this URL in NyvaPay; the plugin sends it automatically when creating each payment.