Skip to content

Commit a593da2

Browse files
author
Mikhail Pyrev
committed
Add models for Yandex.Money and QIWI
1 parent 44f6540 commit a593da2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

capitalist/models.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,39 @@ def get_payment_args(self):
154154
self.card_number, self.amount, self.currency, self.internal_id, self.destination, self.card_first_name,
155155
self.card_last_name, self.birthday_date, self.address, self.country_alpha2, self.city,
156156
self.card_expiration_month, self.card_expiration_year)
157+
158+
159+
class YandexMoneyPayment(BasePayment):
160+
__slots__ = ['number', 'amount', 'currency', 'internal_id', 'destination']
161+
162+
def __init__(self, number, amount, currency, internal_id, destination):
163+
self.number = number
164+
self.amount = amount
165+
self.currency = currency
166+
self.internal_id = internal_id
167+
self.destination = destination
168+
169+
def get_codename(self):
170+
return 'YANDEX'
171+
172+
def get_payment_args(self):
173+
args = [self.number, self.amount, self.currency, self.internal_id, self.destination]
174+
return [arg for arg in args if arg is not None]
175+
176+
177+
class QiwiPayment(BasePayment):
178+
__slots__ = ['number', 'amount', 'currency', 'internal_id', 'destination']
179+
180+
def __init__(self, number, amount, currency, internal_id, destination):
181+
self.number = number
182+
self.amount = amount
183+
self.currency = currency
184+
self.internal_id = internal_id
185+
self.destination = destination
186+
187+
def get_codename(self):
188+
return 'QIWI'
189+
190+
def get_payment_args(self):
191+
args = [self.number, self.amount, self.currency, self.internal_id, self.destination]
192+
return [arg for arg in args if arg is not None]

0 commit comments

Comments
 (0)