Title: Programmatically charge an order
Last modified: May 1, 2024

---

# Programmatically charge an order

 *  Resolved [Christopher](https://wordpress.org/support/users/christopherplus/)
 * (@christopherplus)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/programmatically-charge-an-order/)
 * I ‘m trying to charge a stored card programmatically. While the order is created
   successfully I’m struggling to process the payment. Also the Woo Subscriptions
   is installed if helps. I use something like the following:
   `$payment_gateways
   = WC()->payment_gateways()->get_available_payment_gateways();$stripe_gateway 
   = isset( $payment_gateways['stripe'] ) ? $payment_gateways['stripe'] : null;$
   result = $stripe_gateway->process_payment( $order_id );
 * Any help to the right direction would be appreciate.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Shameem – a11n](https://wordpress.org/support/users/shameemreza/)
 * (@shameemreza)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/programmatically-charge-an-order/#post-17725585)
 * Hi [@christopherplus](https://wordpress.org/support/users/christopherplus/)
 * Are you trying to charge a subscription programmatically? Is that card associated
   with a customer, and is that customer linked to the order?
 * However, since this is related to a premium extension, please contact us directly
   [here](https://woocommerce.com/my-account/create-a-ticket/?form=ticket).
 * As per the [forum guidelines](https://wordpress.org/support/guidelines/#do-not-post-about-commercial-products),
   no support for premium extensions is done here but we will be happy to assist
   you further from there 🙂
 * For reference, this particular forum is meant for general support with the core
   functionality of WooCommerce Stripe Payment Gateway itself. For development and
   custom coding questions, it’s best to ask for insight related to those on either
   the [WooCommerce Advanced Facebook group](https://www.facebook.com/groups/advanced.woocommerce/)
   or the [WooCommerce Community Slack](https://woocommerce.com/community-slack/).
   Many of our developers hang out there and will be able to offer insights into
   your question. You can also seek help from the following:
    - A local web developer
    - [Codeable.io](https://woocommerce.com/codeable/)
    - [WooExperts](https://woocommerce.com/customizations/)
 * I wish I could help more, but hopefully, this gets you going in the right direction
   to get some further insight/information!
 *  Thread Starter [Christopher](https://wordpress.org/support/users/christopherplus/)
 * (@christopherplus)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/programmatically-charge-an-order/#post-17728385)
 * No, I’m trying to charge an order that has been created programmatically. The
   customer is linked to the order. I mentioned the Woo Subscriptions in case it
   helps. The questions is about charging an order programmatically.
 *  Plugin Support [omarfpg a11n](https://wordpress.org/support/users/omarfpg/)
 * (@omarfpg)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/programmatically-charge-an-order/#post-17729326)
 * Hi [@christopherplus](https://wordpress.org/support/users/christopherplus/),
 * > No, I’m trying to charge an order that has been created programmatically. The
   > customer is linked to the order. I mentioned the Woo Subscriptions in case 
   > it helps. The questions is about charging an order programmatically.
 * Can you share more details about this? Please share the exact steps you’re taking
   for this so we can try to replicate it and learn more about the issue. If you
   can include screenshots (censuring sensitive data like customer details), that’d
   be great!
 * If you don’t already have a screenshot service installed, here are a few free
   options:
   [https://snipboard.io](https://snipboard.io/)[https://prnt.sc/](https://prnt.sc/)
   There is also a walkthrough guide here: [https://en.support.wordpress.com/make-a-screenshot/](https://en.support.wordpress.com/make-a-screenshot/)
 * Thanks!
   -OP
 *  Plugin Support [omarfpg a11n](https://wordpress.org/support/users/omarfpg/)
 * (@omarfpg)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/programmatically-charge-an-order/#post-17744076)
 * Hi there 👋 ,
 * We haven’t heard from you in a while, so I’m going to mark this as resolved. 
   Feel free to [start a new thread](https://wordpress.org/support/plugin/woocommerce-gateway-stripe/#new-topic-0)
   if you have any more questions.
 * All the best,
   Omar

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Programmatically charge an order’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-gateway-stripe/assets/icon-256x256.png?rev=3177277)
 * [WooCommerce Stripe Payment Gateway](https://wordpress.org/plugins/woocommerce-gateway-stripe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-gateway-stripe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-gateway-stripe/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-gateway-stripe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-gateway-stripe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-gateway-stripe/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [omarfpg a11n](https://wordpress.org/support/users/omarfpg/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/programmatically-charge-an-order/#post-17744076)
 * Status: resolved