process_payment() function
-
As a new plugin developer, am trying to figure out how and when the process_payment() for WCMP is being triggered. I need you help please.
-
Hi @drizla,
It triggers when the admin pays commission value to their vendor’s account. You can see an example here https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/blob/master/classes/class-wcmp-cron-job.php#L89. We have defined this function on every payment gateway class file. So that we can dynamically call this. Here is one example of stripe https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/blob/master/classes/class-wcmp-cron-job.php#L89
ThanksThanks so much @rajsekharchatterjee11 for you reply. Since am testing on a local server and I needed to make a REST API call in this function (process_payment). How can I make it manual so that I could trigger the process_payment() manually to see if the API call is working. since the existing way uses cron
Hi,
We don’t have any direct rest API support to pay a particular vendor. We have extends it from wc_payment_gateway class. You can check the code from here https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/blob/master/classes/gateways/class-wcmp-gateway-stripe-connect.php. If woocommerce has any API support for payment then that will help you out.
ThanksI think @rajsekharchatterjee11 you should create a simple custom payment gateway documentation for WCMP the way WCFM has. This would be really helpful.
@drizla, we do have a plan to create a document on custom payment mode creation.
Once this will be ready, we will share that link.Hi @rajsekharchatterjee11, Whenever I make a payment, the commission doesn’t appear on the WCMP commission. However, the Number of Private Item increases(Private link above the commission Table), Also the wp_wcmp_vendor_orders is not populated at all. How can I resolve these?
Hi @drizla, can you share the scrrenshot of the order details page from admin end, this will help use understand the issue.
Can I share with you the plugin so as to get your feedback please? If it works I could make a copy so that you use it in WCMP documentation on how to make custom payments.
I Have solved most of the issues. However, the order status on the vendor dashboard (Orders Tab) still remains Pending Payments even afetr the commission changes to withdrawal in the Bank overview tab.
@drizla, the order status doesn’t depend on the withdrawal commission or banking overriview.
Let me help you out with the order status flow :
– When an order is created on the woocommerce end, we create the corresponding sub-order.
– Now, we check the initial order status of the order from woocommerce’s main order and set same order status for suborders too
– After that, each vendor/admin needs to change order status for each sub-order
– Therefore, apart from initial order status, if you change status of an order, this will not affect the sub order’s statusThanks @wcmp but my question is, whenever a cutomer checks out product, the order status change correctly(based on the transaction processing state). For example if the payment is bein processed, the WP admin shoud indicate the payment is being processed and also on the vendor dashboard, the suborder generated from the parent order should indicate “on-hold” status. however, in my case, the Order status in the vendor dashboard is just indicating “Pending payment” without changing.
@drizla, it will be really helpful if you can share a video so we can help you out better.
Hi @drizla, we haven’t heard back from you so we presume this issue has been resolved.
Yes the issues were solved. I wanted to know how to setup a callback url which is to get some values during payment process in WCMp.
- The topic ‘process_payment() function’ is closed to new replies.