Skip to content

Commit 12cda45

Browse files
fred-yu-2013stiartsly
authored andcommitted
CU-3884ybt - Update the name of the payment config item.
1 parent 35f9ac8 commit 12cda45

File tree

11 files changed

+27
-27
lines changed

11 files changed

+27
-27
lines changed

config/.env.local

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ SENTRY_DSN = https://[email protected]/5
2222

2323
## payment configuration
2424
PAYMENT_ENABLED = True
25-
PAYMENT_PATH = ./payment_config.json
25+
PAYMENT_CONFIG_PATH = ./payment_config.json
2626
PAYMENT_CONTRACT_URL = http://127.0.0.1:8545
2727
PAYMENT_CONTRACT_ADDRESS = 0x5fbdb2315678afecb367f032d93f642f64180aa3
28-
PAYMENT_ADDRESS = EN9YK69ScA6WFgVQW3UZcmSRLSCStaU2pQ
28+
PAYMENT_RECEIVING_ADDRESS = EN9YK69ScA6WFgVQW3UZcmSRLSCStaU2pQ
2929

3030
## using atlast service or mongodb service
3131
ATLAS_ENABLED = False

config/.env.sample

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
## payment configuration
2424
# PAYMENT_ENABLED = True
25-
# PAYMENT_PATH = ./payment_config.json
25+
# PAYMENT_CONFIG_PATH = ./payment_config.json
2626
# PAYMENT_CONTRACT_URL = "xxx"
2727
# PAYMENT_CONTRACT_ADDRESS = "xxx"
28-
# PAYMENT_ADDRESS =
28+
# PAYMENT_RECEIVING_ADDRESS =
2929

3030
## using atlast service or mongodb service
3131
ATLAS_ENABLED = False
File renamed without changes.

config/.env.travis

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ SENTRY_ENABLED = False
2121

2222
## payment configuration
2323
PAYMENT_ENABLED = True
24-
PAYMENT_PATH = ./payment_config.json
24+
PAYMENT_CONFIG_PATH = ./payment_config.json
2525
PAYMENT_CONTRACT_URL = http://127.0.0.1:8545
2626
PAYMENT_CONTRACT_ADDRESS = 0x5fbdb2315678afecb367f032d93f642f64180aa3
27-
PAYMENT_ADDRESS = EN9YK69ScA6WFgVQW3UZcmSRLSCStaU2pQ
27+
PAYMENT_RECEIVING_ADDRESS = EN9YK69ScA6WFgVQW3UZcmSRLSCStaU2pQ
2828

2929
## using atlast service or mongodb service
3030
ATLAS_ENABLED = False

hive/settings.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ def DID_DATA_CACHE_PATH(self):
7272
return self.DID_DATA_BASE_DIR + '/cache'
7373

7474
@property
75-
def PAYMENT_PATH(self):
76-
path = self.env_config('PAYMENT_PATH', default='./payment_config.json', cast=str)
75+
def PAYMENT_CONFIG_PATH(self):
76+
path = self.env_config('PAYMENT_CONFIG_PATH', default='./payment_config.json', cast=str)
7777
if path.startswith('/'):
7878
return path
7979
return os.path.join(BASE_DIR, path)
8080

8181
@property
82-
def PAYMENT_ADDRESS(self):
83-
return self.env_config('PAYMENT_ADDRESS', default='EN9YK69ScA6WFgVQW3UZcmSRLSCStaU2pQ', cast=str)
82+
def PAYMENT_RECEIVING_ADDRESS(self):
83+
return self.env_config('PAYMENT_RECEIVING_ADDRESS', default='EN9YK69ScA6WFgVQW3UZcmSRLSCStaU2pQ', cast=str)
8484

8585
@property
8686
def MONGODB_URI(self):

hive/util/payment/payment_config.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ class PaymentConfig:
1414

1515
@staticmethod
1616
def init_config():
17-
path = os.path.join(SRC_DIR, hive_setting.PAYMENT_PATH)
17+
path = os.path.join(SRC_DIR, hive_setting.PAYMENT_CONFIG_PATH)
1818
config_file = Path(path)
1919
if not config_file.exists():
2020
logging.getLogger('v1 PaymentConfig').info("hive_setting.HIVE_PAYMENT_CONFIG dose not exist")
2121
else:
22-
logging.getLogger('v1 PaymentConfig').info("hive_setting.HIVE_PAYMENT_CONFIG: " + hive_setting.PAYMENT_PATH)
22+
logging.getLogger('v1 PaymentConfig').info("hive_setting.HIVE_PAYMENT_CONFIG: " + hive_setting.PAYMENT_CONFIG_PATH)
2323
with open(path, 'r')as fp:
2424
json_data = json.load(fp)
2525
PaymentConfig.config_info = json_data
26-
logging.getLogger("Hive Payment").info("Load payment config file:" + hive_setting.PAYMENT_PATH)
26+
logging.getLogger("Hive Payment").info("Load payment config file:" + hive_setting.PAYMENT_CONFIG_PATH)
2727

