Skip to content

Commit

Permalink
Add extra param for non credit cards (#2)
Browse files Browse the repository at this point in the history
* Add extra param for non credit cards

* Don't remove expirity fields when non-credit cards are used

* Update version
  • Loading branch information
bertini36 authored Mar 8, 2021
1 parent ce63f94 commit 85895ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion datatrans/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.0.8'
__version__ = '1.0.9'
__copyright__ = 'Copyright (c) 2017, skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-datatrans-gateway'
6 changes: 6 additions & 0 deletions datatrans/gateway/payment_with_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ def build_pay_with_alias_request_xml(amount: Money, client_ref: str, alias_regis
SubElement(request, 'reqtype').text = 'CAA'
SubElement(request, 'sign').text = sign_mpo(merchant_id, amount, currency, client_ref)

# For non credit card payment methods who support the creation of an alias
# the <pmethod> attribute needs to be submitted
# https://api-reference.datatrans.ch/xml/#authorization-with-an-existing-alias
if alias_registration.payment_method in ('REK',):
SubElement(request, 'pmethod').text = alias_registration.payment_method

return tostring(root, encoding='utf8')


Expand Down

0 comments on commit 85895ff

Please sign in to comment.