• edwardsmark

    (@edwardsmark)


    hello – after much struggle, i received a helpful reply from https://PaymentPlugin.com to add the following code:

    add_filter('wc_stripe_payment_intent_args', function($args, $order){
    . . . . $args['metadata']['client_email'] = '';
    . . . . return $args;
    }, 10, 2);



    at the end of my ./wp-content/themes/astra/functions.php script. however, this code did not do anything, so for fun (!!) I changed the line to:
    . . . $args['metadata']['client_email'] = '[email protected]';
    and this appears to work!

    my question: where can i extract the actual/real value of my `client_email’ custom field?

    • This topic was modified 10 months ago by edwardsmark.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter edwardsmark

    (@edwardsmark)

    got it:

    add_filter('wc_stripe_payment_intent_args', function($args, $order) {
    . . . .$orderNbr = WC()->session->get('order_awaiting_payment');
    . . . . $order = new WC_Order($orderNbr);
    . . . . $args['metadata']['clients_email'] = $order->get_meta('_billing_clients_email') ;
    . . . . return $args;
    }, 10, 2);


    opinions?

    • This reply was modified 10 months ago by edwardsmark.
    Thread Starter edwardsmark

    (@edwardsmark)

    Afzal (woo-hc)

    (@afzalpansuvi)

    Hi @edwardsmark,

    Thank you for contacting WooCommerce Plugin Support. It’s great to see you’re working on passing custom fields to Stripe! Just a heads up, custom code isn’t something we can directly support here, but I can definitely point you in the right direction.

    First off, let’s make sure we’re using the right field name for the client’s email. You mentioned both client_email and clients_email, so let’s confirm which one it is. Once we’re sure about the field name, we need to check if it’s properly set up to capture the email during checkout. Have you added this field using a plugin or did you customize it yourself?

    If you’re using a plugin for custom fields, it might have its own way of accessing them. Could you let me know which plugin you’re using, if any? Remember, it’s always a good idea to test these things in a safe environment before applying them to your live site.

    If you need further assistance with coding, for development and custom coding questions, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. You can also seek help from the following:

    I hope this helps you move forward with your project! Let us know if you have any questions or if there’s anything else I can assist you with.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘passing custom field to stripe’ is closed to new replies.