-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from yoomoney/release/v2.3.0
Release/2.3.0
- Loading branch information
Showing
7 changed files
with
33 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
__author__ = "YooMoney" | ||
__email__ = 'cms@yoomoney.ru' | ||
__version__ = '2.2.0' | ||
__version__ = '2.3.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 1 addition & 26 deletions
27
src/yookassa_payout/domain/request/make_deposition_request.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
from yookassa_payout.domain.models.recipients.recipient import Recipient | ||
from yookassa_payout.domain.models.recipients.recipient_factory import RecipientFactory | ||
from yookassa_payout.domain.request.deposition_request import DepositionRequest | ||
|
||
|
||
class MakeDepositionRequest(DepositionRequest): | ||
|
||
__payment_params = None | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(MakeDepositionRequest, self).__init__(*args, **kwargs) | ||
self.request_name = 'makeDeposition' | ||
|
||
@property | ||
def payment_params(self): | ||
return self.__payment_params | ||
|
||
@payment_params.setter | ||
def payment_params(self, value): | ||
if isinstance(value, Recipient): | ||
self.__payment_params = value | ||
elif isinstance(value, dict): | ||
self.__payment_params = RecipientFactory.factory(value) | ||
else: | ||
raise TypeError('Invalid payment_params value type') | ||
|
||
def validate(self): | ||
super(MakeDepositionRequest, self).validate() | ||
if not self.payment_params: | ||
self.set_validation_error('Deposition payment_params not specified') | ||
|
||
def map(self): | ||
self.validate() | ||
_map = super(MakeDepositionRequest, self).map() | ||
if self.payment_params: | ||
_map.update({ | ||
"paymentParams": self.payment_params.map() | ||
}) | ||
return {self.request_name + 'Request': _map} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters