remove broken unneeded code from bitpay

This commit is contained in:
forest 2020-05-15 18:25:22 -05:00
parent e9dcf80f6c
commit 2bfd3787e9

View File

@ -13,24 +13,6 @@ class Client:
self.tokens = tokens self.tokens = tokens
self.user_agent = 'bitpay-python' 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): def create_invoice(self, params):
self.verify_invoice_params(params['price'], params['currency']) self.verify_invoice_params(params['price'], params['currency'])
payload = json.dumps(params) payload = json.dumps(params)
@ -77,15 +59,6 @@ class Client:
return False return False
return True 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): def verify_invoice_params(self, price, currency):
""" """
Deprecated, will be made private in 2.4 Deprecated, will be made private in 2.4