最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

woocommerce offtopic - Can woocommerse be used dynamically for billing from another plugin for payment processing?

programmeradmin2浏览0评论

I'm working on a plugin and rather than write my own payment processing code I was wondering if I could leverage woocommerce to do this. My plugin handles what amounts to rental spaces and all the custom management stuff is done with my plugin. It would be nice if there is a way for woocommerce to just to collect and log payments for my plugin. Is this possible? Most of the examples I've found about the API seem to apply to remote API use for woocommerce.

Thanks

I'm working on a plugin and rather than write my own payment processing code I was wondering if I could leverage woocommerce to do this. My plugin handles what amounts to rental spaces and all the custom management stuff is done with my plugin. It would be nice if there is a way for woocommerce to just to collect and log payments for my plugin. Is this possible? Most of the examples I've found about the API seem to apply to remote API use for woocommerce.

Thanks

Share Improve this question asked Nov 6, 2020 at 20:59 user6972user6972 636 bronze badges 1
  • 1 I'm going to try the same thing. So far my idea is to dynamically generate a woocommerce product with the required price and description, programmatically add that product to the cart and use a completely customized checkout page with my own fields to allow the payment. – Ivan Shatsky Commented Nov 11, 2020 at 10:48
Add a comment  | 

1 Answer 1

Reset to default 1

It is possible, but you're going to need a product to log in your orders. You could create a product 'placeholder' and then pass variables to the cart before checkout. This way the actual product already exists but everything else in WooCommerce will perform as normal.

Orders don't store a link to the current price of the item as prices change from time to time and then order history would be useless.

An example: The product could be "Rental Space" with a zero value that the user adds to the cart. Your plugin gives it a price in the cart and WooCommerce (and your chosen payment gateway) do the rest.

Your 'logs' would be the WooCommerce orders created per checkout.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论