Skip to content

Commit

Permalink
Merge pull request #8842 from brave/pr8826_rewards-bitflyer-productio…
Browse files Browse the repository at this point in the history
…n-hostname_1.25.x

Rename bitFlyer production hostname from bitflyer.jp -> bitflyer.com (uplift to 1.25.x)
  • Loading branch information
kjozwiak authored May 19, 2021
2 parents 29a438a + 67a9fe3 commit 00e70d2
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void LoadRewardsURL(
// Only accept rewards scheme from allowed domains
const std::string bitflyer_staging_host = GURL(BITFLYER_STAGING_URL).host();
const char* kAllowedDomains[] = {
"bitflyer.jp", // bitFlyer production
"bitflyer.com", // bitFlyer production
bitflyer_staging_host.c_str(), // bitFlyer staging
"uphold.com", // Uphold staging/production
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class LedgerImpl;
namespace bitflyer {

const char kUrlStaging[] = BITFLYER_STAGING_URL;
const char kUrlProduction[] = "https://bitflyer.jp";
const char kUrlProduction[] = "https://bitflyer.com";
const char kFeeAddressStaging[] = "068e675b-f137-48ed-8068-4ad34ca4f30f";
const char kFeeAddressProduction[] = "e77cacb4-c49c-4451-bc2d-5072c10e55d3";
const char kACAddressStaging[] = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ TEST_F(BitflyerUtilTest, GetAuthorizeUrl) {
std::string result =
bitflyer::GetAuthorizeUrl("my-state", "my-code-verifier");
ASSERT_EQ(result,
"https://bitflyer.jp/ex/OAuth/authorize"
"?client_id=" BITFLYER_CLIENT_ID
"&scope=assets create_deposit_id withdraw_to_deposit_id"
"&redirect_uri=rewards://bitflyer/authorization"
"&state=my-state"
"&response_type=code"
"&code_challenge_method=S256"
"&code_challenge=5Cxs3JXozcwTeteCIu4BcTieAhEIqjn643F10PxPD_w");
std::string(kUrlProduction) +
"/ex/OAuth/authorize"
"?client_id=" BITFLYER_CLIENT_ID
"&scope=assets create_deposit_id withdraw_to_deposit_id"
"&redirect_uri=rewards://bitflyer/authorization"
"&state=my-state"
"&response_type=code"
"&code_challenge_method=S256"
"&code_challenge=5Cxs3JXozcwTeteCIu4BcTieAhEIqjn643F10PxPD_w");

// staging
ledger::_environment = type::Environment::STAGING;
Expand All @@ -110,7 +111,7 @@ TEST_F(BitflyerUtilTest, GetAddUrl) {
// production
ledger::_environment = type::Environment::PRODUCTION;
std::string result = bitflyer::GetAddUrl();
ASSERT_EQ(result, "https://bitflyer.jp/ex/Home?login=1");
ASSERT_EQ(result, std::string(kUrlProduction) + "/ex/Home?login=1");

// staging
ledger::_environment = type::Environment::STAGING;
Expand All @@ -122,7 +123,7 @@ TEST_F(BitflyerUtilTest, GetWithdrawUrl) {
// production
ledger::_environment = type::Environment::PRODUCTION;
std::string result = bitflyer::GetWithdrawUrl();
ASSERT_EQ(result, "https://bitflyer.jp/ex/Home?login=1");
ASSERT_EQ(result, std::string(kUrlProduction) + "/ex/Home?login=1");

// staging
ledger::_environment = type::Environment::STAGING;
Expand All @@ -138,17 +139,17 @@ TEST_F(BitflyerUtilTest, GetWallet) {
ASSERT_TRUE(!result);

const std::string wallet = R"({
"account_url": "https://bitflyer.jp/ex/Home?login=1",
"account_url": "https://bitflyer.com/ex/Home?login=1",
"add_url": "",
"address": "2323dff2ba-d0d1-4dfw-8e56-a2605bcaf4af",
"fees": {},
"login_url": "https://sandbox.bitflyer.jp/authorize/4c2b665ca060d",
"login_url": "https://sandbox.bitflyer.com/authorize/4c2b665ca060d",
"one_time_string": "1F747AE0A708E47ED7E650BF1856B5A4EF7E36833BDB1158A108F8",
"code_verifier": "1234567890",
"status": 2,
"token": "4c80232r219c30cdf112208890a32c7e00",
"user_name": "test",
"verify_url": "https://sandbox.bitflyer.jp/authorize/4c2b665ca060d",
"verify_url": "https://sandbox.bitflyer.com/authorize/4c2b665ca060d",
"withdraw_url": ""
})";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace endpoint {
namespace bitflyer {

const char kUrlStaging[] = BITFLYER_STAGING_URL;
const char kUrlProduction[] = "https://bitflyer.jp";
const char kUrlProduction[] = "https://bitflyer.com";

std::string GetClientId() {
return ::ledger::bitflyer::GetClientId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TEST(BitflyerUtilsTest, GetServerUrlStaging) {
TEST(BitflyerUtilsTest, GetServerUrlProduction) {
ledger::_environment = type::Environment::PRODUCTION;
const std::string url = GetServerUrl("/test");
ASSERT_EQ(url, "https://bitflyer.jp/test");
ASSERT_EQ(url, "https://bitflyer.com/test");
}

} // namespace bitflyer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "bat/ledger/ledger.h"

// GET https://bitflyer.jp/api/link/v1/account/inventory
// GET https://bitflyer.com/api/link/v1/account/inventory
//
// Success code:
// HTTP_OK (200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "bat/ledger/ledger.h"

// POST https://bitflyer.jp/api/link/v1/token
// POST https://bitflyer.com/api/link/v1/token
//
// Request body:
// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "bat/ledger/internal/bitflyer/bitflyer.h"
#include "bat/ledger/ledger.h"

// POST https://bitflyer.jp/api/link/v1/coin/withdraw-to-deposit-id/request
// POST https://bitflyer.com/api/link/v1/coin/withdraw-to-deposit-id/request
//
// Request body:
// {
Expand Down

0 comments on commit 00e70d2

Please sign in to comment.