Using Stripe meta keys?
-
Hi!
I am wondering if its possible to add some (more) metadata from Stripe, to my woocommerce invoices.
I have successfully added a few meta keys already, that show the Stripe net payout, fee and currency used.
But can I also add the “amount” and “payment exchange rate”?
This is what it looks like, in my Stripe account, when clicking a specific payment:And this is the code that I added to my themes functions.php file to add the meta keys, that show the Stripe net payout, fee and currency, which is working:
add_action( 'fi/core/template/invoice/after_notes', function ( $document ) { $order = wc_get_order( $document->get_order_id() ); $data = []; if ( $order ) { $stripe_currency = $order->get_meta( '_stripe_currency' ); if ( $stripe_currency ) { $data[] = $stripe_currency; } $stripe_fee = $order->get_meta( '_stripe_fee' ); if ( $stripe_fee ) { $data[] = $stripe_fee; } $stripe_net = $order->get_meta( '_stripe_net' ); if ( $stripe_net ) { $data[] = $stripe_net; } if ( $data ) { echo implode( ', ', $data ); } } } );
Could you advise me on how to add more stripe meta keys?
Thank you very much / Caroline
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Using Stripe meta keys?’ is closed to new replies.