diff --git a/LICENSE b/LICENSE index b2f9c4f..4f66848 100644 --- a/LICENSE +++ b/LICENSE @@ -1,14 +1,19 @@ +Copyright 2017 Joe Black -Copyright 2017 Jose Black + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. diff --git a/btcpay.egg-info/PKG-INFO b/btcpay.egg-info/PKG-INFO index 310e414..44d3cea 100644 --- a/btcpay.egg-info/PKG-INFO +++ b/btcpay.egg-info/PKG-INFO @@ -1,12 +1,13 @@ Metadata-Version: 1.1 Name: btcpay -Version: 1.0.0 +Version: 1.0.1 Summary: Accept bitcoin with BTCPay Home-page: https://github.com/joeblackwaslike/btcpay-python Author: Joe Black Author-email: me@joeblack.nyc License: Apache 2.0 -Download-URL: https://github.com/joeblackwaslike/btcpay-python/tarball/v1.0.0 +Download-URL: https://github.com/joeblackwaslike/btcpay-python/tarball/v1.0.1 +Description-Content-Type: UNKNOWN Description: UNKNOWN Keywords: bitcoin,payments,crypto Platform: UNKNOWN diff --git a/btcpay.egg-info/requires.txt b/btcpay.egg-info/requires.txt index 0fee4fc..517a4bd 100644 --- a/btcpay.egg-info/requires.txt +++ b/btcpay.egg-info/requires.txt @@ -1,2 +1,2 @@ -ecdsa requests +ecdsa diff --git a/build/lib/btcpay/client.py b/build/lib/btcpay/client.py index 7af33ac..c697e47 100644 --- a/build/lib/btcpay/client.py +++ b/build/lib/btcpay/client.py @@ -55,9 +55,9 @@ class BTCPayClient: uri = self.host + path if payload: payload = json.dumps(payload) - r = self.s.post(uri, headers=headers, data=payload) + r = self.s.post(uri, data=payload) else: - r = self.s.get(uri, headers=headers) + r = self.s.get(uri) r.raise_for_status() return r.json()['data'] @@ -85,10 +85,19 @@ class BTCPayClient: if re.match(r'^\w{7,7}$', code) is None: raise ValueError("pairing code is not legal") payload = {'id': self.client_id, 'pairingCode': code} - return self._unsigned_request('/tokens', payload) + data = self._unsigned_request('/tokens', payload) + data = data[0] + return { + data['facade']: data['token'] + } def __repr__(self): return '{}({})'.format( type(self).__name__, self.host ) + +# from btcpay import BTCPayClient +client = BTCPayClient(host=shop.gateway.client.uri, insecure=True, pem=shop.gateway.client.pem, tokens=shop.gateway.client.tokens) + +client = BTCPayClient(host=shop.gateway.client.uri, insecure=True, pem=shop.gateway.client.pem, tokens={'merchant': 'ET9rzVZUJLg9xnWo7pcjw32fPnqLj7KocfP3XyDptrCo'}) diff --git a/dist/btcpay-1.0.1-py3-none-any.whl b/dist/btcpay-1.0.1-py3-none-any.whl new file mode 100644 index 0000000..efb6e52 Binary files /dev/null and b/dist/btcpay-1.0.1-py3-none-any.whl differ diff --git a/dist/btcpay-1.0.1.tar.gz b/dist/btcpay-1.0.1.tar.gz new file mode 100644 index 0000000..70bf72c Binary files /dev/null and b/dist/btcpay-1.0.1.tar.gz differ diff --git a/setup.py b/setup.py index c0cb66c..d16efb7 100644 --- a/setup.py +++ b/setup.py @@ -4,13 +4,13 @@ from setuptools import setup, find_packages setup( name="btcpay", packages=find_packages(), - version="1.0.1", + version="1.0.2", description="Accept bitcoin with BTCPay", author="Joe Black", author_email="me@joeblack.nyc", url="https://github.com/joeblackwaslike/btcpay-python", - download_url="https://github.com/joeblackwaslike/btcpay-python/tarball/v1.0.1", - license='Apache 2.0', + download_url="https://github.com/joeblackwaslike/btcpay-python/tarball/v1.0.2", + license='MIT', keywords=["bitcoin", "payments", "crypto"], install_requires=[ "requests", @@ -24,7 +24,7 @@ setup( "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", + "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Office/Business :: Financial"