A payment gateway for? Woo? Stand alone?
I have created the plugin for our payment gateway for woocommerce. this is working fine for one time checkout.
I am trying to extend the plugin to work with woocommerce subscription by saving card tokens then attempting recurring payments automatically.
I am using “scheduled_subscription_payment” hook to fire renewal order, when it fires I need use my saved card token to call the payment gateway.
I need assistance on how to save the card token and use it on recurring call on the above web hook.
I have already checked the stripe plugin and which is working fine. I just need the same functionality where saved cards is used on a recurring payment (reference link: https://docs.woocommerce.com/document/subscriptions/develop/payment-gateway-integration/)
I recommend asking at https://wordpress.org/support/plugin/woocommerce/#new-post so the plugin’s developers and support community can help you with this.
Generally speaking (not specific to WooCommerce), you can store user information in the usermeta table. You can schedule tasks to execute at regular intervals with wp_schedule_event(). For example, your task could query for users who have subscribed, whose last payment date is older than the subscribed interval. Then process a payment for each user found and update their last payment date.
For WooCommerce specific aspects, I second what Steven recommended ^^^