• Resolved jeffatrmc

    (@jeffatrmc)


    Hi @mrclayton

    I was attempting to charge a customer (Whose payment information expired and was through an old payment gateway) for an order through the back end of woocommerce using the pay for order function with this plugin. After I set his order to pending payment, put in his new card information, and then attempted to charge his card I got this error: “Error processing payment. Reason: You cannot confirm with the off_session parameter when setup_future_usage is also set on the PaymentIntent because you cannot set up future usages when processing payments off-session. Order status changed from Pending payment to Failed.”

    I’m not entirely sure what it is trying to ask of me so any help here would be appreciated. Thank you.

    Best,
    Jeff

    The page I need help with: [log in to see the link]

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

    (@mrclayton)

    Hi @jeffatrmc,

    The issue is you have custom code on your site that saves the customer’s payment method for all transactions automatically. In your custom code, you should check to make sure the request is coming from the frontend and not the order details page since it’s you who is processing the order.

    Kind Regards,

    Thread Starter jeffatrmc

    (@jeffatrmc)

    Hi @mrclayton

    This is the custom code I use that I actually got from you back in early October. It doesn’t seem to be coming from the order details page but I am no PHP expert.

    add_action(‘wc_stripe_before_process_payment’, function($order, $gateway_id){
    $_POST[“{$gateway_id}_save_source_key”] = ‘yes’;
    }, 10, 2);

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @jeffatrmc,

    The code I previously gave you did not account for you using the Pay for Order functionality. Here is the revised code:

    add_action(‘wc_stripe_before_process_payment’, function($order, $gateway_id){
        if(is_checkout()){
            $_POST["{$gateway_id}_save_source_key"] = 'yes';
        }
    }, 10, 2);

    This code only saves the customer’s payment method automatically if it’s a frontend request and not an admin request.

    Kind Regards,

    Thread Starter jeffatrmc

    (@jeffatrmc)

    Sweet Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issues when trying to charge a customer with a new card in the backend’ is closed to new replies.