Skip to content

Commit 5f04810

Browse files
author
Mikhail Pyrev
committedFeb 2, 2021
Update CardRussianPayment
1 parent 2a93378 commit 5f04810

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ __pycache__/
55
*.sqlite3
66
local_settings.py
77
*.egg-info/
8+
.python-version

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
## 1.3.0
4+
* Fields `first_name` and `last_name` added to `CardRussianPayment` model

‎capitalist/models.py

+20-5
Original file line numberDiff line numberDiff line change
@@ -102,28 +102,43 @@ def get_payment_args(self):
102102

103103

104104
class CardRussianPayment(BasePayment):
105-
__slots__ = ['card_number', 'amount', 'currency', 'internal_id', 'destination']
105+
__slots__ = ['card_number', 'amount', 'currency', 'internal_id', 'destination', 'first_name', 'last_name']
106106

107-
def __init__(self, card_number, amount, currency, internal_id, destination):
107+
def __init__(self, card_number, amount, currency, internal_id, destination, first_name, last_name):
108108
self.card_number = card_number
109109
self.amount = amount
110110
self.currency = currency
111111
self.internal_id = internal_id
112112
self.destination = destination
113+
self.first_name = first_name
114+
self.last_name = last_name
113115

114116
def get_codename(self):
115117
return 'RUCARD'
116118

117119
def get_payment_args(self):
118-
args = [self.card_number, self.amount, self.currency, self.internal_id, self.destination]
120+
args = [self.card_number, self.amount, self.currency, self.internal_id, self.destination, self.first_name,
121+
self.last_name]
119122
return [arg for arg in args if arg is not None]
120123

121124

122-
# Deprecated
123-
class CardUkrainianPayment(CardRussianPayment):
125+
class CardUkrainianPayment(BasePayment):
126+
__slots__ = ['card_number', 'amount', 'currency', 'internal_id', 'destination']
127+
128+
def __init__(self, card_number, amount, currency, internal_id, destination):
129+
self.card_number = card_number
130+
self.amount = amount
131+
self.currency = currency
132+
self.internal_id = internal_id
133+
self.destination = destination
134+
124135
def get_codename(self):
125136
return 'UKRCARD'
126137

138+
def get_payment_args(self):
139+
args = [self.card_number, self.amount, self.currency, self.internal_id, self.destination]
140+
return [arg for arg in args if arg is not None]
141+
127142

128143
class CardWorldwidePayment(BasePayment):
129144
__slots__ = [

‎setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# For a discussion on single-sourcing the version across setup.py and the
4444
# project code, see
4545
# https://packaging.python.org/en/latest/single_source_version.html
46-
version='1.2.4', # Required
46+
version='1.3.0', # Required
4747

4848
# This is a one-line description or tagline of what your project does. This
4949
# corresponds to the "Summary" metadata field:

0 commit comments

Comments
 (0)
Please sign in to comment.