Title: Incorrect amount charged
Last modified: May 8, 2024

---

# Incorrect amount charged

 *  ResolvedModerator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/incorrect-amount-charged/)
 * Hello,
 * In one of my projects, a Stripe order was triggered via your plugin. Unfortunately,
   the wrong amount was transferred.
 * The following background:
   The store sells to Austria and Germany. The customer
   in question has entered a German billing address. He was also shown the correct
   amount of 6190 EUR for the case (total with German VAT + 250 EUR shipping). However,
   Stripe billed the wrong amount: 5990 EUR, which would be the total for Austria
   with 0-EUR shipping.
 * The log file of your plugin says:
 *     ```wp-block-code
       [id] => redacted
       [amount] => 5990
       [amount_refunded] => 0
       [currency] => EUR
       [order_amount] => 6190
       [order_currency] => EUR
       [captured] => Captured
       [transaction_id] => redacted
       [mode] => Live
       ```
   
 * Why is the wrong amount being read out for amount? Where does it come from?
 * Used:
   WordPress 6.4.4WooCommerce 8.7.0Stripe Payment Plugin for WooCommerce 3.9.8
 * Many thanks for your help in advance 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [WebToffee Support](https://wordpress.org/support/users/webtoffeesupport/)
 * (@webtoffeesupport)
 * [2 years ago](https://wordpress.org/support/topic/incorrect-amount-charged/#post-17750085)
 * Hi [@threadi](https://wordpress.org/support/users/threadi/),
 * Greetings from Webtoffee!
 * I understand that you are experiencing trouble with the final amount of the purchase.
   Kindly note that our plugin uses the function given below to fetch the amount
   and currency from Woocommerce and then passes it on to Stripe. We are just taking
   the values provided by Woocommerce to complete the order.
 *     ```wp-block-code
       $order->get_total()
       $order->get_currency();
       ```
   
 * If you are using any other plugin related to currency conversion or taxation,
   sometimes the issue may arise from them. We suggest checking that they pass the
   values correctly to these functions.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years ago](https://wordpress.org/support/topic/incorrect-amount-charged/#post-17753411)
 * Thanks for the tip. I have now been able to trace the path of the price. The 
   reason is the individual theme of the project, which has not updated the shopping
   cart value in the HTML code that your plugin uses for the price transfer. I have
   been able to solve this and it now works.
 * However, I am still wondering about the indication of the price in the HTML code.
   I noticed the following:
 * In the `eh_stripe_checkout.js` file, an input field is added before the checkout
   is sent:
 *     ```wp-block-code
       $form.append( '<input type="hidden" class="eh_stripe_pay_amount" name="eh_stripe_pay_amount" value="' + $data.data( 'amount' ) + '"/>' );
       ```
   
 * The value of this field again comes from the HTML element with the ID _eh-stripe-
   pay-data_. This is generated via the file `class-stripe-api.php` when the checkout
   is called up.
 * The value of the input field is then read as `$amount` in the file `class-stripe-
   api.php` line 693:
 *     ```wp-block-code
       $amount = isset( $_POST['eh_stripe_pay_amount'] )? sanitize_text_field($_POST['eh_stripe_pay_amount']) : self::get_stripe_amount(((WC()->version < '2.7.0') ? $wc_order->order_total : $wc_order->get_total())) ;
       ```
   
 * This value is then passed to the Stripe API as ‘amount’.
 * Thus, a customer could enter any amount by manually changing the data-amount 
   field after calling the checkout. Of course, this does not match the WooCommerce
   order, but is waved through to Stripe without further checking.
 * It might be good if you took a closer look at this. Otherwise, the plugin is 
   super reliable, thanks for that 🙂
 *  Plugin Support [WebToffee Support](https://wordpress.org/support/users/webtoffeesupport/)
 * (@webtoffeesupport)
 * [2 years ago](https://wordpress.org/support/topic/incorrect-amount-charged/#post-17771466)
 * Hi [@threadi](https://wordpress.org/support/users/threadi/) ,
 * Thank you for your valuable recommendation. We will strive to incorporate this
   improvement in our next release and have added it to our backlogs.
    Once again,
   we appreciate your interest in our plugin.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Incorrect amount charged’ is closed to new replies.

 * ![](https://ps.w.org/payment-gateway-stripe-and-woocommerce-integration/assets/
   icon-256x256.gif?rev=3361775)
 * [Payment Gateway of Stripe for WooCommerce](https://wordpress.org/plugins/payment-gateway-stripe-and-woocommerce-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/payment-gateway-stripe-and-woocommerce-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/payment-gateway-stripe-and-woocommerce-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/payment-gateway-stripe-and-woocommerce-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/payment-gateway-stripe-and-woocommerce-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/payment-gateway-stripe-and-woocommerce-integration/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [WebToffee Support](https://wordpress.org/support/users/webtoffeesupport/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/incorrect-amount-charged/#post-17771466)
 * Status: resolved