@@ -29,6 +29,7 @@ def __init__(self, client, prefill=None):
29
29
self ._token_id = None
30
30
self ._details = None
31
31
self ._url = None
32
+ self ._url_qrcode = None
32
33
self ._name = None
33
34
self ._order_id = None
34
35
self ._amount = None
@@ -47,6 +48,7 @@ def __init__(self, client, prefill=None):
47
48
self ._require_backend_capture = None
48
49
self ._sandbox = None
49
50
self ._created_at = None
51
+ self ._expires_at = None
50
52
self ._risk = None
51
53
self ._shipping = None
52
54
self ._device = None
@@ -293,6 +295,19 @@ def url(self, val):
293
295
self ._url = val
294
296
return self
295
297
298
+ @property
299
+ def url_qrcode (self ):
300
+ """Get url_qrcode"""
301
+ return self ._url_qrcode
302
+
303
+ @url_qrcode .setter
304
+ def url_qrcode (self , val ):
305
+ """Set url_qrcode
306
+ Keyword argument:
307
+ val -- New url_qrcode value"""
308
+ self ._url_qrcode = val
309
+ return self
310
+
296
311
@property
297
312
def name (self ):
298
313
"""Get name"""
@@ -527,6 +542,19 @@ def created_at(self, val):
527
542
self ._created_at = val
528
543
return self
529
544
545
+ @property
546
+ def expires_at (self ):
547
+ """Get expires_at"""
548
+ return self ._expires_at
549
+
550
+ @expires_at .setter
551
+ def expires_at (self , val ):
552
+ """Set expires_at
553
+ Keyword argument:
554
+ val -- New expires_at value"""
555
+ self ._expires_at = val
556
+ return self
557
+
530
558
@property
531
559
def risk (self ):
532
560
"""Get risk"""
@@ -850,6 +878,8 @@ def fill_with_data(self, data):
850
878
self .details = data ["details" ]
851
879
if "url" in data .keys ():
852
880
self .url = data ["url" ]
881
+ if "url_qrcode" in data .keys ():
882
+ self .url_qrcode = data ["url_qrcode" ]
853
883
if "name" in data .keys ():
854
884
self .name = data ["name" ]
855
885
if "order_id" in data .keys ():
@@ -886,6 +916,8 @@ def fill_with_data(self, data):
886
916
self .sandbox = data ["sandbox" ]
887
917
if "created_at" in data .keys ():
888
918
self .created_at = data ["created_at" ]
919
+ if "expires_at" in data .keys ():
920
+ self .expires_at = data ["expires_at" ]
889
921
if "risk" in data .keys ():
890
922
self .risk = data ["risk" ]
891
923
if "shipping" in data .keys ():
@@ -938,6 +970,7 @@ def to_json(self):
938
970
"token_id" : self .token_id ,
939
971
"details" : self .details ,
940
972
"url" : self .url ,
973
+ "url_qrcode" : self .url_qrcode ,
941
974
"name" : self .name ,
942
975
"order_id" : self .order_id ,
943
976
"amount" : self .amount ,
@@ -956,6 +989,7 @@ def to_json(self):
956
989
"require_backend_capture" : self .require_backend_capture ,
957
990
"sandbox" : self .sandbox ,
958
991
"created_at" : self .created_at ,
992
+ "expires_at" : self .expires_at ,
959
993
"risk" : self .risk ,
960
994
"shipping" : self .shipping ,
961
995
"device" : self .device ,
@@ -1028,8 +1062,12 @@ def authorize(self, source, options={}):
1028
1062
body = body ["transaction" ]
1029
1063
transaction = processout .Transaction (self ._client )
1030
1064
return_values .append (transaction .fill_with_data (body ))
1065
+ body = response .body
1066
+ body = body ["customer_action" ]
1067
+ customerAction = processout .CustomerAction (self ._client )
1068
+ return_values .append (customerAction .fill_with_data (body ))
1031
1069
1032
- return return_values [ 0 ]
1070
+ return tuple ( return_values )
1033
1071
1034
1072
def capture (self , source , options = {}):
1035
1073
"""Capture the invoice using the given source (customer or token)
@@ -1061,8 +1099,12 @@ def capture(self, source, options={}):
1061
1099
body = body ["transaction" ]
1062
1100
transaction = processout .Transaction (self ._client )
1063
1101
return_values .append (transaction .fill_with_data (body ))
1102
+ body = response .body
1103
+ body = body ["customer_action" ]
1104
+ customerAction = processout .CustomerAction (self ._client )
1105
+ return_values .append (customerAction .fill_with_data (body ))
1064
1106
1065
- return return_values [ 0 ]
1107
+ return tuple ( return_values )
1066
1108
1067
1109
def fetch_customer (self , options = {}):
1068
1110
"""Get the customer linked to the invoice.
@@ -1183,12 +1225,15 @@ def process_native_payment(self, invoice_id, options={}):
1183
1225
return_values = []
1184
1226
1185
1227
body = response .body
1186
- invoicesProcessNativePaymentResponse = processout .InvoicesProcessNativePaymentResponse (
1187
- self ._client )
1188
- return_values .append (
1189
- invoicesProcessNativePaymentResponse .fill_with_data (body ))
1228
+ body = body ["transaction" ]
1229
+ transaction = processout .Transaction (self ._client )
1230
+ return_values .append (transaction .fill_with_data (body ))
1231
+ body = response .body
1232
+ body = body ["native_apm" ]
1233
+ nativeAPMResponse = processout .NativeAPMResponse (self ._client )
1234
+ return_values .append (nativeAPMResponse .fill_with_data (body ))
1190
1235
1191
- return return_values [ 0 ]
1236
+ return tuple ( return_values )
1192
1237
1193
1238
def initiate_three_d_s (self , source , options = {}):
1194
1239
"""Initiate a 3-D Secure authentication
@@ -1330,7 +1375,8 @@ def create(self, options={}):
1330
1375
'billing' : self .billing ,
1331
1376
'unsupported_feature_bypass' : self .unsupported_feature_bypass ,
1332
1377
'verification' : self .verification ,
1333
- 'auto_capture_at' : self .auto_capture_at
1378
+ 'auto_capture_at' : self .auto_capture_at ,
1379
+ 'expires_at' : self .expires_at
1334
1380
}
1335
1381
1336
1382
response = Response (request .post (path , data , options ))
@@ -1366,3 +1412,23 @@ def find(self, invoice_id, options={}):
1366
1412
return_values .append (obj .fill_with_data (body ))
1367
1413
1368
1414
return return_values [0 ]
1415
+
1416
+ def delete (self , invoice_id , options = {}):
1417
+ """Delete an invoice by its ID. Only invoices that have not been used yet can be deleted.
1418
+ Keyword argument:
1419
+ invoice_id -- ID of the invoice
1420
+ options -- Options for the request"""
1421
+ self .fill_with_data (options )
1422
+
1423
+ request = Request (self ._client )
1424
+ path = "/invoices/" + quote_plus (invoice_id ) + ""
1425
+ data = {
1426
+
1427
+ }
1428
+
1429
+ response = Response (request .delete (path , data , options ))
1430
+ return_values = []
1431
+
1432
+ return_values .append (response .success )
1433
+
1434
+ return return_values [0 ]
0 commit comments