• Resolved rdshft

    (@rdshft)


    I need Stripe to create/save customer and payment always – especially on ACH payment – even if it means having a save my info box for the customer. Is this possible? Or just using functions.php

    apologies if I posted this before – I thought I did, but I don’t see it in the support at all so maybe I missed a step.

    thanks,
    Amanda

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @rdshft,

    You should use the wc_stripe_force_save_payment_method filter to force the payment method to always save.

    https://docs.paymentplugins.com/wc-stripe/api/source-class-WC_Stripe_Payment_Intent.html#221

    Here is an example of how to use that filter:

    add_filter('wc_stripe_force_save_payment_method', function($bool, $order){
        if(is_checkout()){
            $bool = true;
        }
        return $bool;
    }, 10, 2);

    You can add that code snippet to your child theme’s functions.php. Make sure to test that example before using in production.

    You will also want to disable guest checkout in your WooCommerce Settings. By forcing your customers to create an account with you, the Stripe plugin will automatically create a Stripe Customer ID for them.

    Kind Regards,

    Thread Starter rdshft

    (@rdshft)

    Thanks! I’ll be sure to test it first. Will this also force Stripe to create a customer?

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @rdshft,

    Please see my previous reply:

    You will also want to disable guest checkout in your WooCommerce Settings. By forcing your customers to create an account with you, the Stripe plugin will automatically create a Stripe Customer ID for them.

    Thread Starter rdshft

    (@rdshft)

    Thanks! Sorry, I missed that note… but it’s still not doing exactly what I need. I think I didn’t totally explain. I am creating orders in woocommerce and emailing them an invoice, when the customer clicks the Pay this invoice link it takes them directly to the payment page and they don’t seem to require an account… Any ideas?

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @rdshft,

    WooCommerce doesn’t not have an option to force a user to create an account on the order pay page. I think your best option is to hook in to the provided WooCommerce actions and create an account for your user automatically. You can then save the payment method using the filter I provided previously.

    Take a look at the action woocommerce_before_pay_action. You could use that to create a customer.

    Kind Regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Force Stripe to create customer and save payment method’ is closed to new replies.