add_filter( 'woo_mp_stripe_charge_request', function ( $request, $order ) { $request['description'] = sprintf( '%1$s – Invoice %2$s', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), $order->get_order_number() ); $request['metadata'] = [ 'customer_name' => sanitize_text_field( $order->get_billing_first_name() ) . ' ' . sanitize_text_field( $order->get_billing_last_name() ), 'customer_email' => sanitize_email( $order->get_billing_email() ), 'order_id' => $order->get_order_number(), 'invoice_id' => $order->get_order_number(), ]; //add order details to Stripe payment metadata function filter_wc_stripe_payment_metadata( $metadata, $order, $source ) { $order_data = $order->get_data(); $metadata['Total Tax Charged'] = $order_data['total_tax']; $metadata['Total Shipping Charged'] = $order_data['shipping_total']; $count = 1; foreach( $order->get_items() as $item_id => $line_item ){ $item_data = $line_item->get_data(); $product = $line_item->get_product(); $product_name = $product->get_name(); $item_quantity = $line_item->get_quantity(); $item_total = $line_item->get_total(); $metadata['Line Item '.$count] = 'Product name: '.$product_name.' | Quantity: '.$item_quantity.' | Item total: '. number_format( $item_total, 2 ); $count += 1; } return $metadata; } add_filter( 'wc_stripe_payment_metadata', 'filter_wc_stripe_payment_metadata', 10, 3 ); Checkout-Result - Alientech
UK Offices + 44 (0) 1789 774444 Sales office Open: Mon - Fri: 9am – 5pm | Technical Support: Mon - Sat: 7am – 6pm
[accept_stripe_payment_checkout]