2828
@staticmethod
2929
def get_all_package_info():

src/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def before_request():
4040
if request.method == "OPTIONS":
4141
# return None to let CORS handle OPTIONS
4242
return
43-
# elif request.method == '""OPTIONS':
44-
# # for hive js demo local connecting, its maybe ionic bug
45-
# request.method = 'OPTIONS'
46-
# return '{}'
43+
elif request.method == '""OPTIONS':
44+
# for hive js demo local connecting, its maybe ionic bug
45+
request.method = 'OPTIONS'
46+
return '{}'
4747

4848
# Sets the "wsgi.input_terminated" environment flag, thus enabling
4949
# Werkzeug to pass chunked requests as streams; this makes the API

src/modules/payment/order.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def to_get_orders(self):
140140

141141
class OrderManager:
142142
def __init__(self):
143-
self.ela_address = hive_setting.PAYMENT_ADDRESS
143+
self.ela_address = hive_setting.PAYMENT_RECEIVING_ADDRESS
144144
self.mcli = MongodbClient()
145145
self.vault_manager = VaultManager()
146146
self.backup_manager = BackupManager()

src/modules/payment/payment.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class Payment(metaclass=Singleton):
2424
def __init__(self):
25-
self.ela_address = hive_setting.PAYMENT_ADDRESS
25+
self.ela_address = hive_setting.PAYMENT_RECEIVING_ADDRESS
2626
self.auth = Auth()
2727
self.vault_subscription = None
2828
self.vault_manager = VaultManager()

src/settings.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def PAYMENT_ENABLED(self):
9090
return self.env_config('PAYMENT_ENABLED', default='True', cast=bool)
9191

9292
@property
93-
def PAYMENT_PATH(self):
94-
path = self.env_config('PAYMENT_PATH', default='./payment_config.json', cast=str)
93+
def PAYMENT_CONFIG_PATH(self):
94+
path = self.env_config('PAYMENT_CONFIG_PATH', default='./payment_config.json', cast=str)
9595
if path.startswith('/'):
9696
return path
9797
return os.path.join(BASE_DIR, path)
@@ -105,8 +105,8 @@ def PAYMENT_CONTRACT_ADDRESS(self):
105105
return self.env_config('PAYMENT_CONTRACT_ADDRESS', default='', cast=str)
106106

107107
@property
108-
def PAYMENT_ADDRESS(self):
109-
return self.env_config('PAYMENT_ADDRESS', default='EN9YK69ScA6WFgVQW3UZcmSRLSCStaU2pQ', cast=str)
108+
def PAYMENT_RECEIVING_ADDRESS(self):
109+
return self.env_config('PAYMENT_RECEIVING_ADDRESS', default='EN9YK69ScA6WFgVQW3UZcmSRLSCStaU2pQ', cast=str)
110110

111111
@property
112112
def ATLAS_ENABLED(self):

src/utils_v1/payment/payment_config.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ class PaymentConfig:
1111

1212
@staticmethod
1313
def init_config():
14-
config_file = Path(hive_setting.PAYMENT_PATH)
14+
config_file = Path(hive_setting.PAYMENT_CONFIG_PATH)
1515
if not config_file.exists():
1616
logging.getLogger('PaymentConfig').info("hive_setting.HIVE_PAYMENT_CONFIG dose not exist")
1717
else:
18-
logging.getLogger('PaymentConfig').info("hive_setting.HIVE_PAYMENT_CONFIG: " + hive_setting.PAYMENT_PATH)
19-
with open(hive_setting.PAYMENT_PATH, 'r')as fp:
18+
logging.getLogger('PaymentConfig').info("hive_setting.HIVE_PAYMENT_CONFIG: " + hive_setting.PAYMENT_CONFIG_PATH)
19+
with open(hive_setting.PAYMENT_CONFIG_PATH, 'r')as fp:
2020
json_data = json.load(fp)
2121
PaymentConfig.config_info = json_data
22-
logging.getLogger("PaymentConfig").info("Load payment config file:" + hive_setting.PAYMENT_PATH)
22+
logging.getLogger("PaymentConfig").info("Load payment config file:" + hive_setting.PAYMENT_CONFIG_PATH)
2323

2424
@staticmethod
2525
def get_all_package_info():

0 commit comments

Comments
 (0)