Skip to content

Instantly share code, notes, and snippets.

@DumahX
Created April 26, 2022 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DumahX/f3e443b78fbd01694f3e29d9c3a9adf2 to your computer and use it in GitHub Desktop.
Save DumahX/f3e443b78fbd01694f3e29d9c3a9adf2 to your computer and use it in GitHub Desktop.
<?php
// Paste this into functions.php or a plugin like Code Snippets
function add_stripe_payment_args($args, $txn = false, $sub = false) {
if($txn) {
$user = $txn->user();
$args['metadata']['mepr_fatturazione_elettronica'] = get_user_meta($user->ID, 'mepr_fatturazione_elettronica', true);
}
return $args;
}
add_filter('mepr_stripe_payment_args', 'add_stripe_payment_args', 11, 2);
add_filter('mepr_stripe_payment_intent_args', 'add_stripe_payment_args', 11, 2);
add_filter('mepr_stripe_setup_intent_args', 'add_stripe_payment_args', 11, 2);
add_filter('mepr_stripe_subscription_args', 'add_stripe_payment_args', 11, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment