Support » Plugin: WooCommerce Stripe Payment Gateway » Invalid Integer

  • Resolved waxlyric


    When applying a 10% off coupon code to an order and checking out using the test APIs I’m getting an ‘Invalid integer: 969.9999999999999’ error with a failed order. Seems to only do it using coupons on certain products, I’m guessing it doesn’t like parsing the long number string, I have Woo set to 2 decimal places so not sure why it is outputting such a long number string. Anything you got to help me out here would be much appreciated.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Akeda Bagus


    Hi waxlyric,

    I tried your case but unable to reproduce. Could you provide detailed steps (with the product and coupon settings), Stripe logs, and system status report (from WooCommerce > System Status)?


    Thread Starter waxlyric


    Hi Akeda,

    Thank you and not a problem, the coupon is set up to give a percentage of 10 in Woo. The product’s cost is set at $8.00 with $2.50 shipping applied. With the code applied it says $9.70 will be charged. See logs you requested below, happy to show you the test store pages if it can remain private…

    Stripe Summary

    Time 2017/07/05 14:40:18
    Method POST
    URL /v1/charges
    Status 400
    IP address
    Version 2016-03-07
    Source WooCommerce 3.1.0

      "currency": "aud",
      "amount": "969.9999999999999",
      "description": "Order 16191",
      "capture": "true",
      "expand": [
      "metadata": {
        "Customer Name": "Joe Blogs",
        "Customer Email": "joe@blogs".com
      "source": "tok_xxxxxxxxxxxxxxxxxx"

    Woocommerce Logs

    ### WordPress Environment ###
    Home URL: https://
    Site URL: https://
    WC Version: 3.1.0
    Log Directory Writable: ✔
    WP Version: 4.8
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: en_US
    ### Server Environment ###
    Server Info: LiteSpeed
    PHP Version: 5.6.30
    PHP Post Max Size: 40 MB
    PHP Time Limit: 30
    PHP Max Input Vars: 1000
    cURL Version: 7.54.0
    SUHOSIN Installed: –
    MySQL Version: 5.6.35
    Max Upload Size: 32 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    ### Database ###
    WC Database Version: 3.1.0
    WC Database Prefix: wp_
    woocommerce_sessions: ✔
    woocommerce_api_keys: ✔
    woocommerce_attribute_taxonomies: ✔
    woocommerce_downloadable_product_permissions: ✔
    woocommerce_order_items: ✔
    woocommerce_order_itemmeta: ✔
    woocommerce_tax_rates: ✔
    woocommerce_tax_rate_locations: ✔
    woocommerce_shipping_zones: ✔
    woocommerce_shipping_zone_locations: ✔
    woocommerce_shipping_zone_methods: ✔
    woocommerce_payment_tokens: ✔
    woocommerce_payment_tokenmeta: ✔
    MaxMind GeoIP Database: ✔
    ### Security ###
    Secure connection (HTTPS): ✔
    Hide errors from visitors: ✔
    ### Active Plugins (19) ###
    Contact Form 7: by Takayuki Miyoshi – 4.8
    Contact Form Submissions: by Jason Green – 1.5.6
    Custom Sidebars: by WPMU DEV – 3.0.9
    Duplicate Post: by Enrico Battocchi – 3.2
    Flexible Shipping: by WP Desk – 1.9.4
    Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 6.2.0
    Hello Dolly: by Matt Mullenweg – 1.6
    Instagram Feed: by Smash Balloon – 1.4.9
    WPBakery Visual Composer: by Michael M - – 5.0.1
    Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 2.2.6
    Slider Revolution: by ThemePunch –
    Social Icons Widget by WPZOOM: by WPZOOM – 2.2.2
    WooCommerce PayPal Express Checkout Gateway: by WooCommerce – 1.4.1
    WooCommerce Stripe Gateway: by WooCommerce – 3.2.1
    WooCommerce: by Automattic – 3.1.0
    Wordfence Security: by Wordfence – 6.3.12
    WordPress Backup to Dropbox: by Michael De Wildt – 4.7.1
    Yoast SEO: by Team Yoast – 4.9
    ### Settings ###
    API Enabled: ✔
    Force SSL: –
    Currency: AUD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    ### WC Pages ###
    Shop base: #16120 - /shop/
    Cart: #16121 - /cart/
    Checkout: #16122 - /checkout/
    My account: ❌ Page not set
    ### Theme ###
    Name: Child Theme
    Version: 1.0
    Author URL: 
    Child Theme: ✔
    Parent Theme Name: BBOB
    Parent Theme Version: 2.3.2
    Parent Theme Author URL:
    WooCommerce Support: ✔
    ### Templates ###
    Archive Template: Your theme has a woocommerce.php file
    you will not be able to override the woocommerce/archive-product.php custom template since woocommerce.php has priority over archive-product.php. This is intended to prevent display issues.
    Overrides: –
    Plugin Author Akeda Bagus


    Hi waxlyric,

    So I tried with this:

    * Product price: $8.00.
    * Shipping fee: $2.50 (using flat rate).
    * Coupon with type “Percentage” and amount “10”.
    * Same currency options per your WC logs.

    The order is placed successfully with total $9.70. Here’s the summary from Stripe’s log:

    07-06-2017 @ 09:02:25 - Success: Stripe charge complete (Charge ID: ch_xxx)
    07-06-2017 @ 09:03:58 - Info: Begin processing payment for order 1006 for the amount of 9.70
    07-06-2017 @ 09:03:58 - charges request: Array
        [currency] => aud
        [amount] => 970
        [description] => Local WP Dev - Order 1006
        [capture] => true
        [expand[]] => balance_transaction
        [metadata] => Array
                [Customer Name] => Akeda Bagus
                [Customer Email] => xxx
        [customer] => cus_xxx
        [source] => card_xxx

    Looking at your WC logs, I don’t see any plugin that might be conflicting this. If you could send me temporary login (which you can remove after troubleshoot) to your site via email (akeda.bagus at that would be great.

    • This reply was modified 4 years, 2 months ago by Akeda Bagus.

    Hi guys,

    Have you resolved this issue? I seem to be having the same issue as well, but am struggling to isolate what causes it.

    It only seems to occur on some transactions, mostly impacted are orders with a single item and flat rate shipping. Discounts don’t seem to be part of the issue, hence I suspect the flat rate shipping module might be the culprit.

    I see the below in my log a lot, so I’m wondering if it might be related:

    [13-Jul-2017 03:57:13 UTC] The WC_Customer::calculated_shipping function is deprecated since version 3.0. Replace with WC_Customer::set_calculated_shipping.
    [13-Jul-2017 03:58:21 UTC] The WC_Customer::calculated_shipping function is deprecated since version 3.0. Replace with WC_Customer::set_calculated_shipping.
    [13-Jul-2017 15:58:21 Pacific/Auckland] The The "woocommerce_get_price" hook uses out of date data structures and function is deprecated since version 3.1.1. Replace with woocommerce_product_get_price.
    [13-Jul-2017 15:58:22 Pacific/Auckland] The The "woocommerce_get_price" hook uses out of date data structures and function is deprecated since version 3.1.1. Replace with woocommerce_product_get_price.

    If you make any progress, please share your solution!

    Thank you!

    Best regards

    Thread Starter waxlyric


    Hi Akeda, I have just forwarded you the details to login to the site to check the error, it happens with the Keyring and coupon code applied!

    Kognito hoping Akeda can pinpoint the issue and advise of a solution.


    Hi @akeda, @waxlyric,

    Any update on this issue by any chance?


    Thread Starter waxlyric


    Hi @kognito, haven’t heard from @akeda on a solution to date hoping it is a one off issue with the test api’s on Stripe as I need to go live with my clients store asap.

    Hi @waxlyric,

    Our store is live and there’s about 5 customers a week that have that issue – at the moment I just email them once I receive a failed order notification and ask them to complete the order with one of the other payment options. It’s not ideal, but unfortunately I can’t seem to isolate the cause of this issue any further.

    Let me know how you’re getting on – would be interesting to see whether you’re coming across this again once the store is live.


    • This reply was modified 4 years, 2 months ago by kognito.

    Hi @waxlyric, @akeda,

    Do you happen to have an update on this issue?
    I’m still not further along, still get about a handful of customers a week with this issue…


Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Invalid Integer’ is closed to new replies.