Skip to content

Commit

Permalink
Format refund amounts as decimals
Browse files Browse the repository at this point in the history
Fixes #6187
  • Loading branch information
mikejolley committed Sep 8, 2014
1 parent 177dc3b commit a588442
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/class-wc-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -1809,11 +1809,11 @@ public static function refund_line_items() {
check_ajax_referer( 'order-item', 'security' );

$order_id = absint( $_POST['order_id'] );
$refund_amount = sanitize_text_field( $_POST['refund_amount'] );
$refund_amount = wc_format_decimal( sanitize_text_field( $_POST['refund_amount'] ) );
$refund_reason = sanitize_text_field( $_POST['refund_reason'] );
$line_item_qtys = json_decode( sanitize_text_field( stripslashes( $_POST['line_item_qtys'] ) ), true );
$line_item_totals = json_decode( sanitize_text_field( stripslashes( $_POST['line_item_totals'] ) ), true );
$line_item_tax_totals = json_decode( sanitize_text_field( stripslashes( $_POST['line_item_tax_totals'] ) ), true );
$line_item_totals = array_map( 'wc_format_decimal', json_decode( sanitize_text_field( stripslashes( $_POST['line_item_totals'] ) ), true ) );
$line_item_tax_totals = array_map( 'wc_format_decimal', json_decode( sanitize_text_field( stripslashes( $_POST['line_item_tax_totals'] ) ), true ) );
$api_refund = $_POST['api_refund'] === 'true' ? true : false;
$restock_refunded_items = $_POST['restock_refunded_items'] === 'true' ? true : false;

Expand Down

0 comments on commit a588442

Please sign in to comment.