Order Metadata
When processing payments, the plugin stores metadata in WooCommerce orders.
Order Meta Fields
Section titled “Order Meta Fields”| Meta Key | Description |
|---|---|
_thepay_payment_uid | Unique payment identifier from ThePay |
_thepay_status | Payment status from ThePay |
_thepay_method | Payment method used (e.g., card, platba24) |
Reading Data Examples
Section titled “Reading Data Examples”Getting Payment Info from an Order
Section titled “Getting Payment Info from an Order”$order = wc_get_order( $order_id );
// Payment UID$payment_uid = $order->get_meta( '_thepay_payment_uid' );// Result: "q8yMSTmZsHgVdvgWGBWqgRF0Vp4VbfU3"
// Payment status$status = $order->get_meta( '_thepay_status' );// Result: "paid"
// Payment method$method = $order->get_meta( '_thepay_method' );// Result: "card"Payment States
Section titled “Payment States”| State | Description |
|---|---|
paid | Payment completed successfully |
preauthorized | Payment is preauthorized (awaiting capture) |
waiting_for_payment | Awaiting customer payment |
waiting_for_confirmation | Awaiting payment confirmation |
expired | Payment link expired |
preauth_cancelled | Preauthorization was cancelled |
preauth_expired | Preauthorization expired |
refunded | Payment was fully refunded |
partially_refunded | Payment was partially refunded |
REST API Endpoints
Section titled “REST API Endpoints”The plugin registers two REST API endpoints for communication with ThePay:
| Endpoint | Method | Description |
|---|---|---|
/wpify-woo/v1/thepay/notify | POST/GET | Receives payment status notifications from ThePay |
/wpify-woo/v1/thepay/result | GET | Handles customer redirect after payment |
These endpoints are used internally by the ThePay payment gateway and should not be called manually.
Where to Place Your Code
Section titled “Where to Place Your Code”You can add custom functions either in your child theme’s functions.php or use the Code Snippets plugin.