gopaycommunity / gopay-python-api Goto Github PK
View Code? Open in Web Editor NEWGoPay's Python SDK for Payments REST API
Home Page: https://doc.gopay.com
License: MIT License
GoPay's Python SDK for Payments REST API
Home Page: https://doc.gopay.com
License: MIT License
Hi there,
I am getting this when executing the examples/get_status.py
:
(gopay-py3.10) ➜ gopay-python-api git:(master) ✗ python3 examples/get_status.py
> /gopay-python-api/gopay/__init__.py(27)payments()
-> config_model = GopayConfig.parse_obj(config)
(Pdb) config
{'goid': 'my goid', 'client_id': 'my id', 'client_secret': 'my secret', 'gateway_url': 'https://gw.sandbox.gopay.com/', 'scope': <TokenScope.ALL: 'payment-all'>, 'language': <Language.CZECH: 'CS'>}
(Pdb) GopayConfig.parse_obj(config)
*** pydantic.error_wrappers.ValidationError: 1 validation error for GopayConfig
goid
value is not a valid integer (type=type_error.integer)
(Pdb) c
Traceback (most recent call last):
File "/gopay-python-api/examples/get_status.py", line 4, in <module>
payments = gopay.payments(
File "/gopay-python-api/gopay/__init__.py", line 27, in payments
config_model = GopayConfig.parse_obj(config)
File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for GopayConfig
goid
value is not a valid integer (type=type_error.integer)
Am I missing something? Or we should replace goid
value with an integer?
Hi,
the method Payments.url_to_embedjs()
produces e.g. https://gate.gopay.cz/api/gp-gw/js/embed.js which is incorrect.
Correct url should be https://gate.gopay.cz/gp-gw/js/embed.js
This silently broke our systems.
Implementation of partial capture method
the python 3.5 pip install on Ubuntu 16.04 throws:
Collecting gopay==1.1.0 (from -r /home/merchang/code/requirements/base.txt (line 22))
Downloading gopay-1.1.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-qh0r3wdc/gopay/setup.py", line 2, in <module>
from pypandoc import convert
ImportError: No module named 'pypandoc'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qh0r3wdc/gopay/
Hi,
I receive the following error:
Downloading gopay-1.2.3.tar.gz
Storing download in cache at ./pip-cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2F85%2F42%2Fd90d0cc3236429117aa65f68aad698769cd6b6a51550d34bc7d7f051c668%2Fgopay-1.2.3.tar.gz
Running setup.py (path:/tmp/pip-build-50hlgr_q/gopay/setup.py) egg_info for package gopay
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip-build-50hlgr_q/gopay/setup.py", line 11, in
long_description=read('README.rst'),
File "/tmp/pip-build-50hlgr_q/gopay/setup.py", line 5, in read
return open(os.path.join(os.path.dirname(file), fname)).read()
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 99: ordinal not in range(128)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip-build-50hlgr_q/gopay/setup.py", line 11, in
long_description=read('README.rst'),
File "/tmp/pip-build-50hlgr_q/gopay/setup.py", line 5, in read
return open(os.path.join(os.path.dirname(file), fname)).read()
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 99: ordinal not in range(128)
This is caused by wrong setup of docker image default encoding. You can use docker run -e LANG=C.UTF-8
or in Dockerfile ENV LANG C.UTF-8
Calling get_embedjs_url
returns //gp-gw/js/embed.js
which is a non-sense.
Looking to the code of the method:
@property
def get_embedjs_url(self) -> str:
return self.gopay.base_url[-4] + "/gp-gw/js/embed.js"
It probably should be changed to:
@property
def get_embedjs_url(self) -> str:
return self.gopay.base_url[:-4] + "/gp-gw/js/embed.js"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.