From ddaef4025d344d94eb6b95242b04b4b30512bdd2 Mon Sep 17 00:00:00 2001 From: Simon Cedula Date: Tue, 12 Sep 2017 14:27:56 +0200 Subject: [PATCH] Updated to new Battle.net URIs --- src/OAuth/OAuth2/Service/BattleNet.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/OAuth/OAuth2/Service/BattleNet.php b/src/OAuth/OAuth2/Service/BattleNet.php index ec3fdad8..22b9e919 100644 --- a/src/OAuth/OAuth2/Service/BattleNet.php +++ b/src/OAuth/OAuth2/Service/BattleNet.php @@ -26,13 +26,18 @@ class BattleNet extends AbstractService { * Defined API URIs. * * @link https://dev.battle.net/docs + * @link https://dev.battle.net/docs/read/oauth OAuth URIs section contains new URIs - TW and KR were merged + * SEA data is located under US API. Old URI names are therefor left here with updated URIs, APAC is added */ const API_URI_US = 'https://us.api.battle.net/'; const API_URI_EU = 'https://eu.api.battle.net/'; - const API_URI_KR = 'https://kr.api.battle.net/'; - const API_URI_TW = 'https://tw.api.battle.net/'; + const API_URI_APAC = 'https://apac.api.battle.net/'; const API_URI_CN = 'https://api.battlenet.com.cn/'; - const API_URI_SEA = 'https://sea.api.battle.net/'; + + // old API names, KR and TW should use APAC, SEA should use US + const API_URI_KR = 'https://apac.api.battle.net/'; + const API_URI_TW = 'https://apac.api.battle.net/'; + const API_URI_SEA = 'https://us.api.battle.net/'; public function __construct( CredentialsInterface $credentials, ClientInterface $httpClient, @@ -59,10 +64,11 @@ private function GetOAuthBaseUri() { switch( $this->baseApiUri ) { case self::API_URI_US: return 'https://us.battle.net/oauth/'; case self::API_URI_EU: return 'https://eu.battle.net/oauth/'; - case self::API_URI_KR: return 'https://kr.battle.net/oauth/'; - case self::API_URI_TW: return 'https://tw.battle.net/oauth/'; + case self::API_URI_KR: return 'https://apac.battle.net/oauth/'; + case self::API_URI_TW: return 'https://apac.battle.net/oauth/'; + case self::API_URI_APAC: return 'https://apac.battle.net/oauth/'; case self::API_URI_CN: return 'https://www.battlenet.com.cn/oauth/'; - case self::API_URI_SEA: return 'https://sea.battle.net/oauth/'; + case self::API_URI_SEA: return 'https://us.battle.net/oauth/'; } }