connections-sdk 1.1.0__py3-none-any.whl → 2.0.0__py3-none-any.whl
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.
- connections_sdk/client.py +7 -24
- {connections_sdk-1.1.0.dist-info → connections_sdk-2.0.0.dist-info}/METADATA +2 -2
- {connections_sdk-1.1.0.dist-info → connections_sdk-2.0.0.dist-info}/RECORD +5 -5
- {connections_sdk-1.1.0.dist-info → connections_sdk-2.0.0.dist-info}/LICENSE +0 -0
- {connections_sdk-1.1.0.dist-info → connections_sdk-2.0.0.dist-info}/WHEEL +0 -0
connections_sdk/client.py
CHANGED
|
@@ -25,19 +25,12 @@ class ProviderConfig:
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class Connections:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def __init__(self) -> None:
|
|
28
|
+
def __init__(self, config: Dict[str, Any]) -> None:
|
|
29
|
+
"""Initialize the Connections SDK with the provided configuration."""
|
|
31
30
|
self.is_test: bool = False
|
|
32
31
|
self.bt_api_key: str = ""
|
|
33
32
|
self.provider_config: Optional[ProviderConfig] = None
|
|
34
33
|
|
|
35
|
-
@classmethod
|
|
36
|
-
def init(cls, config: Dict[str, Any]) -> 'Connections':
|
|
37
|
-
"""Initialize the Connections SDK with the provided configuration."""
|
|
38
|
-
if cls._instance is None:
|
|
39
|
-
cls._instance = cls()
|
|
40
|
-
|
|
41
34
|
if 'is_test' not in config:
|
|
42
35
|
config['is_test'] = False
|
|
43
36
|
if 'bt_api_key' not in config:
|
|
@@ -45,17 +38,16 @@ class Connections:
|
|
|
45
38
|
if 'provider_config' not in config:
|
|
46
39
|
raise ConfigurationError("'provider_config' parameter is required")
|
|
47
40
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
instance.bt_api_key = config['bt_api_key']
|
|
41
|
+
self.is_test = config['is_test']
|
|
42
|
+
self.bt_api_key = config['bt_api_key']
|
|
51
43
|
|
|
52
44
|
provider_config = config['provider_config']
|
|
53
|
-
|
|
45
|
+
self.provider_config = ProviderConfig()
|
|
54
46
|
|
|
55
47
|
# Initialize Adyen configuration if provided
|
|
56
48
|
if 'adyen' in provider_config:
|
|
57
49
|
adyen_config = provider_config.get('adyen')
|
|
58
|
-
|
|
50
|
+
self.provider_config.adyen = AdyenConfig(
|
|
59
51
|
api_key=adyen_config.get('api_key'),
|
|
60
52
|
merchant_account=adyen_config.get('merchant_account'),
|
|
61
53
|
production_prefix=adyen_config.get('production_prefix', "")
|
|
@@ -64,20 +56,11 @@ class Connections:
|
|
|
64
56
|
# Initialize Checkout.com configuration if provided
|
|
65
57
|
if 'checkout' in provider_config:
|
|
66
58
|
checkout_config = provider_config.get('checkout')
|
|
67
|
-
|
|
59
|
+
self.provider_config.checkout = CheckoutConfig(
|
|
68
60
|
private_key=checkout_config.get('private_key'),
|
|
69
61
|
processing_channel=checkout_config.get('processing_channel')
|
|
70
62
|
)
|
|
71
63
|
|
|
72
|
-
return instance
|
|
73
|
-
|
|
74
|
-
@classmethod
|
|
75
|
-
def get_instance(cls) -> 'Connections':
|
|
76
|
-
"""Get the initialized SDK instance."""
|
|
77
|
-
if cls._instance is None:
|
|
78
|
-
raise ConfigurationError("Connections must be initialized with init() before use")
|
|
79
|
-
return cls._instance
|
|
80
|
-
|
|
81
64
|
@property
|
|
82
65
|
def adyen(self) -> AdyenClient:
|
|
83
66
|
"""Get the Adyen client instance."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: connections_sdk
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: A Python SDK for payment processing
|
|
5
5
|
Author: Basis Theory
|
|
6
6
|
Author-email: support@basistheory.com
|
|
@@ -43,7 +43,7 @@ from connections_sdk import Connections
|
|
|
43
43
|
from connections_sdk.models import RecurringType
|
|
44
44
|
|
|
45
45
|
# Initialize the SDK with your chosen provider
|
|
46
|
-
sdk = Connections
|
|
46
|
+
sdk = Connections({
|
|
47
47
|
'is_test': True, # Use test environment
|
|
48
48
|
'bt_api_key': 'YOUR_BASIS_THEORY_API_KEY',
|
|
49
49
|
'provider_config': {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
connections_sdk/__init__.py,sha256=IYYzlDWAgIeJs_1Ly2_SNsUYtMjGexysfY3Q9-L1Pn8,174
|
|
2
|
-
connections_sdk/client.py,sha256=
|
|
2
|
+
connections_sdk/client.py,sha256=FkZq68S_syvaJTVRSVPtpA4FwsybRdC9FivRi2SOkoI,3165
|
|
3
3
|
connections_sdk/config.py,sha256=OPH-J11ecQYP17ubtIXuB_VVuso3t-Ym9V8f5j-G1Xk,398
|
|
4
4
|
connections_sdk/exceptions.py,sha256=3L3X1OCp7EIPg5l4NPfcEUrPPahfEft-qnZ5QfxXR0k,805
|
|
5
5
|
connections_sdk/models.py,sha256=slAgi-v9qZjWNGvHrJc8myXcN-v1X2lP5gXFjj6fUCQ,6650
|
|
@@ -8,7 +8,7 @@ connections_sdk/providers/checkout.py,sha256=2hTWkZwnMazlQn4MpICoQ5GZDfGOEhrjYp5
|
|
|
8
8
|
connections_sdk/utils/__init__.py,sha256=iKwqW2egmbc_LO0oQoNLiP5-RBXUd9OpMW6sdEVB_Fs,153
|
|
9
9
|
connections_sdk/utils/model_utils.py,sha256=B1lIam4Ctajnhi1H9eB7hpM4IVbemHgpHzBVruoPKcU,3159
|
|
10
10
|
connections_sdk/utils/request_client.py,sha256=zbCGoJajAQ9RUNUb5x5edSaqdxJxPhoedAwUBT0S3ek,3261
|
|
11
|
-
connections_sdk-
|
|
12
|
-
connections_sdk-
|
|
13
|
-
connections_sdk-
|
|
14
|
-
connections_sdk-
|
|
11
|
+
connections_sdk-2.0.0.dist-info/LICENSE,sha256=OJSDpWNs9gHwRBdHonZIkQ2-rUpFMxn0V8xxjfz4UQQ,11342
|
|
12
|
+
connections_sdk-2.0.0.dist-info/METADATA,sha256=bcoDDC_r3AhbyIKend4Zylkw7Pup1RvALske8rGKIN4,2821
|
|
13
|
+
connections_sdk-2.0.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
14
|
+
connections_sdk-2.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|