This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed
Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,20 @@ public function mine()
2525 public function estimateShippingMethods ($ body = [])
2626 {
2727 $ this ->validateSingleStoreCode ();
28-
28+
2929 return $ this ->post ('/carts/mine/estimate-shipping-methods ' , $ body );
3030 }
31+
32+ /**
33+ * Calculate quote totals based on address and shipping method.
34+ *
35+ * @param array $body
36+ * @return array
37+ */
38+ public function totalsInformation ($ body = [])
39+ {
40+ $ this ->validateSingleStoreCode ();
41+
42+ return $ this ->post ('/carts/mine/totals-information ' , $ body );
43+ }
3144}
Original file line number Diff line number Diff line change @@ -56,4 +56,18 @@ public function test_must_pass_a_single_store_code_to_estimate_shipping_methods(
5656 $ magento = new Magento ();
5757 $ magento ->api ('carts ' )->estimateShippingMethods ([]);
5858 }
59+
60+ public function test_can_call_carts_totals_information ()
61+ {
62+ Http::fake ([
63+ '*rest/default/V1/carts/mine/totals-information ' => Http::response ([], 200 ),
64+ ]);
65+
66+ $ magento = new Magento ();
67+ $ magento ->storeCode = 'default ' ;
68+
69+ $ api = $ magento ->api ('carts ' )->totalsInformation ([]);
70+
71+ $ this ->assertTrue ($ api ->ok ());
72+ }
5973}
Original file line number Diff line number Diff line change @@ -95,4 +95,12 @@ public function test_can_call_guest_carts_totals_information()
9595
9696 $ this ->assertTrue ($ api ->ok ());
9797 }
98+
99+ public function test_must_pass_a_single_store_code_to_totals_information ()
100+ {
101+ $ this ->expectException ('exception ' );
102+
103+ $ magento = new Magento ();
104+ $ magento ->api ('carts ' )->totalsInformation ([]);
105+ }
98106}
You can’t perform that action at this time.
0 commit comments