Order Metadata
When processing payments, the plugin stores metadata in WooCommerce orders.
Order Meta Fields
Section titled “Order Meta Fields”| Meta Key | Type | Description |
|---|---|---|
_gopay_id | string | GoPay transaction ID — unique payment identifier from GoPay |
_gopay_data | array | Complete GoPay payment response data including gateway URL and payment details |
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 );
// GoPay transaction ID$gopay_id = $order->get_meta( '_gopay_id' );// Result: "3048205082"
// Complete GoPay payment data$gopay_data = $order->get_meta( '_gopay_data' );// Result: array with full GoPay response (id, gw_url, state, amount, etc.)Checking If an Order Was Paid via GoPay
Section titled “Checking If an Order Was Paid via GoPay”$order = wc_get_order( $order_id );
if ( $order->meta_exists( '_gopay_id' ) && $order->is_paid() ) { $gopay_id = $order->get_meta( '_gopay_id' ); // Order was paid via GoPay with transaction ID $gopay_id}Getting the GoPay Gateway URL
Section titled “Getting the GoPay Gateway URL”$order = wc_get_order( $order_id );
$gopay_data = $order->get_meta( '_gopay_data' );$gw_url = $gopay_data['gw_url'] ?? '';// Result: "https://gate.gopay.cz/gw/v3/..."REST API Endpoints
Section titled “REST API Endpoints”The plugin registers two REST API endpoints for communication with GoPay:
| Endpoint | Method | Description |
|---|---|---|
/wpify-woo/v1/gopay | GET | Payment validation/callback — receives payment notifications from GoPay |
/wpify-woo/v1/gopay/status | GET | Payment status check — verifies current payment status with GoPay |
These endpoints are used internally by the GoPay 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.