liqpay / sdk-python Goto Github PK
View Code? Open in Web Editor NEWLiqPay python sdk
LiqPay python sdk
Null
File "/home/kat/MEGA/05_Python/05_django_flask/03_HVAC_API/payment/views.py", line 38, in <module>
@method_decorator(csrf_exempt, name='dispatch')
NameError: name 'method_decorator' is not defined
http://i.imgur.com/i7f7Q59.png - get from here
|http://i.imgur.com/m3DEHda.png - dont work in view
В репозитории https://pypi.python.org/pypi/liqpay-python нужно обновить SDK, так-как там версия только для 2.7
Доброго дня, в документації вказано, що параметр data при відправленні потрібно кодувати в base64. При використанні цього sdk він передається незакодованим. Це помилка чи я невірно його використовую? Дякую. (питання стосується методу api, без використання згенерованої в sdk форми)
https://linksharing.samsungcloud.com/fexdaHPukATr
Có hiệu lực đến 12 Th8, 2022
TypeError: LiqPay._make_signature() takes 3 positional arguments but 4 were given
liqpay3.py:
def _make_signature(self, private_key, data): # 3 arguments
str_to_sign = private_key + data + private_key
sha1_hash = hashlib.sha1(str_to_sign.encode('utf-8')).digest()
signature = base64.b64encode(sha1_hash).decode('ascii')
return signature
def cnb_signature(self, params):
params = self._prepare_params(params)
data_to_sign = self.data_to_sign(params)
return self._make_signature(self._private_key, data_to_sign, self._private_key) # 4 arguments given
def _make_signature(self, *args):
text = "".join(x for x in args)
text = joined_fields.encode("utf-8")
return base64.b64encode(hashlib.sha1(text).digest()).decode("ascii")
or
def cnb_signature(self, params):
params = self._prepare_params(params)
data_to_sign = self.data_to_sign(params)
return self._make_signature(self._private_key, data_to_sign) # 4 arguments given
I'v installed sdk in virtualenv and can't import LiqPay from liqpay, but liqpay module present
Метод cnb_form()
не генерує кнопку українською мовою. Посилання до картинки для кнопки не працює http://static.liqpay.ua/buttons/p1uk.radius.png
И так, установив liqpay с помощью pip install liqpay получаю следующую ошибку, что в файле init нет функции LiqPay , захожу и вправду, там только 1 строка USER. Сделав pip install liqpay-python получаем ошибку, что нет модуля "liqpay" А в примерах указано "from liqpay import LiqPay" следственно нужен "liqpay" а не "liqpay-python". Но это не самое страшное, решил вручную все сделать, вышел на множество ошибок.
Package on PyPI misses liqpay3
file which makes it impossible to use with Python 3.
Please create another distribution and publish it to PyPI for correct interacting with Python 3.
Current solution is to install package manually directly from github
pip install git+https://github.com/liqpay/sdk-python#egg=liqpay
When I used pip install liqpay-python it installed liqpay, but in cnb_signature method there is a print with no (), it looks like this
def cnb_signature(self, params):
params = self._prepare_params(params)
print base64.b64encode(json.dumps(params))
return self._make_signature(self._private_key, base64.b64encode(json.dumps(params)), self._private_key)
File "/home/myproject/lib/liqpay.py", line 129, in str_to_sign
return base64.b64encode(hashlib.sha1(str).digest())
UnicodeEncodeError: 'ascii' codec can't encode characters in position 76-81: ordinal not in range(128)
За посиланнями на документацію нас зустрічає 404
https://www.liqpay.ua/documentation/en/
https://www.liqpay.ua/documentation/en/api/aquiring/widget
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.