Skip to content

Instantly share code, notes, and snippets.

@rickalday
Created November 14, 2025 20:46
Show Gist options
  • Select an option

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

Select an option

Save rickalday/eb52c6e9ab1aaa5d035cc48fe679b11b to your computer and use it in GitHub Desktop.
Send custom data to Authorize.net
<?php
add_filter(
'give_authorize_recurring_payment_description',
function($description, $purchase_data, $subscription){
\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,
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