-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic methods v1.9 #13
base: master
Are you sure you want to change the base?
Conversation
Minimal update of current code to work on API 1.9. The module no longer works with API 1.7 due to a different hash function. * Use `SHA256` hashing function for signatures instead of the unsafe `SHA`. * Additional parameters for the API have been added to the `payment_init` function. But the function remains compatible with version 0.7.0. * Functions `oneclick_init` and `oneclick_start` removed. This means that the client implements only Basic Payment. Other payments methods, such as OneClick, will be added later. * Added HTTP return codes 401 and 503 to `HTTP_STATUSES`.
29dd926
to
e8495ff
Compare
Funkce |
e8495ff
to
9e0b027
Compare
I'm missing the update of RETURN_CODES as there was quite a few changes in 1.8 and 1.9 judging from changleog |
403: 'Forbidden', | ||
404: 'Not Found', | ||
405: 'Method Not Allowed', | ||
429: 'Too Many Requests', | ||
503: 'Service Unavailable' | ||
500: 'Internal Server Error', | ||
503: 'Service Unavailable', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this HTTP_STATUSES
variable used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is not in use anywhere yet.
pycsob/client.py
Outdated
@@ -71,9 +68,10 @@ def payment_init(self, order_no, total_amount, return_url, description, cart=Non | |||
:param total_amount: | |||
:param return_url: URL to be returned to from payment gateway | |||
:param cart: items in cart, currently min one item, max two as mentioned in CSOB spec | |||
:param description: order description | |||
:param description: product name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add that it's only used for the cart item name if cart is emtpy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be changelog entry with incompatible and other changes/migration guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring and Changelog have been updated.
'PyscobSession' -> 'PycsobSession' (as CSOB is the bank name)
'payment/init' request: 'payOperation' with value 'customPayment' and 'customExpiry' items already supported 'payment/init' response: add 'customerCode' item
24a7854
to
e13dbc9
Compare
e13dbc9
to
d989faf
Compare
* Sign properly complex data Compose message from input data for signing accounting for nested sequences and mappings. * fixup - Correction from code review * fixup - Fix typo * fixup - Fix typo in docstring * fixup - Code review (round 2) * fixup - Add docs comment to enums * fixup - Unnecessary trimming * fixup - strip after trimming * Correction from review - round 3 * fixup - Corrections from review (round 4) * fixup - Change date/time related fields * fixup - Custom formatting should have higher priority * fixup - Add docstrings * Improve type annotations * Use all amounts always as integers * fixup - README and type annotation * fixup - Add enumerations * Remove Python 3.8
Minimální aktualizace současného kódu tak, aby fungoval na API 1.9.
Modul kvůli jiné hešovací funkci již nefunguje s API 1.7.
Aktualizace zahrnuje komit z PR #10 opravující zavírání otevřených souborů. Dále zahrnuje PR #11 pro logování komunikace s API.
SHA256
místo původníSHA
.payment_init
doplněny další paramerty pro API. Funkce ale zůstává kompatibilní s verzí 0.7.0.oneclick_init
aoneclick_start
odstraněny. Tím je klient uzpůsoben jen k základním metodám. Jiné metody, jako je OneClick, se budou se řešit později.HTTP_STATUSES
doplněny HTTP návratové kódy 401 a 503.Minimal update of current code to work on API 1.9.
The module no longer works with API 1.7 due to a different hash function.
The update includes a commit from PR #10 fixing the closing of open files. It also includes PR #11 for logging communication with the API.
SHA256
hashing function for signatures instead of the unsafeSHA
.payment_init
function. But the function remains compatible with version 0.7.0.oneclick_init
andoneclick_start
removed. This means that the client implements only Basic Payment. Other payments methods, such as OneClick, will be added later.HTTP_STATUSES
.