mangopay4-python-sdk 3.56.0__tar.gz → 3.57.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/PKG-INFO +1 -1
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/constants.py +2 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/fields.py +22 -1
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/resources.py +372 -7
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/utils.py +16 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay4_python_sdk.egg-info/PKG-INFO +1 -1
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/setup.py +1 -1
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_base.py +46 -2
- mangopay4_python_sdk-3.57.0/tests/test_deposits.py +162 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_kyc_document.py +2 -2
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_notifications.py +9 -4
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_payins.py +240 -109
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_payouts.py +3 -1
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_preauthorizations.py +2 -1
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_recipients.py +2 -2
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_reports_v2.py +12 -0
- mangopay4_python_sdk-3.56.0/tests/test_deposits.py +0 -70
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/DESCRIPTION.md +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/LICENSE +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/MANIFEST.in +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/Makefile +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/README.md +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/__init__.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/api.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/auth.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/base.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/compat.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/exceptions.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/page.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/query.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/ratelimit.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay/signals.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay4_python_sdk.egg-info/SOURCES.txt +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay4_python_sdk.egg-info/dependency_links.txt +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay4_python_sdk.egg-info/entry_points.txt +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay4_python_sdk.egg-info/requires.txt +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/mangopay4_python_sdk.egg-info/top_level.txt +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/setup.cfg +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/__init__.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/card.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/cardregistrations.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/cardregistrations_update.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/declarative_user.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/legal_user.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/legal_user_wallet.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/legal_user_wallet_89.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/legal_user_wallet_99.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/list_ubo_declarations.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/natural_user.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/natural_user_wallet.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/natural_user_wallet_9.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/ubo.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/ubo_declaration.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/ubo_declaration_submit.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/ubo_update.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/user_list_2_per_page.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/user_list_2_per_page_page1.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/user_list_3_per_page_page2.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/user_list_full.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/user_list_page1.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/fixtures/user_wallet.json +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/images/image.jpg +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/mocks.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/resources/TestKycPageFile.png +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/resources/settlement_sample.csv +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/resources/settlement_sample_bad.csv +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/resources.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/settings.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_acquiring.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_bankaccounts.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_banking_aliases.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_cards.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_client_wallets.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_clients.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_conversion.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_country_authorizations.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_disputes.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_documentconsult.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_emoney.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_idempotency.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_identity_verification.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_kycs.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_mandates.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_rate_limit.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_refunds.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_reports.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_repudiations.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_settlements.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_tokens.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_transactions.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_transfers.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_ubos.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_users.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_utils.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_virtual_account.py +0 -0
- {mangopay4_python_sdk-3.56.0 → mangopay4_python_sdk-3.57.0}/tests/test_wallets.py +0 -0
|
@@ -389,6 +389,8 @@ PAYIN_PAYMENT_TYPE = Choices(
|
|
|
389
389
|
RECURRING_PAYIN_REGISTRATION_PAYMENT_TYPE = Choices(
|
|
390
390
|
("CARD_DIRECT", "card_direct", "Card Direct"),
|
|
391
391
|
("PAYPAL", "paypal", "PayPal"),
|
|
392
|
+
("APPLEPAY", "applepay", "ApplePay"),
|
|
393
|
+
("GOOGLEPAY", "googlepay", "GooglePay")
|
|
392
394
|
)
|
|
393
395
|
|
|
394
396
|
CARD_STATUS_CHOICES = Choices(
|
|
@@ -15,7 +15,7 @@ from .utils import timestamp_from_datetime, timestamp_from_date, Money, DebitedB
|
|
|
15
15
|
BusinessRecipient, RecipientPropertySchema, IndividualRecipientPropertySchema, BusinessRecipientPropertySchema, \
|
|
16
16
|
CompanyNumberValidation, ReportFilter, PayInIntentExternalData, PayInIntentBuyer, SupportedBank, \
|
|
17
17
|
VerificationOfPayee, PayInIntentRefund, PayInIntentCapture, PayInIntentDispute, CustomFees, MarginsResponse, \
|
|
18
|
-
UserMargin, ConsentScope, AuthenticationResult
|
|
18
|
+
UserMargin, ConsentScope, AuthenticationResult, FlowDescriptor
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class FieldDescriptor(object):
|
|
@@ -1523,4 +1523,25 @@ class AuthenticationResultField(Field):
|
|
|
1523
1523
|
result['AuthenticationType'] = value.authentication_type
|
|
1524
1524
|
return result
|
|
1525
1525
|
|
|
1526
|
+
return value
|
|
1527
|
+
|
|
1528
|
+
|
|
1529
|
+
class FlowDescriptorField(Field):
|
|
1530
|
+
def python_value(self, value):
|
|
1531
|
+
if value is not None:
|
|
1532
|
+
return FlowDescriptor(flow_id=value.get('FlowId', None), beneficiaries=value.get('Beneficiaries', None))
|
|
1533
|
+
|
|
1534
|
+
return value
|
|
1535
|
+
|
|
1536
|
+
def api_value(self, value):
|
|
1537
|
+
value = super(FlowDescriptorField, self).api_value(value)
|
|
1538
|
+
|
|
1539
|
+
if isinstance(value, FlowDescriptor):
|
|
1540
|
+
result = {}
|
|
1541
|
+
if value.flow_id is not None:
|
|
1542
|
+
result['FlowId'] = value.flow_id
|
|
1543
|
+
if value.beneficiaries is not None:
|
|
1544
|
+
result['Beneficiaries'] = value.beneficiaries
|
|
1545
|
+
return result
|
|
1546
|
+
|
|
1526
1547
|
return value
|
|
@@ -21,7 +21,8 @@ from .fields import (PrimaryKeyField, EmailField, CharField,
|
|
|
21
21
|
BusinessRecipientPropertySchemaField, CompanyNumberValidationField, ReportFilterField,
|
|
22
22
|
PayInIntentExternalDataField, PayInIntentBuyerField, SupportedBanksField, VerificationOfPayeeField,
|
|
23
23
|
PayInIntentRefundField, PayInIntentCaptureField, PayInIntentDisputeField, CustomFeesField,
|
|
24
|
-
UserMarginField, MarginsResponseField, ConsentScopeField, AuthenticationResultField
|
|
24
|
+
UserMarginField, MarginsResponseField, ConsentScopeField, AuthenticationResultField,
|
|
25
|
+
FlowDescriptorField)
|
|
25
26
|
from .query import InsertQuery, UpdateQuery, SelectQuery, ActionQuery, DeleteQuery
|
|
26
27
|
|
|
27
28
|
|
|
@@ -872,6 +873,7 @@ class PayIn(BaseModel):
|
|
|
872
873
|
execution_type = CharField(api_name='ExecutionType', choices=constants.EXECUTION_TYPE_CHOICES, default=None)
|
|
873
874
|
profiling_attempt_reference = CharField(api_name='ProfilingAttemptReference')
|
|
874
875
|
authentication_result = AuthenticationResultField(api_name='AuthenticationResult')
|
|
876
|
+
flow_descriptor = FlowDescriptorField(api_name='FlowDescriptor')
|
|
875
877
|
|
|
876
878
|
def get_refunds(self, *args, **kwargs):
|
|
877
879
|
kwargs['id'] = self.id
|
|
@@ -902,6 +904,18 @@ class PayIn(BaseModel):
|
|
|
902
904
|
if cls.__name__ == "RecurringPayPalPayInMIT":
|
|
903
905
|
return RecurringPayPalPayInMIT
|
|
904
906
|
|
|
907
|
+
if cls.__name__ == "RecurringPayPalPayIn":
|
|
908
|
+
return RecurringPayPalPayIn
|
|
909
|
+
|
|
910
|
+
if cls.__name__ == "RecurringCardPayIn":
|
|
911
|
+
return RecurringCardPayIn
|
|
912
|
+
|
|
913
|
+
if cls.__name__ == "RecurringApplePayPayIn":
|
|
914
|
+
return RecurringApplePayPayIn
|
|
915
|
+
|
|
916
|
+
if cls.__name__ == "RecurringGooglePayPayIn":
|
|
917
|
+
return RecurringGooglePayPayIn
|
|
918
|
+
|
|
905
919
|
payment_type = result.get('PaymentType')
|
|
906
920
|
execution_type = result.get('ExecutionType')
|
|
907
921
|
|
|
@@ -934,14 +948,14 @@ class PayIn(BaseModel):
|
|
|
934
948
|
|
|
935
949
|
@python_2_unicode_compatible
|
|
936
950
|
class RecurringPayInRegistration(BaseModel):
|
|
937
|
-
author = ForeignKeyField(User, api_name='AuthorId'
|
|
951
|
+
author = ForeignKeyField(User, api_name='AuthorId')
|
|
938
952
|
card = ForeignKeyField(Card, api_name='CardId')
|
|
939
953
|
user = ForeignKeyField(User, api_name='CreditedUserId')
|
|
940
954
|
credited_wallet = ForeignKeyField(Wallet, api_name='CreditedWalletId')
|
|
941
|
-
first_transaction_debited_funds = MoneyField(api_name='FirstTransactionDebitedFunds'
|
|
942
|
-
first_transaction_fees = MoneyField(api_name='FirstTransactionFees'
|
|
943
|
-
billing = BillingField(api_name='Billing'
|
|
944
|
-
shipping = ShippingField(api_name='Shipping'
|
|
955
|
+
first_transaction_debited_funds = MoneyField(api_name='FirstTransactionDebitedFunds')
|
|
956
|
+
first_transaction_fees = MoneyField(api_name='FirstTransactionFees')
|
|
957
|
+
billing = BillingField(api_name='Billing')
|
|
958
|
+
shipping = ShippingField(api_name='Shipping')
|
|
945
959
|
end_date = DateField(api_name='EndDate')
|
|
946
960
|
frequency = CharField(api_name='Frequency')
|
|
947
961
|
fixed_next_amount = BooleanField(api_name='FixedNextAmount')
|
|
@@ -949,7 +963,7 @@ class RecurringPayInRegistration(BaseModel):
|
|
|
949
963
|
migration = BooleanField(api_name='Migration')
|
|
950
964
|
next_transaction_debited_funds = MoneyField(api_name='NextTransactionDebitedFunds')
|
|
951
965
|
next_transaction_fees = MoneyField(api_name='NextTransactionFees')
|
|
952
|
-
free_cycles = IntegerField(api_name='FreeCycles'
|
|
966
|
+
free_cycles = IntegerField(api_name='FreeCycles')
|
|
953
967
|
cycle_number = IntegerField(api_name='CycleNumber')
|
|
954
968
|
total_amount = MoneyField(api_name='TotalAmount')
|
|
955
969
|
recurring_type = CharField(api_name='RecurringType')
|
|
@@ -957,6 +971,8 @@ class RecurringPayInRegistration(BaseModel):
|
|
|
957
971
|
status = CharField(api_name='Status', choices=constants.STATUS_CHOICES, default=None)
|
|
958
972
|
payment_type = CharField(api_name='PaymentType', choices=constants.RECURRING_PAYIN_REGISTRATION_PAYMENT_TYPE,
|
|
959
973
|
default=None)
|
|
974
|
+
profiling_attempt_reference = CharField(api_name='ProfilingAttemptReference')
|
|
975
|
+
flow_descriptor = FlowDescriptorField(api_name='FlowDescriptor')
|
|
960
976
|
|
|
961
977
|
def get_read_only_properties(self):
|
|
962
978
|
read_only = ["Id", "FreeCycles", "CycleNumber", "TotalAmount", "RecurringType", "Status", "CurrentState"]
|
|
@@ -972,8 +988,36 @@ class RecurringPayInRegistration(BaseModel):
|
|
|
972
988
|
}
|
|
973
989
|
|
|
974
990
|
|
|
991
|
+
@python_2_unicode_compatible
|
|
992
|
+
class RecurringApplePayPayInRegistration(RecurringPayInRegistration):
|
|
993
|
+
payment_data = ApplepayPaymentDataField(api_name='PaymentData', required=True)
|
|
994
|
+
|
|
995
|
+
class Meta:
|
|
996
|
+
url = {
|
|
997
|
+
InsertQuery.identifier: '/recurringpayinregistrations',
|
|
998
|
+
SelectQuery.identifier: '/recurringpayinregistrations',
|
|
999
|
+
UpdateQuery.identifier: '/recurringpayinregistrations'
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
@python_2_unicode_compatible
|
|
1004
|
+
class RecurringGooglePayPayInRegistration(RecurringPayInRegistration):
|
|
1005
|
+
payment_data = CharField(api_name='PaymentData', required=True)
|
|
1006
|
+
|
|
1007
|
+
class Meta:
|
|
1008
|
+
url = {
|
|
1009
|
+
InsertQuery.identifier: '/recurringpayinregistrations',
|
|
1010
|
+
SelectQuery.identifier: '/recurringpayinregistrations',
|
|
1011
|
+
UpdateQuery.identifier: '/recurringpayinregistrations'
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
|
|
975
1015
|
@python_2_unicode_compatible
|
|
976
1016
|
class RecurringPayInCIT(PayIn):
|
|
1017
|
+
"""
|
|
1018
|
+
.. deprecated::
|
|
1019
|
+
Use :class:`RecurringCardPayIn` instead.
|
|
1020
|
+
"""
|
|
977
1021
|
recurring_payin_registration_id = CharField(api_name='RecurringPayinRegistrationId', required=True)
|
|
978
1022
|
browser_info = BrowserInfoField(api_name='BrowserInfo', required=True)
|
|
979
1023
|
ip_address = CharField(api_name='IpAddress', required=True)
|
|
@@ -1012,6 +1056,10 @@ class RecurringPayInCIT(PayIn):
|
|
|
1012
1056
|
|
|
1013
1057
|
@python_2_unicode_compatible
|
|
1014
1058
|
class RecurringPayInMIT(PayIn):
|
|
1059
|
+
"""
|
|
1060
|
+
.. deprecated::
|
|
1061
|
+
Use :class:`RecurringCardPayIn` instead.
|
|
1062
|
+
"""
|
|
1015
1063
|
recurring_payin_registration_id = CharField(api_name='RecurringPayinRegistrationId', required=True)
|
|
1016
1064
|
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
1017
1065
|
fees = MoneyField(api_name='Fees')
|
|
@@ -1049,8 +1097,47 @@ class RecurringPayInMIT(PayIn):
|
|
|
1049
1097
|
}
|
|
1050
1098
|
|
|
1051
1099
|
|
|
1100
|
+
@python_2_unicode_compatible
|
|
1101
|
+
class RecurringCardPayIn(PayIn):
|
|
1102
|
+
recurring_payin_registration_id = CharField(api_name='RecurringPayinRegistrationId', required=True)
|
|
1103
|
+
browser_info = BrowserInfoField(api_name='BrowserInfo')
|
|
1104
|
+
ip_address = CharField(api_name='IpAddress')
|
|
1105
|
+
preferred_card_network = CharField(api_name='PreferredCardNetwork')
|
|
1106
|
+
secure_mode_return_url = CharField(api_name='SecureModeReturnURL')
|
|
1107
|
+
statement_descriptor = CharField(api_name='StatementDescriptor')
|
|
1108
|
+
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
1109
|
+
fees = MoneyField(api_name='Fees')
|
|
1110
|
+
requested_3ds_version = CharField(api_name='Requested3DSVersion')
|
|
1111
|
+
applied_3ds_version = CharField(api_name='Applied3DSVersion')
|
|
1112
|
+
author = ForeignKeyField(User, api_name='AuthorId')
|
|
1113
|
+
billing = BillingField(api_name='Billing')
|
|
1114
|
+
card = ForeignKeyField(Card, api_name='CardId')
|
|
1115
|
+
creation_date = DateTimeField(api_name='CreationDate')
|
|
1116
|
+
culture = CharField(api_name='Culture')
|
|
1117
|
+
secure_mode_needed = BooleanField(api_name='SecureModeNeeded')
|
|
1118
|
+
secure_mode = CharField(api_name='SecureMode',
|
|
1119
|
+
choices=constants.SECURE_MODE_CHOICES)
|
|
1120
|
+
secure_mode_redirect_url = CharField(api_name='SecureModeRedirectURL')
|
|
1121
|
+
security_info = SecurityInfoField(api_name='SecurityInfo')
|
|
1122
|
+
shipping = ShippingField(api_name='Shipping')
|
|
1123
|
+
card_info = CardInfoField(api_name='CardInfo')
|
|
1124
|
+
payment_category = CharField(api_name='PaymentCategory')
|
|
1125
|
+
|
|
1126
|
+
class Meta:
|
|
1127
|
+
verbose_name = 'recurring_card_payin'
|
|
1128
|
+
verbose_name_plural = 'recurring_card_payins'
|
|
1129
|
+
url = {
|
|
1130
|
+
InsertQuery.identifier: '/payins/recurring/card/direct',
|
|
1131
|
+
SelectQuery.identifier: '/payins'
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
|
|
1052
1135
|
@python_2_unicode_compatible
|
|
1053
1136
|
class RecurringPayPalPayInCIT(PayIn):
|
|
1137
|
+
"""
|
|
1138
|
+
.. deprecated::
|
|
1139
|
+
Use :class:`RecurringPayPalPayIn` instead.
|
|
1140
|
+
"""
|
|
1054
1141
|
creation_date = DateTimeField(api_name='CreationDate')
|
|
1055
1142
|
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
1056
1143
|
fees = MoneyField(api_name='Fees')
|
|
@@ -1087,6 +1174,10 @@ class RecurringPayPalPayInCIT(PayIn):
|
|
|
1087
1174
|
|
|
1088
1175
|
@python_2_unicode_compatible
|
|
1089
1176
|
class RecurringPayPalPayInMIT(PayIn):
|
|
1177
|
+
"""
|
|
1178
|
+
.. deprecated::
|
|
1179
|
+
Use :class:`RecurringPayPalPayIn` instead.
|
|
1180
|
+
"""
|
|
1090
1181
|
creation_date = DateTimeField(api_name='CreationDate')
|
|
1091
1182
|
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
1092
1183
|
fees = MoneyField(api_name='Fees')
|
|
@@ -1121,6 +1212,95 @@ class RecurringPayPalPayInMIT(PayIn):
|
|
|
1121
1212
|
}
|
|
1122
1213
|
|
|
1123
1214
|
|
|
1215
|
+
@python_2_unicode_compatible
|
|
1216
|
+
class RecurringPayPalPayIn(PayIn):
|
|
1217
|
+
recurring_payin_registration_id = CharField(api_name='RecurringPayinRegistrationId', required=True)
|
|
1218
|
+
return_url = CharField(api_name='ReturnURL', required=True)
|
|
1219
|
+
line_items = ListField(api_name='LineItems', required=True)
|
|
1220
|
+
creation_date = DateTimeField(api_name='CreationDate')
|
|
1221
|
+
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
1222
|
+
fees = MoneyField(api_name='Fees')
|
|
1223
|
+
author = ForeignKeyField(User, api_name='AuthorId')
|
|
1224
|
+
redirect_url = CharField(api_name='RedirectURL')
|
|
1225
|
+
statement_descriptor = CharField(api_name='StatementDescriptor')
|
|
1226
|
+
shipping = ShippingField(api_name='Shipping')
|
|
1227
|
+
culture = CharField(api_name='Culture')
|
|
1228
|
+
shipping_preference = CharField(api_name='ShippingPreference', choices=constants.SHIPPING_PREFERENCE_CHOICES,
|
|
1229
|
+
default=None)
|
|
1230
|
+
buyer_account_email = CharField(api_name="PaypalBuyerAccountEmail")
|
|
1231
|
+
reference = CharField(api_name='Reference')
|
|
1232
|
+
trackings = ListField(api_name='Trackings')
|
|
1233
|
+
cancel_url = CharField(api_name='CancelURL')
|
|
1234
|
+
paypal_order_id = CharField(api_name='PaypalOrderID')
|
|
1235
|
+
buyer_country = CharField(api_name='BuyerCountry')
|
|
1236
|
+
buyer_first_name = CharField(api_name='BuyerFirstname')
|
|
1237
|
+
buyer_last_name = CharField(api_name='BuyerLastname')
|
|
1238
|
+
buyer_phone = CharField(api_name='BuyerPhone')
|
|
1239
|
+
paypal_payer_id = CharField(api_name='PaypalPayerID')
|
|
1240
|
+
data_collection_id = CharField(api_name='DataCollectionId')
|
|
1241
|
+
|
|
1242
|
+
class Meta:
|
|
1243
|
+
verbose_name = 'recurring_paypal_payin'
|
|
1244
|
+
verbose_name_plural = 'recurring_paypal_payins'
|
|
1245
|
+
url = {
|
|
1246
|
+
InsertQuery.identifier: '/payins/payment-methods/paypal/recurring',
|
|
1247
|
+
SelectQuery.identifier: '/payins'
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
@python_2_unicode_compatible
|
|
1252
|
+
class RecurringApplePayPayIn(PayIn):
|
|
1253
|
+
recurring_payin_registration_id = CharField(api_name='RecurringPayinRegistrationId', required=True)
|
|
1254
|
+
payment_data = ApplepayPaymentDataField(api_name='PaymentData', required=True)
|
|
1255
|
+
creation_date = DateTimeField(api_name='CreationDate')
|
|
1256
|
+
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
1257
|
+
fees = MoneyField(api_name='Fees')
|
|
1258
|
+
author = ForeignKeyField(User, api_name='AuthorId')
|
|
1259
|
+
statement_descriptor = CharField(api_name='StatementDescriptor')
|
|
1260
|
+
shipping = ShippingField(api_name='Shipping')
|
|
1261
|
+
billing = BillingField(api_name='Billing')
|
|
1262
|
+
security_info = SecurityInfoField(api_name='SecurityInfo')
|
|
1263
|
+
card_info = CardInfoField(api_name='CardInfo')
|
|
1264
|
+
|
|
1265
|
+
class Meta:
|
|
1266
|
+
verbose_name = 'recurring_applepay_payin'
|
|
1267
|
+
verbose_name_plural = 'recurring_applepay_payins'
|
|
1268
|
+
url = {
|
|
1269
|
+
InsertQuery.identifier: '/payins/payment-methods/applepay/recurring',
|
|
1270
|
+
SelectQuery.identifier: '/payins'
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
|
|
1274
|
+
@python_2_unicode_compatible
|
|
1275
|
+
class RecurringGooglePayPayIn(PayIn):
|
|
1276
|
+
recurring_payin_registration_id = CharField(api_name='RecurringPayinRegistrationId', required=True)
|
|
1277
|
+
payment_data = CharField(api_name='PaymentData', required=True)
|
|
1278
|
+
creation_date = DateTimeField(api_name='CreationDate')
|
|
1279
|
+
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
1280
|
+
fees = MoneyField(api_name='Fees')
|
|
1281
|
+
author = ForeignKeyField(User, api_name='AuthorId')
|
|
1282
|
+
statement_descriptor = CharField(api_name='StatementDescriptor')
|
|
1283
|
+
shipping = ShippingField(api_name='Shipping')
|
|
1284
|
+
billing = BillingField(api_name='Billing')
|
|
1285
|
+
security_info = SecurityInfoField(api_name='SecurityInfo')
|
|
1286
|
+
secure_mode_return_url = CharField(api_name='SecureModeReturnURL')
|
|
1287
|
+
secure_mode = CharField(api_name='SecureMode',
|
|
1288
|
+
choices=constants.SECURE_MODE_CHOICES,
|
|
1289
|
+
default=constants.SECURE_MODE_CHOICES.default)
|
|
1290
|
+
ip_address = CharField(api_name='IpAddress')
|
|
1291
|
+
browser_info = BrowserInfoField(api_name='BrowserInfo')
|
|
1292
|
+
card_info = CardInfoField(api_name='CardInfo')
|
|
1293
|
+
return_url = CharField(api_name='ReturnURL')
|
|
1294
|
+
|
|
1295
|
+
class Meta:
|
|
1296
|
+
verbose_name = 'recurring_googlepay_payin'
|
|
1297
|
+
verbose_name_plural = 'recurring_googlepay_payins'
|
|
1298
|
+
url = {
|
|
1299
|
+
InsertQuery.identifier: '/payins/payment-methods/googlepay/recurring',
|
|
1300
|
+
SelectQuery.identifier: '/payins'
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
|
|
1124
1304
|
@python_2_unicode_compatible
|
|
1125
1305
|
class DirectPayIn(PayIn):
|
|
1126
1306
|
author = ForeignKeyField(User, api_name='AuthorId', required=True)
|
|
@@ -1651,6 +1831,11 @@ class DirectDebitDirectPayIn(PayIn):
|
|
|
1651
1831
|
|
|
1652
1832
|
|
|
1653
1833
|
class CardPreAuthorizedDepositPayIn(BaseModel):
|
|
1834
|
+
"""
|
|
1835
|
+
.. deprecated::
|
|
1836
|
+
Use :class:`PreAuthorizedDepositPayIn` instead. Kept unchanged for backward
|
|
1837
|
+
compatibility; will be removed in a future major version.
|
|
1838
|
+
"""
|
|
1654
1839
|
author_id = CharField(api_name='AuthorId')
|
|
1655
1840
|
credited_wallet_id = CharField(api_name='CreditedWalletId')
|
|
1656
1841
|
deposit_id = CharField(api_name='DepositId')
|
|
@@ -1697,6 +1882,57 @@ class CardPreAuthorizedDepositPayIn(BaseModel):
|
|
|
1697
1882
|
return insert.execute()
|
|
1698
1883
|
|
|
1699
1884
|
|
|
1885
|
+
class PreAuthorizedDepositPayIn(BaseModel):
|
|
1886
|
+
author_id = CharField(api_name='AuthorId')
|
|
1887
|
+
credited_user_id = CharField(api_name='CreditedUserId')
|
|
1888
|
+
credited_wallet_id = CharField(api_name='CreditedWalletId')
|
|
1889
|
+
deposit_id = CharField(api_name='DepositId')
|
|
1890
|
+
creation_date = DateTimeField(api_name='CreationDate')
|
|
1891
|
+
result_code = CharField(api_name='ResultCode')
|
|
1892
|
+
result_message = CharField(api_name='ResultMessage')
|
|
1893
|
+
status = CharField(api_name='Status', choices=constants.STATUS_CHOICES, default=None)
|
|
1894
|
+
execution_date = DateTimeField(api_name='ExecutionDate')
|
|
1895
|
+
type = CharField(api_name='Type', choices=constants.TRANSACTION_TYPE_CHOICES, default=None)
|
|
1896
|
+
nature = CharField(api_name='Nature', choices=constants.NATURE_CHOICES, default=None)
|
|
1897
|
+
payment_type = CharField(api_name='PaymentType', choices=constants.PAYIN_PAYMENT_TYPE, default=None)
|
|
1898
|
+
execution_type = CharField(api_name='ExecutionType', choices=constants.EXECUTION_TYPE_CHOICES, default=None)
|
|
1899
|
+
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
1900
|
+
credited_funds = MoneyField(api_name='CreditedFunds')
|
|
1901
|
+
fees = MoneyField(api_name='Fees')
|
|
1902
|
+
card_info = CardInfoField(api_name='CardInfo')
|
|
1903
|
+
authentication_result = AuthenticationResultField(api_name='AuthenticationResult')
|
|
1904
|
+
statement_descriptor = CharField(api_name='StatementDescriptor')
|
|
1905
|
+
tag = CharField(api_name='Tag')
|
|
1906
|
+
|
|
1907
|
+
class Meta:
|
|
1908
|
+
verbose_name = 'preauthorized_deposit_payin'
|
|
1909
|
+
verbose_name_plural = 'preauthorized_deposit_payins'
|
|
1910
|
+
url = {
|
|
1911
|
+
SelectQuery.identifier: '/payins',
|
|
1912
|
+
'CREATE_WITHOUT_COMPLEMENT': '/payins/deposit-preauthorized/direct/full-capture',
|
|
1913
|
+
'CREATE_PRIOR_TO_COMPLEMENT': '/payins/deposit-preauthorized/direct/capture-with-complement',
|
|
1914
|
+
'CREATE_COMPLEMENT': '/payins/deposit-preauthorized/direct/complement'
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
def create_without_complement(self, idempotency_key=None, **kwargs):
|
|
1918
|
+
insert = InsertQuery(self, idempotency_key, **kwargs)
|
|
1919
|
+
insert.identifier = 'CREATE_WITHOUT_COMPLEMENT'
|
|
1920
|
+
insert.insert_query = self.get_field_dict()
|
|
1921
|
+
return insert.execute()
|
|
1922
|
+
|
|
1923
|
+
def create_prior_to_complement(self, idempotency_key=None, **kwargs):
|
|
1924
|
+
insert = InsertQuery(self, idempotency_key, **kwargs)
|
|
1925
|
+
insert.identifier = 'CREATE_PRIOR_TO_COMPLEMENT'
|
|
1926
|
+
insert.insert_query = self.get_field_dict()
|
|
1927
|
+
return insert.execute()
|
|
1928
|
+
|
|
1929
|
+
def create_complement(self, idempotency_key=None, **kwargs):
|
|
1930
|
+
insert = InsertQuery(self, idempotency_key, **kwargs)
|
|
1931
|
+
insert.identifier = 'CREATE_COMPLEMENT'
|
|
1932
|
+
insert.insert_query = self.get_field_dict()
|
|
1933
|
+
return insert.execute()
|
|
1934
|
+
|
|
1935
|
+
|
|
1700
1936
|
class PaymentMethodMetadata(BaseModel):
|
|
1701
1937
|
type = CharField(api_name='Type')
|
|
1702
1938
|
bin = CharField(api_name='Bin')
|
|
@@ -1744,6 +1980,7 @@ class PreAuthorization(BaseModel):
|
|
|
1744
1980
|
card_info = CardInfoField(api_name='CardInfo')
|
|
1745
1981
|
payment_category = CharField(api_name='PaymentCategory')
|
|
1746
1982
|
authentication_result = AuthenticationResultField(api_name='AuthenticationResult')
|
|
1983
|
+
flow_descriptor = FlowDescriptorField(api_name='FlowDescriptor')
|
|
1747
1984
|
|
|
1748
1985
|
def get_transactions(self, *args, **kwargs):
|
|
1749
1986
|
kwargs['id'] = self.id
|
|
@@ -2208,6 +2445,7 @@ class Notification(BaseModel):
|
|
|
2208
2445
|
validity = CharField(api_name='Validity', choices=constants.NOTIFICATION_VALIDITY_CHOICES, default=None)
|
|
2209
2446
|
event_type = CharField(api_name='EventType', choices=constants.EVENT_TYPE_CHOICES, default=None, required=True)
|
|
2210
2447
|
creation_date = DateTimeField(api_name='CreationDate')
|
|
2448
|
+
email = CharField(api_name='Email')
|
|
2211
2449
|
|
|
2212
2450
|
class Meta:
|
|
2213
2451
|
verbose_name = 'notification'
|
|
@@ -2617,6 +2855,7 @@ class ReportV2(BaseModel):
|
|
|
2617
2855
|
before_date = DateTimeField(api_name='BeforeDate', required=True)
|
|
2618
2856
|
filters = ReportFilterField(api_name='Filters')
|
|
2619
2857
|
columns = ListField(api_name='Columns')
|
|
2858
|
+
date_range_by = CharField(api_name='DateRangeBy')
|
|
2620
2859
|
|
|
2621
2860
|
class Meta:
|
|
2622
2861
|
verbose_name = 'reportv2'
|
|
@@ -2804,6 +3043,12 @@ class CountryAuthorization(BaseModel):
|
|
|
2804
3043
|
|
|
2805
3044
|
|
|
2806
3045
|
class Deposit(BaseModel):
|
|
3046
|
+
"""
|
|
3047
|
+
.. deprecated::
|
|
3048
|
+
Use :class:`CardDepositPreauthorization` (and the shared base
|
|
3049
|
+
:class:`DepositPreauthorization`) instead. Kept unchanged for backward
|
|
3050
|
+
compatibility; will be removed in a future major version.
|
|
3051
|
+
"""
|
|
2807
3052
|
author_id = CharField(api_name='AuthorId')
|
|
2808
3053
|
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
2809
3054
|
status = CharField(api_name='Status', choices=constants.DEPOSIT_STATUS_CHOICES, default=None)
|
|
@@ -2827,6 +3072,7 @@ class Deposit(BaseModel):
|
|
|
2827
3072
|
requested_3ds_version = CharField(api_name='Requested3DSVersion')
|
|
2828
3073
|
applied_3ds_version = CharField(api_name='Applied3DSVersion')
|
|
2829
3074
|
authentication_result = AuthenticationResultField(api_name='AuthenticationResult')
|
|
3075
|
+
flow_descriptor = FlowDescriptorField(api_name='FlowDescriptor')
|
|
2830
3076
|
|
|
2831
3077
|
class Meta:
|
|
2832
3078
|
verbose_name = 'deposit'
|
|
@@ -2861,6 +3107,125 @@ class Deposit(BaseModel):
|
|
|
2861
3107
|
return select.all(*args, **kwargs)
|
|
2862
3108
|
|
|
2863
3109
|
|
|
3110
|
+
class DepositPreauthorization(BaseModel):
|
|
3111
|
+
"""Shared base for deposit-preauthorizations. Holds only the fields common to every
|
|
3112
|
+
payment method; the concrete payment-method classes (:class:`CardDepositPreauthorization`,
|
|
3113
|
+
:class:`PayPalDepositPreauthorization`) add their own specific fields.
|
|
3114
|
+
|
|
3115
|
+
The list/select endpoints are shared across payment methods and return a mixed list
|
|
3116
|
+
"""
|
|
3117
|
+
author_id = CharField(api_name='AuthorId')
|
|
3118
|
+
debited_funds = MoneyField(api_name='DebitedFunds')
|
|
3119
|
+
status = CharField(api_name='Status', choices=constants.DEPOSIT_STATUS_CHOICES, default=None)
|
|
3120
|
+
payment_status = CharField(api_name='PaymentStatus', choices=constants.PAYMENT_STATUS_CHOICES, default=None)
|
|
3121
|
+
payins_linked = PayinsLinkedField(api_name="PayinsLinked")
|
|
3122
|
+
result_code = CharField(api_name='ResultCode')
|
|
3123
|
+
result_message = CharField(api_name='ResultMessage')
|
|
3124
|
+
payment_type = CharField(api_name='PaymentType', choices=constants.PAYIN_PAYMENT_TYPE, default=None)
|
|
3125
|
+
execution_type = CharField(api_name='ExecutionType', choices=constants.EXECUTION_TYPE_CHOICES, default=None)
|
|
3126
|
+
statement_descriptor = CharField(api_name='StatementDescriptor')
|
|
3127
|
+
culture = CharField(api_name='Culture')
|
|
3128
|
+
billing = BillingField(api_name='Billing')
|
|
3129
|
+
shipping = ShippingField(api_name='Shipping')
|
|
3130
|
+
|
|
3131
|
+
class Meta:
|
|
3132
|
+
verbose_name = 'deposit_preauthorization'
|
|
3133
|
+
verbose_name_plural = 'deposit_preauthorizations'
|
|
3134
|
+
url = {
|
|
3135
|
+
SelectQuery.identifier: '/deposit-preauthorizations/',
|
|
3136
|
+
UpdateQuery.identifier: '/deposit-preauthorizations/',
|
|
3137
|
+
'GET_ALL_FOR_USER': '/users/%(user_id)s/deposit-preauthorizations/',
|
|
3138
|
+
'GET_ALL_FOR_CARD': '/cards/%(card_id)s/deposit-preauthorizations/'
|
|
3139
|
+
}
|
|
3140
|
+
|
|
3141
|
+
@classmethod
|
|
3142
|
+
def get_all_for_user(cls, user_id, *args, **kwargs):
|
|
3143
|
+
kwargs['user_id'] = user_id
|
|
3144
|
+
select = SelectQuery(DepositPreauthorization, *args, **kwargs)
|
|
3145
|
+
select.identifier = 'GET_ALL_FOR_USER'
|
|
3146
|
+
return select.all(*args, **kwargs)
|
|
3147
|
+
|
|
3148
|
+
@classmethod
|
|
3149
|
+
def get_all_for_card(cls, card_id, *args, **kwargs):
|
|
3150
|
+
kwargs['card_id'] = card_id
|
|
3151
|
+
select = SelectQuery(DepositPreauthorization, *args, **kwargs)
|
|
3152
|
+
select.identifier = 'GET_ALL_FOR_CARD'
|
|
3153
|
+
return select.all(*args, **kwargs)
|
|
3154
|
+
|
|
3155
|
+
@classmethod
|
|
3156
|
+
def get_transactions(cls, deposit_id, *args, **kwargs):
|
|
3157
|
+
kwargs['deposit_id'] = deposit_id
|
|
3158
|
+
select = SelectQuery(Transaction, *args, **kwargs)
|
|
3159
|
+
select.identifier = 'DEPOSIT_GET_TRANSACTIONS'
|
|
3160
|
+
return select.all(*args, **kwargs)
|
|
3161
|
+
|
|
3162
|
+
@classmethod
|
|
3163
|
+
def cast(cls, result):
|
|
3164
|
+
if result.get('PaymentType') == 'PAYPAL':
|
|
3165
|
+
return PayPalDepositPreauthorization
|
|
3166
|
+
return CardDepositPreauthorization
|
|
3167
|
+
|
|
3168
|
+
|
|
3169
|
+
class CardDepositPreauthorization(DepositPreauthorization):
|
|
3170
|
+
card_id = CharField(api_name='CardId')
|
|
3171
|
+
secure_mode_return_url = CharField(api_name='SecureModeReturnURL')
|
|
3172
|
+
secure_mode_redirect_url = CharField(api_name='SecureModeRedirectURL')
|
|
3173
|
+
secure_mode_needed = BooleanField(api_name='SecureModeNeeded')
|
|
3174
|
+
expiration_date = DateField(api_name='ExpirationDate')
|
|
3175
|
+
ip_address = CharField(api_name='IpAddress')
|
|
3176
|
+
browser_info = BrowserInfoField(api_name='BrowserInfo')
|
|
3177
|
+
requested_3ds_version = CharField(api_name='Requested3DSVersion')
|
|
3178
|
+
applied_3ds_version = CharField(api_name='Applied3DSVersion')
|
|
3179
|
+
authentication_result = AuthenticationResultField(api_name='AuthenticationResult')
|
|
3180
|
+
flow_descriptor = FlowDescriptorField(api_name='FlowDescriptor')
|
|
3181
|
+
|
|
3182
|
+
class Meta:
|
|
3183
|
+
verbose_name = 'card_deposit_preauthorization'
|
|
3184
|
+
verbose_name_plural = 'card_deposit_preauthorizations'
|
|
3185
|
+
url = {
|
|
3186
|
+
InsertQuery.identifier: '/deposit-preauthorizations/card/direct',
|
|
3187
|
+
SelectQuery.identifier: '/deposit-preauthorizations/',
|
|
3188
|
+
UpdateQuery.identifier: '/deposit-preauthorizations/',
|
|
3189
|
+
'GET_ALL_FOR_USER': '/users/%(user_id)s/deposit-preauthorizations/',
|
|
3190
|
+
'GET_ALL_FOR_CARD': '/cards/%(card_id)s/deposit-preauthorizations/'
|
|
3191
|
+
}
|
|
3192
|
+
|
|
3193
|
+
|
|
3194
|
+
class PayPalDepositPreauthorization(DepositPreauthorization):
|
|
3195
|
+
creation_date = DateTimeField(api_name='CreationDate')
|
|
3196
|
+
expiration_date = DateTimeField(api_name='ExpirationDate')
|
|
3197
|
+
authorization_date = DateTimeField(api_name='AuthorizationDate')
|
|
3198
|
+
return_url = CharField(api_name='ReturnURL')
|
|
3199
|
+
line_items = ListField(api_name='LineItems')
|
|
3200
|
+
cancel_url = CharField(api_name='CancelURL')
|
|
3201
|
+
data_collection_id = CharField(api_name='DataCollectionId')
|
|
3202
|
+
shipping_preference = CharField(api_name='ShippingPreference', choices=constants.SHIPPING_PREFERENCE_CHOICES,
|
|
3203
|
+
default=None)
|
|
3204
|
+
reference = CharField(api_name='Reference')
|
|
3205
|
+
profiling_attempt_reference = CharField(api_name='ProfilingAttemptReference')
|
|
3206
|
+
paypal_buyer_account_email = CharField(api_name='PaypalBuyerAccountEmail')
|
|
3207
|
+
paypal_order_id = CharField(api_name='PaypalOrderId')
|
|
3208
|
+
buyer_country = CharField(api_name='BuyerCountry')
|
|
3209
|
+
buyer_first_name = CharField(api_name='BuyerFirstName')
|
|
3210
|
+
buyer_last_name = CharField(api_name='BuyerLastName')
|
|
3211
|
+
buyer_phone = CharField(api_name='BuyerPhone')
|
|
3212
|
+
paypal_payer_id = CharField(api_name='PaypalPayerID')
|
|
3213
|
+
trackings = ListField(api_name='Trackings')
|
|
3214
|
+
redirect_url = CharField(api_name='RedirectURL')
|
|
3215
|
+
flow_descriptor = FlowDescriptorField(api_name='FlowDescriptor')
|
|
3216
|
+
|
|
3217
|
+
class Meta:
|
|
3218
|
+
verbose_name = 'paypal_deposit_preauthorization'
|
|
3219
|
+
verbose_name_plural = 'paypal_deposit_preauthorizations'
|
|
3220
|
+
url = {
|
|
3221
|
+
InsertQuery.identifier: '/deposit-preauthorizations/payment-methods/paypal',
|
|
3222
|
+
SelectQuery.identifier: '/deposit-preauthorizations/',
|
|
3223
|
+
UpdateQuery.identifier: '/deposit-preauthorizations/',
|
|
3224
|
+
'GET_ALL_FOR_USER': '/users/%(user_id)s/deposit-preauthorizations/',
|
|
3225
|
+
'GET_ALL_FOR_CARD': '/cards/%(card_id)s/deposit-preauthorizations/'
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
|
|
2864
3229
|
class VirtualAccount(BaseModel):
|
|
2865
3230
|
wallet_id = CharField(api_name='WalletId', required=True)
|
|
2866
3231
|
credited_user_id = CharField(api_name='CreditedUserId')
|
|
@@ -1738,4 +1738,20 @@ class AuthenticationResult(object):
|
|
|
1738
1738
|
def to_api_json(self):
|
|
1739
1739
|
return {
|
|
1740
1740
|
"AuthenticationType": self.authentication_type
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
|
|
1744
|
+
@add_camelcase_aliases
|
|
1745
|
+
class FlowDescriptor(object):
|
|
1746
|
+
def __init__(self, flow_id=None, beneficiaries=None):
|
|
1747
|
+
self.flow_id = flow_id
|
|
1748
|
+
self.beneficiaries = beneficiaries
|
|
1749
|
+
|
|
1750
|
+
def __str__(self):
|
|
1751
|
+
return 'FlowDescriptor: %s %s' % (self.flow_id, self.beneficiaries)
|
|
1752
|
+
|
|
1753
|
+
def to_api_json(self):
|
|
1754
|
+
return {
|
|
1755
|
+
"FlowId": self.flow_id,
|
|
1756
|
+
"Beneficiaries": self.beneficiaries
|
|
1741
1757
|
}
|
|
@@ -10,7 +10,7 @@ with open(path.join(here, 'DESCRIPTION.md'), encoding='utf-8') as f:
|
|
|
10
10
|
|
|
11
11
|
setup(
|
|
12
12
|
name='mangopay4-python-sdk',
|
|
13
|
-
version='3.
|
|
13
|
+
version='3.57.0',
|
|
14
14
|
description='A client library written in python to work with mangopay v2 api',
|
|
15
15
|
long_description='This SDK is a client library for interacting with the Mangopay API.',
|
|
16
16
|
url='https://github.com/Mangopay/mangopay2-python-sdk',
|
|
@@ -13,9 +13,10 @@ from mangopay import APIRequest
|
|
|
13
13
|
from mangopay import get_default_handler
|
|
14
14
|
from mangopay.auth import AuthorizationTokenManager, StaticStorageStrategy
|
|
15
15
|
from mangopay.resources import BankAccount, Document, ReportTransactions, UboDeclaration, Ubo, Deposit, DirectPayIn, \
|
|
16
|
-
VirtualAccount, NaturalUserSca, LegalUserSca, PayInIntent
|
|
16
|
+
VirtualAccount, NaturalUserSca, LegalUserSca, PayInIntent, CardDepositPreauthorization, \
|
|
17
|
+
PayPalDepositPreauthorization
|
|
17
18
|
from mangopay.utils import Address, ReportTransactionsFilters, Birthplace, BrowserInfo, LegalRepresentative, \
|
|
18
|
-
PayInIntentLineItem, PayInIntentBuyer, PayInIntentSeller, PayInIntentExternalData
|
|
19
|
+
PayInIntentLineItem, PayInIntentBuyer, PayInIntentSeller, PayInIntentExternalData, LineItem
|
|
19
20
|
from tests import settings
|
|
20
21
|
from tests.mocks import RegisteredMocks
|
|
21
22
|
from tests.resources import (NaturalUser, LegalUser, Wallet,
|
|
@@ -759,6 +760,49 @@ class BaseTestLive(unittest.TestCase):
|
|
|
759
760
|
|
|
760
761
|
return Deposit(**deposit.save())
|
|
761
762
|
|
|
763
|
+
@staticmethod
|
|
764
|
+
def create_new_card_deposit_preauthorization():
|
|
765
|
+
user = BaseTestLive.get_john()
|
|
766
|
+
debited_funds = Money(amount=1000, currency='EUR')
|
|
767
|
+
card_registration = BaseTestLive.create_new_card_registration_for_deposit()
|
|
768
|
+
|
|
769
|
+
params = {
|
|
770
|
+
"author_id": user.id,
|
|
771
|
+
"debited_funds": debited_funds,
|
|
772
|
+
"card_id": card_registration.card_id,
|
|
773
|
+
"secure_mode_return_url": "http://lorem",
|
|
774
|
+
"ip_address": "2001:0620:0000:0000:0211:24FF:FE80:C12C",
|
|
775
|
+
"browser_info": BaseTest.get_browser_info()
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
deposit = CardDepositPreauthorization(**params)
|
|
779
|
+
|
|
780
|
+
return CardDepositPreauthorization(**deposit.save())
|
|
781
|
+
|
|
782
|
+
@staticmethod
|
|
783
|
+
def create_new_paypal_deposit_preauthorization():
|
|
784
|
+
user = BaseTestLive.get_john()
|
|
785
|
+
debited_funds = Money(amount=1000, currency='EUR')
|
|
786
|
+
|
|
787
|
+
line_item = LineItem()
|
|
788
|
+
line_item.name = "test"
|
|
789
|
+
line_item.quantity = 1
|
|
790
|
+
line_item.unit_amount = 1000
|
|
791
|
+
line_item.tax_amount = 0
|
|
792
|
+
line_item.description = "test"
|
|
793
|
+
line_item.category = "DIGITAL_GOODS"
|
|
794
|
+
|
|
795
|
+
params = {
|
|
796
|
+
"author_id": user.id,
|
|
797
|
+
"debited_funds": debited_funds,
|
|
798
|
+
"return_url": "http://lorem",
|
|
799
|
+
"line_items": [line_item]
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
deposit = PayPalDepositPreauthorization(**params)
|
|
803
|
+
|
|
804
|
+
return PayPalDepositPreauthorization(**deposit.save())
|
|
805
|
+
|
|
762
806
|
@staticmethod
|
|
763
807
|
def create_new_card_registration_for_deposit():
|
|
764
808
|
card_params = {
|