title: Charge Saved Credit Cards Programmatically in WooCommerce
body: <p>I am creating an order programmatically in WooCommerce and need to charge the default saved credit card. I am using the WooCommerce stripe plugin and have figured out how to set the correct payment method but can't figure out how to actually charge the card. Below is the code I have so far.</p>
  
  <pre><code>$order = wc_create_order();
  
  $order-&gt;add_product( wc_get_product( 52 ), 1 );
  $order-&gt;set_address( $shipping_address, 'shipping' );
  $order-&gt;set_address($user_info, 'billing');
  
  $payment_gateways = WC()-&gt;payment_gateways-&gt;payment_gateways();
  $order-&gt;set_payment_method($payment_gateways['stripe']);
  
  $order-&gt;calculate_totals(); 
  $order-&gt;update_status("Completed", 'First Partner Order', TRUE);
  $order-&gt;save();
  </code></pre>