๊ตฌ๊ธ API์ AndroidPublisher๋ฅผ ํตํด ์๋๋ก์ด๋ ์ธ์ฑ ๊ฒฐ์ ํ ๋ด์ญ์ ๊ฒ์ฆ ์ฝ๋ ์ง์ ํ ์คํธ๋ฅผ ํ๋๋ฐ ์๊ธด ๋ฌธ์
๋ชจ๋ ๊ถํ์ Perfect.. ๊ณ์ ๋ด ํ๋ก์ ํธ๊ฐ ์ฌ๋ฌ๊ฐ์ด์ง๋ง, ํ๋์ ํ๋ก์ ํธ์ ์๋น์ค ๊ณ์ ์ ์ถ๊ฐํด "์์ ์" ๊ถํ์ ์คฌ๊ณ ,
Json ํ์ผ์ ๋ฐ๊ณ ์ฝ๋๋ฅผ ๋ฃ์๋๋ฐ.. ์... ์๋๋ค ใ ใ
์๋๋ ๊ฒ์ฆ ๊ด๋ จ ์ฝ๋. ๋ก๊ทธ์ธ ๋ถํฐ, ๊ฒฐ์ ๋ด์ฉ ๊ฒ์ฆ
$this->client = new Google_Client();
$this->client->setAuthConfig(getenv('GOOGLE_SDK_FILE'));
$this->service = new Google_Service_AndroidPublisher($this->client);
$this->client->addScope('https://www.googleapis.com/auth/androidpublisher');
try {
$purchase = $this->service->purchases_products->get($this->package_name, $product_id, $purchase_token);
} catch (Google_Service_Exception $e) {
echo json_encode($e->getMessage());
}
์๋ฌ๋ก๊ทธ๋ฅผ ๋ฐ์๋ณด๋.. 401 ์๋ฌ๊ฐ ๋์ค๋ ๊ฒ..
์? ์ ๊ถํ ๋ฌธ์ ๊ฐ ์ ๋์ค์ง????????????? ์์ ์์ธ๋ฐ? ๊ณ์ ์ ํ๋ก์ ํธ ๊ถํ๋ ์ถ๊ฐํ๋๋ฐ?!!!!!!
"error": {
"code": 401,
"message": "The current user has insufficient permissions to perform the requested operation.",
"errors": [
{
"domain": "androidpublisher",
"message": "The current user has insufficient permissions to perform the requested operation.",
"reason": "permissionDenied"
}
]
}
}
๊ด๋ จ ๋ต๋ณ์ ์ฐพ๋ค ๋ณด๋...
์ด๋ฐ ๋ฏธ์น. ๊ตฌ๊ธ ์๋ผ๋ค. ๋๋ ๊ฐ์ ๋ง์์ธ ๋ถ์ด ๊ณ์๋ค?!
์ด๋ฏธ ์์ฑ๋ ํ๋ก์ ํธ, ๊ทธ๋ฆฌ๊ณ ์ด๋ฏธ ์ธ์ฑ ์ํ๊น์ง ์ค์ ๋ ์ํ์์ ์๋น์ค ๊ณ์ ์ถ๊ฐํ๊ณ ,
ํ๋ก์ ํธ ๊ถํ ์ฃผ๊ณ ์๋ณ ์ง๋์ ๋จ์ด๋ดค์. ์ด๋ฏธ ๋ฑ๋ก๋ ์ธ์ฑ ์ํ์ ๋ํ ๊ถํ์ด ์๋๊ฒใ ใ ใ ใ ใ ใ ใ ใ ใ
๋ค์ ๊ตฌ๊ธ ์ฝ์๋ก ๊ฐ์.. "ํ๋ก์ ํธ" -> ์์ต์ฐฝ์ถ -> ์ ํ -> ์ธ์ฑ ์ํ -> ์ธ์ฑ ์ํ ๋ณด๊ธฐ ์ ์ ๊ทผ..
์ด๋ฆ์ด๋ ์ํ ์ค๋ช ๋์ถฉ ์ ์ด๋ฃ๊ณ , "๋ณ๊ฒฝ ์ฌํญ ์ ์ฅ"์ ํด์ฃผ๋. ๋~~๋ต 30์ด~1๋ถ ๋ค์ ์ ์ ์ ๊ทผ๋จ...
์. ์ง์ง ์ด๊ฑธ๋ก ํ๋ฃจ ๋ ๋ฆฐ๊ฑธ ์๊ฐํ๋ ใ ใ ใ ใ ใ ใ ใ ใ ๋จธ๋ฆฌ๊ฐ ์ง~๋~ ใ ใ ใ ใ
๊ตฌ๊ธ ํ๋ ์ด ์ฝ์์์ ์ ์์ ์ผ๋ก '์๋น์ค ๊ณ์ ' ์ถ๊ฐํ๊ณ . ๊ถํ๋ ๋ค์ฃผ๊ณ , ํ๋ก์ ํธ ์ค์ ๊น์ง ๋ง์ณค๋๋ฐ๋ ์๋ฌ๊ฐ ๋ฌ๋ค๋ฉด
๊ผญ! ํ์ธ ํ์.