Skip to content

Commit

Permalink
Merge 6d4d5ed into 724ed4f
Browse files Browse the repository at this point in the history
  • Loading branch information
solancer committed Apr 13, 2021
2 parents 724ed4f + 6d4d5ed commit 9772666
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion paypayopa/client.py
Expand Up @@ -33,13 +33,15 @@ class Client:
"""PayPay client class"""
DEFAULTS = {
'sandbox_base_url': URL.SANDBOX_BASE_URL,
'production_base_url': URL.PRODUCTION_BASE_URL
'production_base_url': URL.PRODUCTION_BASE_URL,
'perf_mode_base_url': URL.PERF_BASE_URL
}

def __init__(self,
session=None,
auth=None,
production_mode=False,
perf_mode=False,
**options):
"""
Initialize a Client object with session,
Expand All @@ -48,6 +50,7 @@ def __init__(self,
self.session = session or requests.Session()
self.auth = auth
self.production_mode = production_mode
self.perf_mode = perf_mode
self.assume_merchant = ""

self.base_url = self._set_base_url(**options)
Expand All @@ -70,6 +73,8 @@ def _set_base_url(self, **options):
base_url = self.DEFAULTS['sandbox_base_url']
if self.production_mode is True:
base_url = self.DEFAULTS['production_base_url']
if self.perf_mode is True:
base_url = self.DEFAULTS['perf_mode_base_url']
if 'base_url' in options:
base_url = options['base_url']
del (options['base_url'])
Expand Down
1 change: 1 addition & 0 deletions paypayopa/constants/url.py
@@ -1,6 +1,7 @@
class URL(object):
SANDBOX_BASE_URL = 'https://stg-api.sandbox.paypay.ne.jp'
PRODUCTION_BASE_URL = 'https://api.paypay.ne.jp'
PERF_BASE_URL = 'https://perf-api.paypay.ne.jp'
RESOLVE = 'https://developer.paypay.ne.jp/develop/resolve'
CODE = "/v2/codes"
PAYMENT = "/v2/payments"
Expand Down

0 comments on commit 9772666

Please sign in to comment.