3

I've created a REST application that uses the WooCommerce REST API. I want to process credit cards through the WooCommerce gateway.

As far as I can tell, I can't just send the credit card number and everything with the order data to have it processed. Therefore, I'm thinking the way to do this is to charge the credit card then send the order to WC.

Is there a WC endpoint I can use to process the credit cards? Or how would I build one?

Steve
  • 145
  • 1
  • 8
  • There does not appear to be an existing API endpoint for processing payment. See the [docs](http://woothemes.github.io/woocommerce-rest-api-docs/). I think you'd have to build something custom. – helgatheviking Sep 09 '16 at 16:33

2 Answers2

2

Unless things have changed over at WooCommerce, I don't believe they do any actual payment processing. You'd need to hook into an actual gateway, like PayPal, Stripe, Authorize.net, etc to capture payment. The Stripe gateway add-on is free, I believe, and pretty easy to work with.

Unless I'm misunderstanding your question?

Greg Burkett
  • 1,905
  • 1
  • 12
  • 14
  • We have a WooCommerce gateway in place... from a plugin called InfusedWoo, it processes payment on the checkout page through InfusionSoft. I'm trying to use this gateway from outside of WordPress. I was thinking an endpoint might exists or could be created to make this happen using WooCommerce functions. I'm open to the possibility that this is not the right way to do it, but for now this is the channel I'm exploring. – Steve Sep 09 '16 at 15:15
  • Ah, ok I see -- You may want to edit your original question with that info to clear things up for other answers. I don't believe you'll find an API endpoint for processing payments using WooCommerce -- that's just not what it's meant to do. However, if you've built a REST application that's tapping into Woo to update order status, etc, you could probably just add in some calls to InfusionSoft's API, which DOES appear to do payment processing. Just make 2 calls, hypothetically: one to the WC api and one to the InfusionSoft API. Docs here: https://lifterlms.readme.io/docs/infusionsoft-api – Greg Burkett Sep 10 '16 at 19:45
  • 1
    Thanks for your help Greg. I believe in using as few API's as possible to keep code clean and maintainable, so I've stuck to WordPress as my entry point. I'm still dependent on InfusedWoo and WooCommerce, but the dependency on the Infusionsoft API is masked by InfusedWoo, so the details of that are their problem. In the same way I was hoping to work only with WooCommerce and not directly with InfusedWoo, which was the spirit of my question. I wasn't able to do that... I have posted my solution. – Steve Sep 11 '16 at 22:16
1

I decided for better or for worse the best approach was to build a standard WordPress REST endpoint for the purposes of posting an order that would include credit card data. This endpoint then uses the gateway object of InfusedWoo which takes over the credit card processing.

Steve
  • 145
  • 1
  • 8