We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
Here is my code; ` session_start();
use Etsy\Etsy;
require_once('vendor/autoload.php');
$consumer_key = 'xxxx'; $consumer_secret = 'xxxx';
Etsy::setConfig([ 'consumer_key' => $consumer_key, 'consumer_secret' => $consumer_secret, 'scope' => ['listings_r', 'transactions_r', 'listings_w'], 'callback_uri' => 'http://localhost/etsy/callback.php' ]); $etsy = new Etsy;
if (!isset($_SESSION['temp_credentials'])) { $temp_credentials = $etsy->getTemporaryCredentials();
$_SESSION['temp_credentials']['identifier'] = $etsy->getTemporaryCredentials()->getIdentifier(); $_SESSION['temp_credentials']['secret'] = $etsy->getTemporaryCredentials()->getSecret(); header('Location: ' . $etsy->getAuthorizationUrl()); die();
}
$temp_credentials = $etsy->createTemporaryCredentials($_SESSION['temp_credentials']['identifier'], $_SESSION['temp_credentials']['secret']);
try { $token_credentials = $etsy->getTokenCredentials($etsy->getTemporaryCredentials(), $_SESSION['oauth_token'], $_SESSION['oauth_verifier']); print_r($token_credentials); } catch (\Exception $e) { die($e->getMessage()); } `
And my callback file; `session_start();
$_SESSION['oauth_token'] = $_GET['oauth_token']; $_SESSION['oauth_verifier'] = $_GET['oauth_verifier'];
header('Location: index.php');`
But I cannot verify? Where is the problem?
The text was updated successfully, but these errors were encountered:
In your try/catch, you are getting a new set of temporary credentials again. You want to pass in the ones you previously created.
Change: $token_credentials = $etsy->getTokenCredentials($etsy->getTemporaryCredentials(), $_SESSION['oauth_token'], $_SESSION['oauth_verifier']);
To: $token_credentials = $etsy->getTokenCredentials($temp_credentials, $_SESSION['oauth_token'], $_SESSION['oauth_verifier']);
Sorry, something went wrong.
No branches or pull requests
Hello,
Here is my code;
`
session_start();
use Etsy\Etsy;
require_once('vendor/autoload.php');
$consumer_key = 'xxxx';
$consumer_secret = 'xxxx';
Etsy::setConfig([
'consumer_key' => $consumer_key,
'consumer_secret' => $consumer_secret,
'scope' => ['listings_r', 'transactions_r', 'listings_w'],
'callback_uri' => 'http://localhost/etsy/callback.php'
]);
$etsy = new Etsy;
if (!isset($_SESSION['temp_credentials'])) {
$temp_credentials = $etsy->getTemporaryCredentials();
}
$temp_credentials = $etsy->createTemporaryCredentials($_SESSION['temp_credentials']['identifier'], $_SESSION['temp_credentials']['secret']);
try {
$token_credentials = $etsy->getTokenCredentials($etsy->getTemporaryCredentials(), $_SESSION['oauth_token'], $_SESSION['oauth_verifier']);
print_r($token_credentials);
} catch (\Exception $e) {
die($e->getMessage());
}
`
And my callback file;
`session_start();
$_SESSION['oauth_token'] = $_GET['oauth_token'];
$_SESSION['oauth_verifier'] = $_GET['oauth_verifier'];
header('Location: index.php');`
But I cannot verify? Where is the problem?
The text was updated successfully, but these errors were encountered: