Commit 5a8b6c58 authored by Dzulfqar Ridha's avatar Dzulfqar Ridha

update metering(getsub) and mashery(only username)

parent 03c76e92
...@@ -83,7 +83,7 @@ class UserController extends BaseController ...@@ -83,7 +83,7 @@ class UserController extends BaseController
$response = $this->masheryClient()->request('POST', 'https://api.mashery.com/v3/rest/members', [ $response = $this->masheryClient()->request('POST', 'https://api.mashery.com/v3/rest/members', [
'json' => [ 'json' => [
'username' => $request->get('username'), 'username' => $request->get('username'),
'email' => $request->get('email'), 'email' => $request->get('username'),
'displayName' => $request->get('name'), 'displayName' => $request->get('name'),
'areaStatus' => 'active', 'areaStatus' => 'active',
'externalId' => '', 'externalId' => '',
...@@ -144,7 +144,7 @@ class UserController extends BaseController ...@@ -144,7 +144,7 @@ class UserController extends BaseController
$statusCode = 200; $statusCode = 200;
try { try {
$response = $this->meteringClient()->request('GET', 'insert_subs', [ $response = $this->meteringClient()->request('GET', 'insert_subs/', [
'query' => [ 'query' => [
'username' => $request->get('username'), 'username' => $request->get('username'),
'password' => $request->get('password'), 'password' => $request->get('password'),
...@@ -171,38 +171,4 @@ class UserController extends BaseController ...@@ -171,38 +171,4 @@ class UserController extends BaseController
return response()->json($mResponse, $statusCode); return response()->json($mResponse, $statusCode);
} }
public function bucketTest()
{
$mResponse = new MResponse();
$statusCode = 200;
try {
$response = $this->meteringClient()->request('GET', 'insert_subs', [
'query' => [
'username' => 'STORE-FRONT',
'password' => 'STORE-123',
'appsid' => 'd0000000000000000072',
'apps_name' => 'developer03',
'msisdn_paired' => '081317200003'
]
]);
$resBody = json_decode($response->getBody()->getContents(), true);
if ($response->getStatusCode() != 200) {
$statusCode = $response->getStatusCode();
$mResponse->message = $resBody;
} else {
$mResponse->success = true;
$mResponse->message = 'success';
$mResponse->data = $resBody;
}
} catch (\Exception $e) {
$statusCode = 500;
$mResponse->message = $e->getMessage();
}
return response()->json($mResponse, $statusCode);
}
} }
...@@ -24,7 +24,7 @@ class MSUserCreateRequest extends FormRequestErrors ...@@ -24,7 +24,7 @@ class MSUserCreateRequest extends FormRequestErrors
{ {
return [ return [
'username' => 'required', 'username' => 'required',
'email' => 'required', //'email' => 'required',
'name' => 'required', 'name' => 'required',
'password' => 'required' 'password' => 'required'
]; ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment