@@ -35,7 +35,7 @@ public function createInvoice(array $data)
3535 {
3636 $ response = $ this ->client ->request ('POST ' , 'invoices ' , [
3737 'auth ' => [$ this ->apiKey , '' ],
38- 'json ' => $ data ,
38+ 'form_params ' => $ data ,
3939 ]);
4040
4141 return $ response ->getStatusCode ();
@@ -56,17 +56,17 @@ public function updateInvoice($invoiceID, array $data)
5656 {
5757 $ response = $ this ->client ->request ('POST ' , 'invoices/ ' . $ invoiceID , [
5858 'auth ' => [$ this ->apiKey , '' ],
59- 'json ' => $ data ,
59+ 'form_params ' => $ data ,
6060 ]);
6161
6262 return $ response ->getStatusCode ();
6363 }
6464
65- public function chargeInvoice ($ invoiceID , $ paymentMethodID )
65+ public function chargeInvoice ($ invoiceID , $ paymentMethodID = null )
6666 {
6767 $ response = $ this ->client ->request ('POST ' , 'invoices/ ' . $ invoiceID . '/charge ' , [
6868 'auth ' => [$ this ->apiKey , '' ],
69- 'json ' => [
69+ 'form_params ' => [
7070 'payment_method_id ' => $ paymentMethodID ,
7171 ],
7272 ]);
@@ -96,7 +96,7 @@ public function createClient(array $data)
9696 {
9797 $ response = $ this ->client ->request ('POST ' , 'clients ' , [
9898 'auth ' => [$ this ->apiKey , '' ],
99- 'json ' => $ data ,
99+ 'form_params ' => $ data ,
100100 ]);
101101
102102 return $ response ->getStatusCode ();
@@ -117,7 +117,7 @@ public function updateClient($clientID, array $data)
117117 {
118118 $ response = $ this ->client ->request ('POST ' , 'clients/ ' . $ clientID , [
119119 'auth ' => [$ this ->apiKey , '' ],
120- 'json ' => $ data ,
120+ 'form_params ' => $ data ,
121121 ]);
122122
123123 return $ response ->getStatusCode ();
@@ -148,7 +148,7 @@ public function createOrder(array $data)
148148 {
149149 $ response = $ this ->client ->request ('POST ' , 'orders ' , [
150150 'auth ' => [$ this ->apiKey , '' ],
151- 'json ' => $ data ,
151+ 'form_params ' => $ data ,
152152 ]);
153153
154154 return $ response ->getStatusCode ();
@@ -169,7 +169,7 @@ public function updateOrder($orderID, array $data)
169169 {
170170 $ response = $ this ->client ->request ('POST ' , 'orders/ ' . $ orderID , [
171171 'auth ' => [$ this ->apiKey , '' ],
172- 'json ' => $ data ,
172+ 'form_params ' => $ data ,
173173 ]);
174174
175175 return $ response ->getStatusCode ();
@@ -200,7 +200,7 @@ public function createOrderMessage($orderID, $message, $user_id, $staff_only = 0
200200 {
201201 $ response = $ this ->client ->request ('POST ' , 'order_messages/ ' . $ orderID , [
202202 'auth ' => [$ this ->apiKey , '' ],
203- 'json ' => [
203+ 'form_params ' => [
204204 'order ' => $ orderID ,
205205 'message ' => $ message ,
206206 'user_id ' => $ user_id ,
0 commit comments