Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rvdsteege/9b1e8736d8976c99593cbd0958e3d572 to your computer and use it in GitHub Desktop.
Save rvdsteege/9b1e8736d8976c99593cbd0958e3d572 to your computer and use it in GitHub Desktop.
Get the value of a Buckaroo parameter on payment status changes with the Pronamic Pay plugin for WordPress.
<?php
// Add below code to functions.php of your WordPress theme.
/**
* Pronamic Pay status update process Buckaroo parameter.
*
* @param Payment $payment The payment.
* @param bool $can_redirect Whether or not to redirect.
* @param string $old_status Old paymet status.
* @param string $new_status New payment status.
*/
function pronamic_pay_status_update_brq_param( $payment, $can_redirect, $old_status, $new_status ) {
$method = filter_var( INPUT_SERVER, 'REQUEST_METHOD', FILTER_SANITIZE_STRING );
$data = ( 'POST' === $method ? $_POST : $_GET );
// Process brq_transactions parameter.
if ( isset( $data['brq_transactions'] ) && ! empty( $data['brq_transactions'] ) ) {
$brq_transactions = $data['brq_transactions'];
// Your custom code with $brq_transactions here...
}
}
add_action( 'pronamic_payment_status_update', 'pronamic_pay_status_update_brq_param', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment