1

I'm building a site for a winery, which have one specific requirement that is similar to a subscription, but a little different. Wine clubs are charged on a regular interval, but only two or three times a year and the amount is different every time. So, when a user signs up for the club, I want to collect their credit card information, but not charge it. On the wine club signup page, I need to have the credit card fields, which then need to be tokenized and sent to the gateway provider.

I tried the add_payment_method function in the gateway, but that redirects the user back to the My Account pages, which I don't want. Next, I'm going to try creating a dummy order and processing that to add the payment method. Has anyone run into this issue and found a way to solve it?

Note that I was able to do this with Stripe using some of the unique methods in their gateway, but I am looking for a solution that would support any of the token-supporting gateways.

1

It turns out that payment token handling is not standardized across payment gateways in WooCommerce. I ended up having to use a bunch of conditional logic to deal with differences in the way gateways handle the add_pament_method function. Not ideal, but I'm not anticipating needing to support more than a couple gateways, so it's tolerable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.