Skip to content

For Developers

[wpify_woo_render_qr_code]

The shortcode automatically detects the order in this order:

  1. order_id parameter in shortcode
  2. key parameter in URL (thank you page)
  3. Global variable $email (in email)
  4. Global variable $order
  5. Query variable order-pay or view-order
ParameterTypeDescription
order_idintOrder ID (optional)
[wpify_woo_render_qr_code order_id="12345"]
do_action( 'wpify_woo_render_qr_code', $order );
ParameterTypeDescription
$orderint|WC_OrderOrder ID or WC_Order object
add_action( 'woocommerce_view_order', function( $order_id ) {
$order = wc_get_order( $order_id );
if ( $order->get_status() === 'on-hold' ) {
do_action( 'wpify_woo_render_qr_code', $order );
}
}, 1, 1 );

Modifies payment data before generating the QR code.

apply_filters( 'wpify_woo_qr_payment_details', array $payment_details, WC_Order $order );
ParameterTypeDescription
$payment_detailsarrayPayment data (see below)
$orderWC_OrderOrder object
KeyTypeDescription
orderstringOrder number
totalfloatTotal amount
vsstringVariable symbol (order number without non-numeric characters)
currencystringCurrency (CZK, EUR, HUF)
due_datestringDue date (Y-m-d)
account_numberstringAccount number (CZ)
bank_codestringBank code (CZ)
ibanstringIBAN
bicstringBIC/SWIFT
notestringMessage for recipient
recipient_namestringRecipient name
add_filter( 'wpify_woo_qr_payment_details', function( $details, $order ) {
// Use custom meta as variable symbol
$custom_vs = $order->get_meta( '_custom_variable_symbol' );
if ( $custom_vs ) {
$details['vs'] = $custom_vs;
}
return $details;
}, 10, 2 );
add_filter( 'wpify_woo_qr_payment_details', function( $details, $order ) {
// Due date 14 days from order creation
$due_date = new DateTime( $order->get_date_created()->format( 'Y-m-d' ) );
$due_date->modify( '+14 days' );
$details['due_date'] = $due_date->format( 'Y-m-d' );
return $details;
}, 10, 2 );

Skips QR code rendering for a specific order/account.

apply_filters( 'wpify_woo_skip_qr_payment', bool $skip, WC_Order $order, array $account );
ParameterTypeDescription
$skipboolSkip rendering (default: false)
$orderWC_OrderOrder object
$accountarrayBank account data
add_filter( 'wpify_woo_skip_qr_payment', function( $skip, $order, $account ) {
if ( $order->is_paid() ) {
return true;
}
return $skip;
}, 10, 3 );
add_filter( 'wpify_woo_skip_qr_payment', function( $skip, $order, $account ) {
if ( $order->get_total() < 100 ) {
return true;
}
return $skip;
}, 10, 3 );

Modifies bank account data after loading from BACS and before validation.

apply_filters( 'wpify_woo_qr_account_data', array $account, WC_Order $order );
ParameterTypeDescription
$accountarrayAccount data (see below)
$orderWC_OrderOrder object
KeyTypeDescription
sourcestringData source (BACS account index or empty)
ibanstringIBAN
numberstringAccount number
bank_codestringBank code
bicstringBIC/SWIFT
recipient_namestringRecipient name
typestringQR type (cz, sk, hu, epc)
enabled_currenciesarrayEnabled currencies
enabled_countriesarrayEnabled countries
labelstringInfo label
add_filter( 'wpify_woo_qr_account_data', function( $account, $order ) {
// For orders over 10000 CZK use a different account
if ( $order->get_total() > 10000 && $order->get_currency() === 'CZK' ) {
$account['number'] = '123456789';
$account['bank_code'] = '0100';
}
return $account;
}, 10, 2 );

The module logs errors when generating QR codes to a log available in the administration:

WPify Woo → WPify Logs

EventDescription
QR generation errorFailure when creating QR code (invalid data, library exception)
Unsupported currencyOrder currency does not match QR standard
[2024-01-15 10:30:45] ERROR: QR payment: error create QR code.
{
"data": {
"order_id": 1234,
"message": "Invalid IBAN format",
"payment_details": { ... }
}
}
FilePath
QR imageswp-content/uploads/qr-payment/
Logswp-content/uploads/logs/