作者 lackoxygen

fix: api req method

... ... @@ -17,11 +17,9 @@ class Coupon extends ServiceManager
*/
public function prepare(string $encryptedData = '', string $code = '')
{
return $this->app['client']
->asForm()
->withSession()
return $this->app['client']->withSession()
->signVia(new LifeSigner())
->post('/goodlife/v1/fulfilment/certificate/prepare/',
->get('/goodlife/v1/fulfilment/certificate/prepare/',
['encrypted_data' => $encryptedData, 'code' => $code]);
}
... ... @@ -34,8 +32,7 @@ class Coupon extends ServiceManager
*/
public function verify(array $body = [])
{
return $this->app['client']
->asForm()
return $this->app['client']->asJson()
->withSession()
->signVia(new LifeSigner())
->post('/goodlife/v1/fulfilment/certificate/verify/', $body);
... ... @@ -52,8 +49,7 @@ class Coupon extends ServiceManager
*/
public function cancel(array $body = [])
{
return $this->app['client']
->asForm()
return $this->app['client']->asForm()
->withSession()
->signVia(new LifeSigner())
->post('/goodlife/v1/fulfilment/certificate/cancel/', $body);
... ... @@ -68,8 +64,7 @@ class Coupon extends ServiceManager
*/
public function get(string $encryptedCode)
{
return $this->app['client']
->asForm()
return $this->app['client']->asForm()
->withSession()
->signVia(new LifeSigner())
->get('/goodlife/v1/fulfilment/certificate/get/', ['encrypted_code' => $encryptedCode]);
... ... @@ -85,8 +80,7 @@ class Coupon extends ServiceManager
*/
public function query(string $encryptedCode = '', string $orderId = '')
{
return $this->app['client']
->asForm()
return $this->app['client']->asForm()
->withSession()
->signVia(new LifeSigner())
->get('/goodlife/v1/fulfilment/certificate/query/',
... ...