@@ -20,29 +20,27 @@ def __get_authorization_header(self) -> dict:
20
20
return {'Authorization' : f'{ token_type } { access_token } ' }
21
21
22
22
def register_new_signup (self ,
23
- installation_id : str ,
23
+ request_token : Optional [ str ] ,
24
24
address_line : Optional [str ] = None ,
25
25
structured_address : Optional [StructuredAddress ] = None ,
26
26
address_coordinates : Optional [Coordinates ] = None ,
27
27
external_id : Optional [str ] = None ,
28
28
policy_id : Optional [str ] = None ,
29
- account_id : Optional [str ] = None ,
30
- request_token : Optional [str ] = None ) -> dict :
31
- if not installation_id :
32
- raise IncogniaError ('installation_id is required.' )
29
+ account_id : Optional [str ] = None ) -> dict :
30
+ if not request_token :
31
+ raise IncogniaError ('request_token is required.' )
33
32
34
33
try :
35
34
headers = self .__get_authorization_header ()
36
35
headers .update (JSON_CONTENT_HEADER )
37
36
body = {
38
- 'installation_id ' : installation_id ,
37
+ 'request_token ' : request_token ,
39
38
'address_line' : address_line ,
40
39
'structured_address' : structured_address ,
41
40
'address_coordinates' : address_coordinates ,
42
41
'external_id' : external_id ,
43
42
'policy_id' : policy_id ,
44
- 'account_id' : account_id ,
45
- 'request_token' : request_token
43
+ 'account_id' : account_id
46
44
}
47
45
data = encode (body )
48
46
return self .__request .post (Endpoints .SIGNUPS , headers = headers , data = data )
@@ -59,7 +57,6 @@ def register_feedback(self,
59
57
signup_id : Optional [str ] = None ,
60
58
account_id : Optional [str ] = None ,
61
59
installation_id : Optional [str ] = None ,
62
- session_token : Optional [str ] = None ,
63
60
request_token : Optional [str ] = None ,
64
61
occurred_at : dt .datetime = None ,
65
62
expires_at : dt .datetime = None ) -> None :
@@ -83,7 +80,6 @@ def register_feedback(self,
83
80
'signup_id' : signup_id ,
84
81
'account_id' : account_id ,
85
82
'installation_id' : installation_id ,
86
- 'session_token' : session_token ,
87
83
'request_token' : request_token
88
84
}
89
85
if timestamp is not None :
@@ -99,17 +95,16 @@ def register_feedback(self,
99
95
raise IncogniaHTTPError (e ) from None
100
96
101
97
def register_payment (self ,
102
- installation_id : str ,
98
+ request_token : str ,
103
99
account_id : str ,
104
100
external_id : Optional [str ] = None ,
105
101
addresses : Optional [List [TransactionAddress ]] = None ,
106
102
payment_value : Optional [PaymentValue ] = None ,
107
103
payment_methods : Optional [List [PaymentMethod ]] = None ,
108
104
evaluate : Optional [bool ] = None ,
109
- policy_id : Optional [str ] = None ,
110
- request_token : Optional [str ] = None ) -> dict :
111
- if not installation_id :
112
- raise IncogniaError ('installation_id is required.' )
105
+ policy_id : Optional [str ] = None ) -> dict :
106
+ if not request_token :
107
+ raise IncogniaError ('request_token is required.' )
113
108
if not account_id :
114
109
raise IncogniaError ('account_id is required.' )
115
110
@@ -119,14 +114,13 @@ def register_payment(self,
119
114
params = None if evaluate is None else {'eval' : evaluate }
120
115
body = {
121
116
'type' : 'payment' ,
122
- 'installation_id ' : installation_id ,
117
+ 'request_token ' : request_token ,
123
118
'account_id' : account_id ,
124
119
'external_id' : external_id ,
125
120
'addresses' : addresses ,
126
121
'payment_value' : payment_value ,
127
122
'payment_methods' : payment_methods ,
128
- 'policy_id' : policy_id ,
129
- 'request_token' : request_token
123
+ 'policy_id' : policy_id
130
124
}
131
125
data = encode (body )
132
126
return self .__request .post (Endpoints .TRANSACTIONS , headers = headers , params = params ,
@@ -136,14 +130,13 @@ def register_payment(self,
136
130
raise IncogniaHTTPError (e ) from None
137
131
138
132
def register_login (self ,
139
- installation_id : str ,
133
+ request_token : str ,
140
134
account_id : str ,
141
135
external_id : Optional [str ] = None ,
142
136
evaluate : Optional [bool ] = None ,
143
- policy_id : Optional [str ] = None ,
144
- request_token : Optional [str ] = None ) -> dict :
145
- if not installation_id :
146
- raise IncogniaError ('installation_id is required.' )
137
+ policy_id : Optional [str ] = None ) -> dict :
138
+ if not request_token :
139
+ raise IncogniaError ('request_token is required.' )
147
140
if not account_id :
148
141
raise IncogniaError ('account_id is required.' )
149
142
@@ -153,11 +146,10 @@ def register_login(self,
153
146
params = None if evaluate is None else {'eval' : evaluate }
154
147
body = {
155
148
'type' : 'login' ,
156
- 'installation_id ' : installation_id ,
149
+ 'request_token ' : request_token ,
157
150
'account_id' : account_id ,
158
151
'external_id' : external_id ,
159
- 'policy_id' : policy_id ,
160
- 'request_token' : request_token
152
+ 'policy_id' : policy_id
161
153
}
162
154
data = encode (body )
163
155
return self .__request .post (Endpoints .TRANSACTIONS , headers = headers , params = params ,
@@ -167,14 +159,13 @@ def register_login(self,
167
159
raise IncogniaHTTPError (e ) from None
168
160
169
161
def register_web_login (self ,
170
- session_token : str ,
162
+ request_token : str ,
171
163
account_id : str ,
172
164
external_id : Optional [str ] = None ,
173
165
evaluate : Optional [bool ] = None ,
174
- policy_id : Optional [str ] = None ,
175
- request_token : Optional [str ] = None ) -> dict :
176
- if not session_token :
177
- raise IncogniaError ('session_token is required.' )
166
+ policy_id : Optional [str ] = None ) -> dict :
167
+ if not request_token :
168
+ raise IncogniaError ('request_token is required.' )
178
169
if not account_id :
179
170
raise IncogniaError ('account_id is required.' )
180
171
@@ -184,11 +175,10 @@ def register_web_login(self,
184
175
params = None if evaluate is None else {'eval' : evaluate }
185
176
body = {
186
177
'type' : 'login' ,
187
- 'session_token ' : session_token ,
178
+ 'request_token ' : request_token ,
188
179
'account_id' : account_id ,
189
180
'external_id' : external_id ,
190
- 'policy_id' : policy_id ,
191
- 'request_token' : request_token
181
+ 'policy_id' : policy_id
192
182
}
193
183
data = encode (body )
194
184
return self .__request .post (Endpoints .TRANSACTIONS , headers = headers , params = params ,
0 commit comments