From 4caf087fe22eb56b9b5a9b06f1ae00351bcc8274 Mon Sep 17 00:00:00 2001 From: Danny Parker Date: Mon, 25 Feb 2019 09:59:28 +0000 Subject: [PATCH] Remove comma formatting on numbers over 999.99 --- src/Unidays/tracking-helper.php | 2 +- .../WhenRequestingAScriptUrlWithAllParamsSetTest.php | 4 ++-- .../WhenRequestingAServerUrlWithAllParamsSetTest.php | 6 +++--- .../WhenRequestingASignedScriptUrlWithAllParamsSetTest.php | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Unidays/tracking-helper.php b/src/Unidays/tracking-helper.php index 1402272..c2b227e 100644 --- a/src/Unidays/tracking-helper.php +++ b/src/Unidays/tracking-helper.php @@ -98,7 +98,7 @@ private function generate_query() private function url_encode_number($number) { - return urlencode(number_format($number, 2, '.', ',')); + return urlencode(number_format($number, 2, '.', '')); } private function parse_boolean($bool) diff --git a/test/Unidays/TrackingHelperTests/WhenRequestingAScriptUrlWithAllParamsSetTest.php b/test/Unidays/TrackingHelperTests/WhenRequestingAScriptUrlWithAllParamsSetTest.php index 8122840..6c70c17 100644 --- a/test/Unidays/TrackingHelperTests/WhenRequestingAScriptUrlWithAllParamsSetTest.php +++ b/test/Unidays/TrackingHelperTests/WhenRequestingAScriptUrlWithAllParamsSetTest.php @@ -15,7 +15,7 @@ public function initialise() $details->withItemsTax(34.50); $details->withShippingGross(5.00); $details->withShippingDiscount(3.00); - $details->withItemsGross(230.00); + $details->withItemsGross(1000.00); $details->withItemsOtherDiscount(10.00); $details->withUnidaysDiscountPercentage(10.00); $details->withNewCustomer(true); @@ -67,7 +67,7 @@ public function ThePathShouldBeV1_2RedemptionJs() * ["ItemsTax", "34.50"] * ["ShippingGross", "5.00"] * ["ShippingDiscount", "3.00"] - * ["ItemsGross", "230.00"] + * ["ItemsGross", "1000.00"] * ["ItemsOtherDiscount", "10.00"] * ["UNiDAYSDiscountPercentage", "10.00"] * ["NewCustomer", "True"] diff --git a/test/Unidays/TrackingHelperTests/WhenRequestingAServerUrlWithAllParamsSetTest.php b/test/Unidays/TrackingHelperTests/WhenRequestingAServerUrlWithAllParamsSetTest.php index 8b57462..33354ea 100644 --- a/test/Unidays/TrackingHelperTests/WhenRequestingAServerUrlWithAllParamsSetTest.php +++ b/test/Unidays/TrackingHelperTests/WhenRequestingAServerUrlWithAllParamsSetTest.php @@ -15,7 +15,7 @@ public function initialise() $details->withItemsTax(34.50); $details->withShippingGross(5.00); $details->withShippingDiscount(3.00); - $details->withItemsGross(230.00); + $details->withItemsGross(1000.00); $details->withItemsOtherDiscount(10.00); $details->withUnidaysDiscountPercentage(10.00); $details->withNewCustomer(true); @@ -69,11 +69,11 @@ public function ThePathShouldBeV1_2Redemption() * ["ItemsTax", "34.50"] * ["ShippingGross", "5.00"] * ["ShippingDiscount", "3.00"] - * ["ItemsGross", "230.00"] + * ["ItemsGross", "1000.00"] * ["ItemsOtherDiscount", "10.00"] * ["UNiDAYSDiscountPercentage", "10.00"] * ["NewCustomer", "True"] - * ["Signature", "VsP++N2PQ7Jy/hH6wjkVcGRLRkqpyBFyZPCLW7u0UYuXiYvBlggi4SgCQ1GPs5mg3JswBYms8qTwRehFpWhhAg=="] + * ["Signature", "fx9sLAiZC+a+dvUcOFNhu4Ja31EgaX17m99y/m5BjlKS3NCMBbMouNPJ7MZCHqIUN0x66yz1z3Q5OB57vT7cgQ=="] */ public function TheParameterShouldBeCorrect($parameter, $result) { diff --git a/test/Unidays/TrackingHelperTests/WhenRequestingASignedScriptUrlWithAllParamsSetTest.php b/test/Unidays/TrackingHelperTests/WhenRequestingASignedScriptUrlWithAllParamsSetTest.php index 8a5eeb4..3fdc5ee 100644 --- a/test/Unidays/TrackingHelperTests/WhenRequestingASignedScriptUrlWithAllParamsSetTest.php +++ b/test/Unidays/TrackingHelperTests/WhenRequestingASignedScriptUrlWithAllParamsSetTest.php @@ -15,7 +15,7 @@ public function initialise() $details->withItemsTax(34.50); $details->withShippingGross(5.00); $details->withShippingDiscount(3.00); - $details->withItemsGross(230.00); + $details->withItemsGross(1000.00); $details->withItemsOtherDiscount(10.00); $details->withUnidaysDiscountPercentage(10.00); $details->withNewCustomer(true); @@ -69,11 +69,11 @@ public function ThePathShouldBeV1_2RedemptionJs() * ["ItemsTax", "34.50"] * ["ShippingGross", "5.00"] * ["ShippingDiscount", "3.00"] - * ["ItemsGross", "230.00"] + * ["ItemsGross", "1000.00"] * ["ItemsOtherDiscount", "10.00"] * ["UNiDAYSDiscountPercentage", "10.00"] * ["NewCustomer", "True"] - * ["Signature", "c6sNwe3kcvr3/NYH+661/37BSP1RFIgrJ2LJ5e3ETOTD0kPBb6gzqvR8uEhFEJaksfBxy9Ct/rrn9/8fH0tuQQ=="] + * ["Signature", "CJUr1kkv/426vsLQPGYlrt08xhkQ20ySx7262oGxRFFWbr7190A5Obalm6D67A45efC/MJAkGQeUgQjzIWXbZA=="] */ public function TheParameterShouldBeCorrect($parameter, $result) {