Skip to content

Commit aec694c

Browse files
author
WorldlineConnect
committed
Release 4.3.0.
1 parent 77b2d1f commit aec694c

15 files changed

+173
-15
lines changed

.github/workflows/deploy.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
- name: Install Twine and dependencies
2323
run: pip install twine requests==2.* requests-toolbelt==0.* appengine-python-standard
2424
- name: Build
25-
run: python setup.py sdist --formats zip --dist-dir .
25+
run: python setup.py sdist --formats gztar --dist-dir .
2626
- name: Verify
27-
run: twine check "connect-sdk-python3-${SDK_VERSION}.zip"
27+
run: twine check "connect-sdk-python3-${SDK_VERSION}.tar.gz"
2828
- name: Deploy
29-
run: twine upload --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" "connect-sdk-python3-${SDK_VERSION}.zip"
29+
run: twine upload --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" "connect-sdk-python3-${SDK_VERSION}.tar.gz"
3030
env:
3131
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
3232
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
# built documents.
6363
#
6464
# The short X.Y version.
65-
version = '4.2.0'
65+
version = '4.3.0'
6666
# The full version, including alpha/beta/rc tags.
67-
release = '4.2.0'
67+
release = '4.3.0'
6868

6969
# The language for content autogenerated by Sphinx. Refer to documentation
7070
# for a list of supported languages.
@@ -138,7 +138,7 @@
138138
# The name for this set of Sphinx documents.
139139
# "<project> v<release> documentation" by default.
140140
#
141-
# html_title = 'Python SDK v4.2.0'
141+
# html_title = 'Python SDK v4.3.0'
142142

143143
# A shorter title for the navigation bar. Default is the same as html_title.
144144
#

index.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,13 @@ API Reference
12621262
:special-members:
12631263
:exclude-members: __dict__,__weakref__,__module__,__get__
12641264

1265+
.. automodule:: worldline.connect.sdk.v1.domain.cybersource_decision_manager
1266+
:members:
1267+
:show-inheritance:
1268+
:undoc-members:
1269+
:special-members:
1270+
:exclude-members: __dict__,__weakref__,__module__,__get__
1271+
12651272
.. automodule:: worldline.connect.sdk.v1.domain.debtor
12661273
:members:
12671274
:show-inheritance:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_collector():
2121

