作者 lackoxygen

fix: api req method

@@ -17,11 +17,9 @@ class Coupon extends ServiceManager @@ -17,11 +17,9 @@ class Coupon extends ServiceManager
17 */ 17 */
18 public function prepare(string $encryptedData = '', string $code = '') 18 public function prepare(string $encryptedData = '', string $code = '')
19 { 19 {
20 - return $this->app['client']  
21 - ->asForm()  
22 - ->withSession() 20 + return $this->app['client']->withSession()
23 ->signVia(new LifeSigner()) 21 ->signVia(new LifeSigner())
24 - ->post('/goodlife/v1/fulfilment/certificate/prepare/', 22 + ->get('/goodlife/v1/fulfilment/certificate/prepare/',
25 ['encrypted_data' => $encryptedData, 'code' => $code]); 23 ['encrypted_data' => $encryptedData, 'code' => $code]);
26 } 24 }
27 25
@@ -34,8 +32,7 @@ class Coupon extends ServiceManager @@ -34,8 +32,7 @@ class Coupon extends ServiceManager
34 */ 32 */
35 public function verify(array $body = []) 33 public function verify(array $body = [])
36 { 34 {
37 - return $this->app['client']  
38 - ->asForm() 35 + return $this->app['client']->asJson()
39 ->withSession() 36 ->withSession()
40 ->signVia(new LifeSigner()) 37 ->signVia(new LifeSigner())
41 ->post('/goodlife/v1/fulfilment/certificate/verify/', $body); 38 ->post('/goodlife/v1/fulfilment/certificate/verify/', $body);
@@ -52,8 +49,7 @@ class Coupon extends ServiceManager @@ -52,8 +49,7 @@ class Coupon extends ServiceManager
52 */ 49 */
53 public function cancel(array $body = []) 50 public function cancel(array $body = [])
54 { 51 {
55 - return $this->app['client']  
56 - ->asForm() 52 + return $this->app['client']->asForm()
57 ->withSession() 53 ->withSession()
58 ->signVia(new LifeSigner()) 54 ->signVia(new LifeSigner())
59 ->post('/goodlife/v1/fulfilment/certificate/cancel/', $body); 55 ->post('/goodlife/v1/fulfilment/certificate/cancel/', $body);
@@ -68,8 +64,7 @@ class Coupon extends ServiceManager @@ -68,8 +64,7 @@ class Coupon extends ServiceManager
68 */ 64 */
69 public function get(string $encryptedCode) 65 public function get(string $encryptedCode)
70 { 66 {
71 - return $this->app['client']  
72 - ->asForm() 67 + return $this->app['client']->asForm()
73 ->withSession() 68 ->withSession()
74 ->signVia(new LifeSigner()) 69 ->signVia(new LifeSigner())
75 ->get('/goodlife/v1/fulfilment/certificate/get/', ['encrypted_code' => $encryptedCode]); 70 ->get('/goodlife/v1/fulfilment/certificate/get/', ['encrypted_code' => $encryptedCode]);
@@ -85,8 +80,7 @@ class Coupon extends ServiceManager @@ -85,8 +80,7 @@ class Coupon extends ServiceManager
85 */ 80 */
86 public function query(string $encryptedCode = '', string $orderId = '') 81 public function query(string $encryptedCode = '', string $orderId = '')
87 { 82 {
88 - return $this->app['client']  
89 - ->asForm() 83 + return $this->app['client']->asForm()
90 ->withSession() 84 ->withSession()
91 ->signVia(new LifeSigner()) 85 ->signVia(new LifeSigner())
92 ->get('/goodlife/v1/fulfilment/certificate/query/', 86 ->get('/goodlife/v1/fulfilment/certificate/query/',