• Resolved surefyre2

    (@surefyre2)


    When using base shipping only and putting 0.001 in shipping in the shortcode, the cart shows the right values but in Stripe the decimal point is lost so £25.20 shipping becomes £2520.

    Also if you have more than ten items in the cart that 0.001 gets added up and a magic penny appears in the total too. Maybe 0.0001 will work also though it’s the £2500 shipping that’s the big problem, makes the plugin unusable.

    Latest WP (6.3), latest plugin version (installed today) as of this post’s date

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter surefyre2

    (@surefyre2)

    Update: It works fine for Paypal so must be something in the Stripe path.

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Thank you for reaching out to us.

    Update: It works fine for PayPal so must be something in the Stripe path.

    I have submitted a message to the developers to investigate further your findings.

    Kind regards.

    Plugin Author mra13

    (@mra13)

    Thank you pointing this out. This is an issue with the newly address Stripe checkout option. We have updated the plugin to apply a fix for this. Please update the plugin when you can.

    Thread Starter surefyre2

    (@surefyre2)

    Just going to check it now, the 0.001 adding up over 10 items also seems sorted, which is great, too. It’s nice to use a plugin with a responsive dev for a change!

    It would be nice to be able to turn off the Paypal button – I’ve used a display:none CSS hack to hide it but I only want to use Stripe as it’s half the fees of Paypal so I don’t offer the option to customers.

    Really useful plugin, though, near-perfect for providing custom ordering pages for individual customers instead of having to wrangle a whole shop system like Woocommerce.

    Thread Starter surefyre2

    (@surefyre2)

    Actually after updating, base shipping cost of 25.20 comes out incorrectly in Stripe as 2.52. Will try it again

    In a kludge I’d put into wp_shopping_cart.php before you updated the plugin I’d forced the total shipping to 2 decimals using sprintf which worked for me. Stripe seemed to have an issue with values that didn’t have precisely 2 decimal places, as if it expected a string. Giving it a float e.g. 25.2 seems to mess it up compare to ‘25.20’

    Thread Starter surefyre2

    (@surefyre2)

    I added line 138 to wp_shopping_cart.php which makes Stripe happy

    133 if ( ! empty( $item_total_shipping ) ) {
    134 $baseShipping = get_option( ‘cart_base_shipping_cost’ );
    135 $postage_cost = $item_total_shipping + $baseShipping;
    136 //Round it to 2 decimal places to avoid issues with Stripe’s zero decimal currencies.
    137 $postage_cost = round( $postage_cost, 2);
    138 $postage_cost = sprintf(‘%.2f’, $postage_cost); // sld mod
    139 }


    Plugin Contributor mbrsolution

    (@mbrsolution)

    It would be nice to be able to turn off the Paypal button – I’ve used a display:none CSS hack to hide it but I only want to use Stripe as it’s half the fees of Paypal so I don’t offer the option to customers.

    Did you enable the following option ‘Disable Standard PayPal Checkout’ located under General Settings tab?

    In regards to your other comments, I am not sure what you mean? Can you clarify what the issue is. I want to make sure I understand your issue correctly.

    Kind regards.

    Thread Starter surefyre2

    (@surefyre2)

    I hadn’t tried the ‘disable paypal’ option as it didn’t mention stripe until now, will try that.

    Now, the Stripe shipping calculation. It seems as if stripe takes the string of the shipping value, strips all non \d characters from it and then treats the result of that as pennies. So 25.20 rounded to 20 decimal place becomes a float of 25.2 – Stripes takes 25.2, seems to turn it into 252 and then forces that to two decimal place giving 2.52. Similarly previously when using 0.001 shipping value in the shortcode (in the previous version) the shipping would be 25.2001 which Stripe seemed to convert to 252001 and then add £2520.01 as the shipping value. It’s very weird but I guess it’s how their validation has been built.

    Hopefully this screenshot video helps to explain the current £2.52 problem.

    https://youtu.be/BfesLQKGtM0

    Thread Starter surefyre2

    (@surefyre2)

    Err 2 decimal place, not 20! ??

    Plugin Author mra13

    (@mra13)

    Thank you for the details. I have updated the plugin to address this. The updated version will be able to handle the condition that you were using with the Stripe gateway.

    Plugin Author mra13

    (@mra13)

    I will set this to resolved for now. If you see the same issue, please reply back to this and I will take a look

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Shipping wrong in Stripe’ is closed to new replies.