Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created April 22, 2020 18:12
Show Gist options
  • Save joshfeck/1f18dc42a926f045a6f0159de1df4eeb to your computer and use it in GitHub Desktop.
Save joshfeck/1f18dc42a926f045a6f0159de1df4eeb to your computer and use it in GitHub Desktop.
Append the primary registrant's email address to the end of the Stripe order description. Event Espresso 4.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EEG_Stripe_Onsite__doDirectPaymentWithPaymentIntents__payment_intent_data',
'stripe_elements_cf_order_desc_email',
10,
4
);
function stripe_elements_cf_order_desc_email(
$stripe_data,
$payment,
$transaction,
$billing_info
) {
if ($transaction instanceof EEI_Transaction) {
$primary_registrant = $transaction->primary_registration();
if ($primary_registrant instanceof EE_Registration) {
$attendee = $primary_registrant->attendee();
if ($attendee instanceof EE_Attendee) {
$stripe_data['description'] .= ' ' . $attendee->email();
}
}
}
return $stripe_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment