Skip to content

Commit f5548cf

Browse files
feat: add-new-operation-error-message-field
1 parent ead7ade commit f5548cf

File tree

6 files changed

+112
-9
lines changed

6 files changed

+112
-9
lines changed

processout/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
from processout.errorcodes import ErrorCodes
7272
from processout.categoryerrorcodes import CategoryErrorCodes
7373
from processout.externalthreeds import ExternalThreeDS
74-
from processout.nativeapmtransactiondetails import NativeAPMTransactionDetails
7574
from processout.nativeapmtransactiondetailsgateway import NativeAPMTransactionDetailsGateway
7675
from processout.nativeapmtransactiondetailsinvoice import NativeAPMTransactionDetailsInvoice
76+
from processout.nativeapmtransactiondetails import NativeAPMTransactionDetails
7777

7878
from processout.gatewayrequest import GatewayRequest
7979

processout/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,12 +451,6 @@ def new_external_three_ds(self, prefill=None):
451451
prefill -- Data used to prefill the object (optional)"""
452452
return processout.ExternalThreeDS(self, prefill)
453453

454-
def new_native_apm_transaction_details(self, prefill=None):
455-
"""Create a new NativeAPMTransactionDetails instance
456-
Keyword argument:
457-
prefill -- Data used to prefill the object (optional)"""
458-
return processout.NativeAPMTransactionDetails(self, prefill)
459-
460454
def new_native_apm_transaction_details_gateway(self, prefill=None):
461455
"""Create a new NativeAPMTransactionDetailsGateway instance
462456
Keyword argument:
@@ -468,3 +462,9 @@ def new_native_apm_transaction_details_invoice(self, prefill=None):
468462
Keyword argument:
469463
prefill -- Data used to prefill the object (optional)"""
470464
return processout.NativeAPMTransactionDetailsInvoice(self, prefill)
465+
466+
def new_native_apm_transaction_details(self, prefill=None):
467+
"""Create a new NativeAPMTransactionDetails instance
468+
Keyword argument:
469+
prefill -- Data used to prefill the object (optional)"""
470+
return processout.NativeAPMTransactionDetails(self, prefill)

processout/customer.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def __init__(self, client, prefill=None):
2929
self._email = None
3030
self._first_name = None
3131
self._last_name = None
32+
self._company_name = None
3233
self._address1 = None
3334
self._address2 = None
3435
self._city = None
@@ -272,6 +273,19 @@ def last_name(self, val):
272273
self._last_name = val
273274
return self
274275

276+
@property
277+
def company_name(self):
278+
"""Get company_name"""
279+
return self._company_name
280+
281+
@company_name.setter
282+
def company_name(self, val):
283+
"""Set company_name
284+
Keyword argument:
285+
val -- New company_name value"""
286+
self._company_name = val
287+
return self
288+
275289
@property
276290
def address1(self):
277291
"""Get address1"""
@@ -532,6 +546,8 @@ def fill_with_data(self, data):
532546
self.first_name = data["first_name"]
533547
if "last_name" in data.keys():
534548
self.last_name = data["last_name"]
549+
if "company_name" in data.keys():
550+
self.company_name = data["company_name"]
535551
if "address1" in data.keys():
536552
self.address1 = data["address1"]
537553
if "address2" in data.keys():
@@ -584,6 +600,7 @@ def to_json(self):
584600
"email": self.email,
585601
"first_name": self.first_name,
586602
"last_name": self.last_name,
603+
"company_name": self.company_name,
587604
"address1": self.address1,
588605
"address2": self.address2,
589606
"city": self.city,
@@ -771,6 +788,7 @@ def create(self, options={}):
771788
'email': self.email,
772789
'first_name': self.first_name,
773790
'last_name': self.last_name,
791+
'company_name': self.company_name,
774792
'address1': self.address1,
775793
'address2': self.address2,
776794
'city': self.city,
@@ -838,6 +856,7 @@ def save(self, options={}):
838856
'email': self.email,
839857
'first_name': self.first_name,
840858
'last_name': self.last_name,
859+
'company_name': self.company_name,
841860
'address1': self.address1,
842861
'address2': self.address2,
843862
'city': self.city,

processout/invoice.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,3 +1436,53 @@ def delete(self, invoice_id, options={}):
14361436
return_values.append(response.success)
14371437

14381438
return return_values[0]
1439+
1440+
def sync_with_psp(self, invoice_id, options={}):
1441+
"""Refresh invoice by its ID with PSP.
1442+
Keyword argument:
1443+
invoice_id -- ID of the invoice
1444+
options -- Options for the request"""
1445+
self.fill_with_data(options)
1446+
1447+
request = Request(self._client)
1448+
path = "/invoices/" + quote_plus(invoice_id) + "/sync-with-psp"
1449+
data = {
1450+
1451+
}
1452+
1453+
response = Response(request.put(path, data, options))
1454+
return_values = []
1455+
1456+
body = response.body
1457+
body = body["invoice"]
1458+
1459+
obj = processout.Invoice(self._client)
1460+
return_values.append(obj.fill_with_data(body))
1461+
1462+
return return_values[0]
1463+
1464+
def update(self, invoice_id, options={}):
1465+
"""Update invoice by its ID.
1466+
Keyword argument:
1467+
invoice_id -- ID of the invoice
1468+
options -- Options for the request"""
1469+
self.fill_with_data(options)
1470+
1471+
request = Request(self._client)
1472+
path = "/invoices/" + quote_plus(invoice_id) + ""
1473+
data = {
1474+
'amount': self.amount,
1475+
'tax': self.tax,
1476+
'details': self.details,
1477+
'shipping': self.shipping
1478+
}
1479+
1480+
response = Response(request.put(path, data, options))
1481+
return_values = []
1482+
1483+
body = response.body
1484+
body = body["invoice"]
1485+
1486+
return_values.append(self.fill_with_data(body))
1487+
1488+
return return_values[0]

processout/transactionoperation.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ def __init__(self, client, prefill=None):
3434
self._gateway_operation_id = None
3535
self._arn = None
3636
self._error_code = None
37+
self._error_message = None
3738
self._gateway_data = None
3839
self._payment_data_three_d_s_request = None
3940
self._payment_data_three_d_s_authentication = None
4041
self._payment_data_network_authentication = None
4142
self._initial_scheme_transaction_id = None
4243
self._scheme_id = None
44+
self._processed_with_network_token = None
4345
self._payment_type = None
4446
self._metadata = None
4547
self._gateway_fee = None
@@ -317,6 +319,19 @@ def error_code(self, val):
317319
self._error_code = val
318320
return self
319321

322+
@property
323+
def error_message(self):
324+
"""Get error_message"""
325+
return self._error_message
326+
327+
@error_message.setter
328+
def error_message(self, val):
329+
"""Set error_message
330+
Keyword argument:
331+
val -- New error_message value"""
332+
self._error_message = val
333+
return self
334+
320335
@property
321336
def gateway_data(self):
322337
"""Get gateway_data"""
@@ -422,6 +437,19 @@ def scheme_id(self, val):
422437
self._scheme_id = val
423438
return self
424439

440+
@property
441+
def processed_with_network_token(self):
442+
"""Get processed_with_network_token"""
443+
return self._processed_with_network_token
444+
445+
@processed_with_network_token.setter
446+
def processed_with_network_token(self, val):
447+
"""Set processed_with_network_token
448+
Keyword argument:
449+
val -- New processed_with_network_token value"""
450+
self._processed_with_network_token = val
451+
return self
452+
425453
@property
426454
def payment_type(self):
427455
"""Get payment_type"""
@@ -514,6 +542,8 @@ def fill_with_data(self, data):
514542
self.arn = data["arn"]
515543
if "error_code" in data.keys():
516544
self.error_code = data["error_code"]
545+
if "error_message" in data.keys():
546+
self.error_message = data["error_message"]
517547
if "gateway_data" in data.keys():
518548
self.gateway_data = data["gateway_data"]
519549
if "payment_data_three_d_s_request" in data.keys():
@@ -526,6 +556,8 @@ def fill_with_data(self, data):
526556
self.initial_scheme_transaction_id = data["initial_scheme_transaction_id"]
527557
if "scheme_id" in data.keys():
528558
self.scheme_id = data["scheme_id"]
559+
if "processed_with_network_token" in data.keys():
560+
self.processed_with_network_token = data["processed_with_network_token"]
529561
if "payment_type" in data.keys():
530562
self.payment_type = data["payment_type"]
531563
if "metadata" in data.keys():
@@ -557,12 +589,14 @@ def to_json(self):
557589
"gateway_operation_id": self.gateway_operation_id,
558590
"arn": self.arn,
559591
"error_code": self.error_code,
592+
"error_message": self.error_message,
560593
"gateway_data": self.gateway_data,
561594
"payment_data_three_d_s_request": self.payment_data_three_d_s_request,
562595
"payment_data_three_d_s_authentication": self.payment_data_three_d_s_authentication,
563596
"payment_data_network_authentication": self.payment_data_network_authentication,
564597
"initial_scheme_transaction_id": self.initial_scheme_transaction_id,
565598
"scheme_id": self.scheme_id,
599+
"processed_with_network_token": self.processed_with_network_token,
566600
"payment_type": self.payment_type,
567601
"metadata": self.metadata,
568602
"gateway_fee": self.gateway_fee,

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
setup(
44
name = 'processout',
55
packages = ['processout', 'processout.errors', 'processout.networking'],
6-
version = '7.1.0',
6+
version = '7.2.0',
77
description = 'ProcessOut API bindings.',
88
author = 'ProcessOut',
99
author_email = '[email protected]',
1010
url = 'https://github.com/processout/processout-python',
11-
download_url = 'https://github.com/processout/processout-python/tarball/7.1.0',
11+
download_url = 'https://github.com/processout/processout-python/tarball/7.2.0',
1212
keywords = ['ProcessOut', 'api', 'bindings'],
1313
classifiers = [],
1414
)

0 commit comments

Comments
 (0)