I have been using this ebay-sdk-php from David Sadler to generate a Trading Call to Ebay API, but first I have to create the OAuthUserToken.
I used the gettoken.php example and created the following code:
$service = new \DTS\eBaySDK\OAuth\Services\OAuthService([
'credentials' => config('ebay.'.config('ebay.mode').'.credentials'),
'ruName' => config('ebay.'.config('ebay.mode').'.ruName'),
'sandbox' => true
]);
$token = session('????'); //here I have to retrieve the authorization callback information.
/**
* Create the request object.
*/
$request = new \DTS\eBaySDK\OAuth\Types\GetUserTokenRestRequest();
$request->code = $token;
/**
* Send the request.
*/
$response = $service->getUserToken($request);
For some reason I cannot generate a redirect for a UserOauth Token. I supposed that code:
$service = new\DTS\eBaySDK\OAuth\Services\OAuthService([
...automatically generated a redirect to eBay Grant Area, but it was not the case.
Does anyone know how to solve this? I would like to know how to grant the user access and then perform a call (e.g. getEbayTime
).