I have installed woo-commerce subscriptions on my word-press site, integrating a payment gateway for checkout. The gateway is not supported by woo-commerce directly.
I have the checkout page and the payment processing page with code provided by the gateway to process the online payment.
I need to update the subscription status for the customer once his payment has gone through successfully via the gateway and the confirmation is received back.
Any pointers on how to update the subscription record in woocommerce subscriptions using a php code snippet would be very helpful.
I have searched around and found links on how to add a product in woocommerce, but not much on how to update or add a subscription record using a custom php snippet.
The solution is to create an order, then create a subscription, link the order to the subscription using woocommerce classes. A very helpful link found on SO outlines the steps:
wordpress.stackexchange.com/questions/202873/
The response given by Jeremy Warne worked for my website’s logical flow.