Skip to content

Order Metadata

When processing payments, the plugin stores metadata in WooCommerce orders.

Meta KeyTypeDescription
_gopay_idstringGoPay transaction ID — unique payment identifier from GoPay
_gopay_dataarrayComplete GoPay payment response data including gateway URL and payment details
$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.)
$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
}
$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/..."

The plugin registers two REST API endpoints for communication with GoPay:

EndpointMethodDescription
/wpify-woo/v1/gopayGETPayment validation/callback — receives payment notifications from GoPay
/wpify-woo/v1/gopay/statusGETPayment status check — verifies current payment status with GoPay

These endpoints are used internally by the GoPay payment gateway and should not be called manually.

You can add custom functions either in your child theme’s functions.php or use the Code Snippets plugin.