remove broken unneeded code from bitpay
This commit is contained in:
parent
e9dcf80f6c
commit
2bfd3787e9
@ -13,24 +13,6 @@ class Client:
|
||||
self.tokens = tokens
|
||||
self.user_agent = 'bitpay-python'
|
||||
|
||||
def pair_pos_client(self, code):
|
||||
if re.match("^\w{7,7}$", code) is None:
|
||||
raise BtcPayArgumentError("pairing code is not legal")
|
||||
payload = {'id': self.client_id, 'pairingCode': code}
|
||||
response = self.unsigned_request('/tokens', payload)
|
||||
if response.ok:
|
||||
self.tokens = self.token_from_response(response.json())
|
||||
return self.tokens
|
||||
self.response_error(response)
|
||||
|
||||
def create_token(self, facade):
|
||||
payload = {'id': self.client_id, 'facade': facade}
|
||||
response = self.unsigned_request('/tokens', payload)
|
||||
if response.ok:
|
||||
self.tokens = self.token_from_response(response.json())
|
||||
return response.json()['data'][0]['pairingCode']
|
||||
self.response_error(response)
|
||||
|
||||
def create_invoice(self, params):
|
||||
self.verify_invoice_params(params['price'], params['currency'])
|
||||
payload = json.dumps(params)
|
||||
@ -77,15 +59,6 @@ class Client:
|
||||
return False
|
||||
return True
|
||||
|
||||
def token_from_response(self, responseJson):
|
||||
"""
|
||||
Deprecated, will be made private in 2.4
|
||||
"""
|
||||
token = responseJson['data'][0]['token']
|
||||
facade = responseJson['data'][0]['facade']
|
||||
return {facade: token}
|
||||
raise BtcPayBtcPayError('%(code)d: %(message)s' % {'code': response.status_code, 'message': response.json()['error']})
|
||||
|
||||
def verify_invoice_params(self, price, currency):
|
||||
"""
|
||||
Deprecated, will be made private in 2.4
|
||||
|
Loading…
Reference in New Issue
Block a user