• Resolved robertstaddon

    (@robertstaddon)


    I use the Smart Product Quantity plugin for WooCommerce so that I can use decimal quantities for products: https://woocommerce.com/products/smart-product-quantity/ There are other similar plugins that add the same feature and it’s fantastic for hourly invoicing (e.g. 1.5 hrs.) or selling products with measurements (e.g. 2.5 yards of fabric). I wish decimal quantities was built into WooCommerce core!

    Anyway, the Smart Product Quantity plugin has always worked fine with your Payment Plugins for Stripe until I upgraded to v3.3.47. After that upgrade, any Checkout page payment with a product that had a decimal quantity returned the error message “Invalid integer”. A full error message for a product with a quantity of 1.5, for example, was: “Error processing payment. Reason: Invalid integer: 1.5 Order status changed from Pending payment to Failed.”

    At the moment, I’m coasting with v3.3.46 of your plugin, which works fine with decimal quantities for products and plugins like Smart Product Quantity. Could you update your plugin for compatibility with decimal quantities?

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

    (@mrclayton)

    Hi @robertstaddon

    This is likely related to level3 data which our plugin sends to Stripe to lower your processing fees. Stripe expects that the quantities sent to their API are whole numbers, no decimals.

    Can you check the stripe.com > developers > logs and share the log entry for one of these failed API requests?

    Kind Regards

    Thread Starter robertstaddon

    (@robertstaddon)

    Wow, you are right. So Stripe shows in the log a 400 error to POST /v1/payment_intents

    The error message is:

    parameter_invalid_integer – level3[line_items][0][quantity]
    Invalid integer: 1.5

    Can you add an option or hook to optionally disable level3 data in your plugin?

    Plugin Author Payment Plugins

    (@mrclayton)

    @robertstaddon Can you create a support ticket and share the Smart Product Quantity plugin with us?

    Here is an example of how to remove level3:

    add_filter('wc_stripe_payment_intent_args', function($args, $order){
    	unset($args['level3']);
    	return $args;
    }, 10, 2);
    Thread Starter robertstaddon

    (@robertstaddon)

    I just created a support ticket!

    I also successfully tested the filter that you sent and it enabled me to update to the latest version of your plugin while still allowing products with decimal quantities to go through! Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Invalid Integer Error with Smart Product Quantity after 3.3.47 Upgrade’ is closed to new replies.