2222
setup(
2323
name="connect-sdk-python3",
24-
version="4.2.0",
24+
version="4.3.0",
2525
author="Worldline Global Collect",
2626
author_email="[email protected]",
2727
description="SDK to communicate with the Worldline Global Collect platform using the Worldline Connect Server API",

worldline/connect/sdk/communication/metadata_provider.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MetadataProvider(object):
2222
"""
2323
Provides meta info about the server.
2424
"""
25-
__sdk_version = "4.2.0"
25+
__sdk_version = "4.3.0"
2626
__server_meta_info_header = "X-GCS-ServerMetaInfo"
2727
__prohibited_headers = tuple(sorted([__server_meta_info_header, "X-GCS-Idempotence-Key", "Date", "Content-Type", "Authorization"],
2828
key=str.lower))

worldline/connect/sdk/v1/domain/card_payment_method_specific_input.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def network_token_data(self, value: Optional[SchemeTokenData]) -> None:
100100
def return_url(self) -> Optional[str]:
101101
"""
102102
| The URL that the customer is redirect to after the payment flow has finished. You can add any number of key value pairs in the query string that, for instance help you to identify the customer when they return to your site. Please note that we will also append some additional key value pairs that will also help you with this identification process.
103-
| Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
103+
| Note: The provided URL should be absolute and contain the https:// protocol. IP addresses are not supported, neither localhost. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
104104
| URLs without a protocol will be rejected.
105105
106106
Type: str

worldline/connect/sdk/v1/domain/cash_payment_product1503_specific_input.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CashPaymentProduct1503SpecificInput(DataObject):
1919
def return_url(self) -> Optional[str]:
2020
"""
2121
| The URL that the customer is redirect to after the payment flow has finished. You can add any number of key value pairs in the query string that, for instance help you to identify the customer when they return to your site. Please note that we will also append some additional key value pairs that will also help you with this identification process.
22-
| Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
22+
| Note: The provided URL should be absolute and contain the https:// protocol. IP addresses are not supported, neither localhost. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
2323
| URLs without a protocol will be rejected.
2424
2525
Type: str

worldline/connect/sdk/v1/domain/create_mandate_with_return_url.py

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class CreateMandateWithReturnUrl(CreateMandateBase):
1616
def return_url(self) -> Optional[str]:
1717
"""
1818
| Return URL to use if the mandate signing requires redirection.
19+
| Note: The provided URL should be absolute and contain the https:// protocol. IP addresses are not supported, neither localhost. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
20+
| URLs without a protocol will be rejected.
1921
2022
Type: str
2123
"""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# This class was auto-generated from the API references found at
4+
# https://apireference.connect.worldline-solutions.com/
5+
#
6+
from typing import List, Optional
7+
8+
from worldline.connect.sdk.domain.data_object import DataObject
9+
10+
11+
class CybersourceDecisionManager(DataObject):
12+
"""
13+
| This object contains the results of the Cybersource Decision Manager assessment. Cybersource is a fraud detection tool leveraging data networks, configurable rules, intelligence, and device fingerprinting to identify risky transactions.
14+
"""
15+
16+
__clause_name: Optional[str] = None
17+
__fraud_score: Optional[int] = None
18+
__policy_applied: Optional[str] = None
19+
__reason_codes: Optional[List[str]] = None
20+
21+
@property
22+
def clause_name(self) -> Optional[str]:
23+
"""
24+
| Name of the clause within the applied policy that was triggered during the evaluation of this transaction.
25+
26+
Type: str
27+
"""
28+
return self.__clause_name
29+
30+
@clause_name.setter
31+
def clause_name(self, value: Optional[str]) -> None:
32+
self.__clause_name = value
33+
34+
@property
35+
def fraud_score(self) -> Optional[int]:
36+
"""
37+
| Result of the Cybersource Decision Manager check. This contains the normalized fraud score from a scale of 0 to 100. A higher score indicates an increased risk of fraud.
38+
39+
Type: int
40+
"""
41+
return self.__fraud_score
42+
43+
@fraud_score.setter
44+
def fraud_score(self, value: Optional[int]) -> None:
45+
self.__fraud_score = value
46+
47+
@property
48+
def policy_applied(self) -> Optional[str]:
49+
"""
50+
| Name of the policy that was applied during the evaluation of this transaction.
51+
52+
Type: str
53+
"""
54+
return self.__policy_applied
55+
56+
@policy_applied.setter
57+
def policy_applied(self, value: Optional[str]) -> None:
58+
self.__policy_applied = value
59+
60+
@property
61+
def reason_codes(self) -> Optional[List[str]]:
62+
"""
63+
| List of one or more reason codes.
64+
65+
Type: list[str]
66+
"""
67+
return self.__reason_codes
68+
69+
@reason_codes.setter
70+
def reason_codes(self, value: Optional[List[str]]) -> None:
71+
self.__reason_codes = value
72+
73+
def to_dictionary(self) -> dict:
74+
dictionary = super(CybersourceDecisionManager, self).to_dictionary()
75+
if self.clause_name is not None:
76+
dictionary['clauseName'] = self.clause_name
77+
if self.fraud_score is not None:
78+
dictionary['fraudScore'] = self.fraud_score
79+
if self.policy_applied is not None:
80+
dictionary['policyApplied'] = self.policy_applied
81+
if self.reason_codes is not None:
82+
dictionary['reasonCodes'] = []
83+
for element in self.reason_codes:
84+
if element is not None:
85+
dictionary['reasonCodes'].append(element)
86+
return dictionary
87+
88+
def from_dictionary(self, dictionary: dict) -> 'CybersourceDecisionManager':
89+
super(CybersourceDecisionManager, self).from_dictionary(dictionary)
90+
if 'clauseName' in dictionary:
91+
self.clause_name = dictionary['clauseName']
92+
if 'fraudScore' in dictionary:
93+
self.fraud_score = dictionary['fraudScore']
94+
if 'policyApplied' in dictionary:
95+
self.policy_applied = dictionary['policyApplied']
96+
if 'reasonCodes' in dictionary:
97+
if not isinstance(dictionary['reasonCodes'], list):
98+
raise TypeError('value \'{}\' is not a list'.format(dictionary['reasonCodes']))
99+
self.reason_codes = []
100+
for element in dictionary['reasonCodes']:
101+
self.reason_codes.append(element)
102+
return self

worldline/connect/sdk/v1/domain/fraud_results.py

+22
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,31 @@
66
from typing import Optional
77

88
from worldline.connect.sdk.domain.data_object import DataObject
9+
from worldline.connect.sdk.v1.domain.cybersource_decision_manager import CybersourceDecisionManager
910
from worldline.connect.sdk.v1.domain.in_auth import InAuth
1011
from worldline.connect.sdk.v1.domain.microsoft_fraud_results import MicrosoftFraudResults
1112

1213

1314
class FraudResults(DataObject):
1415

16+
__cybersource_decision_manager: Optional[CybersourceDecisionManager] = None
1517
__fraud_service_result: Optional[str] = None
1618
__in_auth: Optional[InAuth] = None
1719
__microsoft_fraud_protection: Optional[MicrosoftFraudResults] = None
1820

21+
@property
22+
def cybersource_decision_manager(self) -> Optional[CybersourceDecisionManager]:
23+
"""
24+
| This object contains the results of the Cybersource Decision Manager assessment. Cybersource is a fraud detection tool leveraging data networks, configurable rules, intelligence, and device fingerprinting to identify risky transactions.
25+
26+
Type: :class:`worldline.connect.sdk.v1.domain.cybersource_decision_manager.CybersourceDecisionManager`
27+
"""
28+
return self.__cybersource_decision_manager
29+
30+
@cybersource_decision_manager.setter
31+
def cybersource_decision_manager(self, value: Optional[CybersourceDecisionManager]) -> None:
32+
self.__cybersource_decision_manager = value
33+
1934
@property
2035
def fraud_service_result(self) -> Optional[str]:
2136
"""
@@ -63,6 +78,8 @@ def microsoft_fraud_protection(self, value: Optional[MicrosoftFraudResults]) ->
6378

6479
def to_dictionary(self) -> dict:
6580
dictionary = super(FraudResults, self).to_dictionary()
81+
if self.cybersource_decision_manager is not None:
82+
dictionary['cybersourceDecisionManager'] = self.cybersource_decision_manager.to_dictionary()
6683
if self.fraud_service_result is not None:
6784
dictionary['fraudServiceResult'] = self.fraud_service_result
6885
if self.in_auth is not None:
@@ -73,6 +90,11 @@ def to_dictionary(self) -> dict:
7390

7491
def from_dictionary(self, dictionary: dict) -> 'FraudResults':
7592
super(FraudResults, self).from_dictionary(dictionary)
93+
if 'cybersourceDecisionManager' in dictionary:
94+
if not isinstance(dictionary['cybersourceDecisionManager'], dict):
95+
raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['cybersourceDecisionManager']))
96+
value = CybersourceDecisionManager()
97+
self.cybersource_decision_manager = value.from_dictionary(dictionary['cybersourceDecisionManager'])
7698
if 'fraudServiceResult' in dictionary:
7799
self.fraud_service_result = dictionary['fraudServiceResult']
78100
if 'inAuth' in dictionary:

worldline/connect/sdk/v1/domain/hosted_checkout_specific_input.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def return_cancel_state(self, value: Optional[bool]) -> None:
102102
def return_url(self) -> Optional[str]:
103103
"""
104104
| The URL that the customer is redirect to after the payment flow has finished. You can add any number of key value pairs in the query string that, for instance help you to identify the customer when they return to your site. Please note that we will also append some additional key value pairs that will also help you with this identification process.
105-
| Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
105+
| Note: The provided URL should be absolute and contain the https:// protocol. IP addresses are not supported, neither localhost. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
106106
| URLs without a protocol will be rejected.
107107
108108
Type: str

worldline/connect/sdk/v1/domain/hosted_mandate_management_specific_input.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def locale(self, value: Optional[str]) -> None:
3232
def return_url(self) -> Optional[str]:
3333
"""
3434
| The URL that the customer is redirect to after the mandate flow has finished. You can add any number of key value pairs in the query string that, for instance help you to identify the customer when they return to your site. Please note that we will also append some additional key value pairs that will also help you with this identification process.
35-
| Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
35+
| Note: The provided URL should be absolute and contain the https:// protocol. IP addresses are not supported, neither localhost. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
3636
| URLs without a protocol will be rejected.
3737
3838
Type: str

worldline/connect/sdk/v1/domain/microsoft_fraud_results.py

+26-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This class was auto-generated from the API references found at
44
# https://apireference.connect.worldline-solutions.com/
55
#
6-
from typing import Optional
6+
from typing import List, Optional
77

88
from worldline.connect.sdk.domain.data_object import DataObject
99

@@ -15,6 +15,7 @@ class MicrosoftFraudResults(DataObject):
1515
__device_id: Optional[str] = None
1616
__fraud_score: Optional[int] = None
1717
__policy_applied: Optional[str] = None
18+
__reason_codes: Optional[List[str]] = None
1819
__true_ip_address: Optional[str] = None
1920
__user_device_type: Optional[str] = None
2021

@@ -83,6 +84,19 @@ def policy_applied(self) -> Optional[str]:
8384
def policy_applied(self, value: Optional[str]) -> None:
8485
self.__policy_applied = value
8586

87+
@property
88+
def reason_codes(self) -> Optional[List[str]]:
89+
"""
90+
| List of one or more reason codes.
91+
92+
Type: list[str]
93+
"""
94+
return self.__reason_codes
95+
96+
@reason_codes.setter
97+
def reason_codes(self, value: Optional[List[str]]) -> None:
98+
self.__reason_codes = value
99+
86100
@property
87101
def true_ip_address(self) -> Optional[str]:
88102
"""
@@ -121,6 +135,11 @@ def to_dictionary(self) -> dict:
121135
dictionary['fraudScore'] = self.fraud_score
122136
if self.policy_applied is not None:
123137
dictionary['policyApplied'] = self.policy_applied
138+
if self.reason_codes is not None:
139+
dictionary['reasonCodes'] = []
140+
for element in self.reason_codes:
141+
if element is not None:
142+
dictionary['reasonCodes'].append(element)
124143
if self.true_ip_address is not None:
125144
dictionary['trueIpAddress'] = self.true_ip_address
126145
if self.user_device_type is not None:
@@ -139,6 +158,12 @@ def from_dictionary(self, dictionary: dict) -> 'MicrosoftFraudResults':
139158
self.fraud_score = dictionary['fraudScore']
140159
if 'policyApplied' in dictionary:
141160
self.policy_applied = dictionary['policyApplied']
161+
if 'reasonCodes' in dictionary:
162+
if not isinstance(dictionary['reasonCodes'], list):
163+
raise TypeError('value \'{}\' is not a list'.format(dictionary['reasonCodes']))
164+
self.reason_codes = []
165+
for element in dictionary['reasonCodes']:
166+
self.reason_codes.append(element)
142167
if 'trueIpAddress' in dictionary:
143168
self.true_ip_address = dictionary['trueIpAddress']
144169
if 'userDeviceType' in dictionary:

worldline/connect/sdk/v1/domain/redirect_payment_method_specific_input.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def redirection_data(self, value: Optional[RedirectionData]) -> None:
151151
def return_url(self) -> Optional[str]:
152152
"""
153153
| The URL that the customer is redirect to after the payment flow has finished. You can add any number of key value pairs in the query string that, for instance help you to identify the customer when they return to your site. Please note that we will also append some additional key value pairs that will also help you with this identification process.
154-
| Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
154+
| Note: The provided URL should be absolute and contain the https:// protocol. IP addresses are not supported, neither localhost. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
155155
| URLs without a protocol will be rejected.
156156
157157
Type: str

worldline/connect/sdk/v1/domain/redirection_data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RedirectionData(DataObject):
2020
def return_url(self) -> Optional[str]:
2121
"""
2222
| The URL that the customer is redirect to after the payment flow has finished. You can add any number of key value pairs in the query string that, for instance help you to identify the customer when they return to your site. Please note that we will also append some additional key value pairs that will also help you with this identification process.
23-
| Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
23+
| Note: The provided URL should be absolute and contain the https:// protocol. IP addresses are not supported, neither localhost. For use on mobile devices a custom protocol can be used in the form of *protocol*://. This protocol must be registered on the device first.
2424
| URLs without a protocol will be rejected.
2525
2626
Type: str

0 commit comments

Comments
 (0)