File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,12 +82,27 @@ Bigcommerce::configure(array(
8282~~~
8383
8484### OAuth
85+
86+ In order to obtain the auth_token you would consume ` Bigcommerce::getAuthToken ` method
87+
8588~~~ php
89+
90+ $object = new \stdClass();
91+ $object->client_id = 'xxxxxx';
92+ $object->client_secret = 'xxxxx;
93+ $object->redirect_uri = 'https://app.com/redirect';
94+ $object->code = $request->get('code');
95+ $object->context = $request->get('context');
96+ $object->scope = $request->get('scope');
97+
98+ $authTokenResponse = Bigcommerce::getAuthToken($object);
99+
86100Bigcommerce::configure(array(
87101 'client_id' => 'xxxxxxxx',
88- 'auth_token' => 'xxxxxxx' ,
102+ 'auth_token' => $authTokenResponse->access_token ,
89103 'store_hash' => 'xxxxxxx'
90104));
105+
91106~~~
92107
93108Connecting to the store
Original file line number Diff line number Diff line change @@ -413,7 +413,6 @@ public static function getAuthToken($object)
413413 {
414414 $ context = array_merge (array ('grant_type ' => 'authorization_code ' ), (array )$ object );
415415 $ connection = new Connection ();
416- $ connection ->useUrlEncoded ();
417416
418417 return $ connection ->post (self ::$ login_url . '/oauth2/token ' , $ context );
419418 }
You can’t perform that action at this time.
0 commit comments