Skip to content

Instantly share code, notes, and snippets.

@rickalday
Last active September 24, 2025 22:45
Show Gist options
  • Select an option

  • Save rickalday/858b1963bb4635b015826f99d24f1703 to your computer and use it in GitHub Desktop.

Select an option

Save rickalday/858b1963bb4635b015826f99d24f1703 to your computer and use it in GitHub Desktop.
Filter the payment description sent to Authorize.net
<?php
add_filter(
'give_authorize_recurring_payment_description',
function($description, $purchase_data, $subscription){
/** Uncomment this block to get the $purchase_data array listed in Donations -> Tools -> Logs
* \Give\Framework\PaymentGateways\Log\PaymentGatewayLog::success('Contents of the variables',
* [
* 'Purchase Data' => $purchase_data,
* 'Subscription' => $subscription,
* ]
* );
**/
if($purchase_data['post_data']['give-form-title']) {
$form_title = $purchase_data['post_data']['give-form-title'];
} else {
$form_title = get_the_title( $purchase_data['post_data']['formId'] );
}
$description .= ' - '. $form_title;
return $description;
},
999,
3
);
// Use this function to filter the Authorize.net payment description on one-time donations
add_filter(
'give_authorize_one_time_payment_description',
function($description, $purchase_data){
\Give\Framework\PaymentGateways\Log\PaymentGatewayLog::success('Contents of the variables',
[
'Purchase Data' => $purchase_data,
]
);
if($purchase_data['post_data']['give-form-title']) {
$form_title = $purchase_data['post_data']['give-form-title'];
} else {
$form_title = get_the_title( $purchase_data['post_data']['formId'] );
}
$description .= ' - '. $form_title;
return $description;
},
999,
2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment