@@ -18,9 +18,7 @@ public function initialize(array $params): array
1818 {
1919 $ options = new TransactionOptions \InitializeOptions ($ params );
2020
21- $ response = $ this ->httpClient ->post ('/transaction/initialize ' , [
22- 'json ' => json_encode ($ options ->all ()),
23- ]);
21+ $ response = $ this ->httpClient ->post ('/transaction/initialize ' , body: json_encode ($ options ->all ()));
2422
2523 return ResponseMediator::getContent ($ response );
2624 }
@@ -49,7 +47,7 @@ public function all(array $params): array
4947 $ options = new TransactionOptions \ReadAllOptions ($ params );
5048
5149 $ response = $ this ->httpClient ->get ('/transaction ' , [
52- 'json ' => json_encode ( $ options ->all () )
50+ 'query ' => $ options ->all ()
5351 ]);
5452
5553 return ResponseMediator::getContent ($ response );
@@ -78,9 +76,7 @@ public function charge(array $params): array
7876 {
7977 $ options = new TransactionOptions \ChargeOptions ($ params );
8078
81- $ response = $ this ->httpClient ->post ('/transaction/charge_authorization ' , [
82- 'json ' => json_encode ($ options ->all ()),
83- ]);
79+ $ response = $ this ->httpClient ->post ('/transaction/charge_authorization ' , body: json_encode ($ options ->all ()));
8480
8581 return ResponseMediator::getContent ($ response );
8682 }
@@ -96,14 +92,12 @@ public function charge(array $params): array
9692 */
9793 public function checkAuthorization (string $ amount , string $ email , string $ authorizationCode , string $ currency )
9894 {
99- $ response = $ this ->httpClient ->post ('/transaction/check_authorization ' , [
100- 'json ' => json_encode ([
101- 'amount ' => $ amount ,
102- 'email ' => $ email ,
103- 'authorization_code ' => $ authorizationCode ,
104- 'currency ' => $ currency ,
105- ]),
106- ]);
95+ $ response = $ this ->httpClient ->post ('/transaction/check_authorization ' , body: json_encode ([
96+ 'amount ' => $ amount ,
97+ 'email ' => $ email ,
98+ 'authorization_code ' => $ authorizationCode ,
99+ 'currency ' => $ currency ,
100+ ]));
107101
108102 return ResponseMediator::getContent ($ response );
109103 }
@@ -132,7 +126,7 @@ public function stats(array $params): array
132126 $ options = new TransactionOptions \StatsOptions ($ params );
133127
134128 $ response = $ this ->httpClient ->get ('/transaction/totals ' , [
135- 'json ' => json_encode ( $ options ->all () )
129+ 'query ' => $ options ->all ()
136130 ]);
137131
138132 return ResponseMediator::getContent ($ response );
@@ -149,7 +143,7 @@ public function export(array $params): array
149143 $ options = new TransactionOptions \StatsOptions ($ params );
150144
151145 $ response = $ this ->httpClient ->get ('/transaction/export ' , [
152- 'json ' => json_encode ( $ options ->all () )
146+ 'query ' => $ options ->all ()
153147 ]);
154148
155149 return ResponseMediator::getContent ($ response );
@@ -165,9 +159,7 @@ public function debitPartially(array $params): array
165159 {
166160 $ options = new TransactionOptions \PartialDebitOptions ($ params );
167161
168- $ response = $ this ->httpClient ->post ('/transaction/partial_debit ' , [
169- 'json ' => json_encode ($ options ->all ()),
170- ]);
162+ $ response = $ this ->httpClient ->post ('/transaction/partial_debit ' , body: json_encode ($ options ->all ()));
171163
172164 return ResponseMediator::getContent ($ response );
173165 }
0 commit comments