Skip to content

Commit f028d55

Browse files
add partial void support
1 parent 2f667b5 commit f028d55

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

processout/invoice.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,8 @@ def void(self, options={}):
10641064
request = Request(self._client)
10651065
path = "/invoices/" + quote_plus(self.id) + "/void"
10661066
data = {
1067-
'metadata': options.get("metadata")
1067+
'metadata': options.get("metadata"),
1068+
'amount': options.get("amount")
10681069
}
10691070

10701071
response = Response(request.post(path, data, options))

processout/transaction.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def __init__(self, client, prefill=None):
4545
self._refunded_amount_local = None
4646
self._available_amount = None
4747
self._available_amount_local = None
48+
self._voided_amount = None
49+
self._voided_amount_local = None
4850
self._currency = None
4951
self._error_code = None
5052
self._error_message = None
@@ -552,6 +554,32 @@ def available_amount_local(self, val):
552554
self._available_amount_local = val
553555
return self
554556

557+
@property
558+
def voided_amount(self):
559+
"""Get voided_amount"""
560+
return self._voided_amount
561+
562+
@voided_amount.setter
563+
def voided_amount(self, val):
564+
"""Set voided_amount
565+
Keyword argument:
566+
val -- New voided_amount value"""
567+
self._voided_amount = val
568+
return self
569+
570+
@property
571+
def voided_amount_local(self):
572+
"""Get voided_amount_local"""
573+
return self._voided_amount_local
574+
575+
@voided_amount_local.setter
576+
def voided_amount_local(self, val):
577+
"""Set voided_amount_local
578+
Keyword argument:
579+
val -- New voided_amount_local value"""
580+
self._voided_amount_local = val
581+
return self
582+
555583
@property
556584
def currency(self):
557585
"""Get currency"""
@@ -1014,6 +1042,10 @@ def fill_with_data(self, data):
10141042
self.available_amount = data["available_amount"]
10151043
if "available_amount_local" in data.keys():
10161044
self.available_amount_local = data["available_amount_local"]
1045+
if "voided_amount" in data.keys():
1046+
self.voided_amount = data["voided_amount"]
1047+
if "voided_amount_local" in data.keys():
1048+
self.voided_amount_local = data["voided_amount_local"]
10171049
if "currency" in data.keys():
10181050
self.currency = data["currency"]
10191051
if "error_code" in data.keys():
@@ -1108,6 +1140,8 @@ def to_json(self):
11081140
"refunded_amount_local": self.refunded_amount_local,
11091141
"available_amount": self.available_amount,
11101142
"available_amount_local": self.available_amount_local,
1143+
"voided_amount": self.voided_amount,
1144+
"voided_amount_local": self.voided_amount_local,
11111145
"currency": self.currency,
11121146
"error_code": self.error_code,
11131147
"error_message": self.error_message,

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 = '6.28.0',
6+
version = '6.29.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/6.28.0',
11+
download_url = 'https://github.com/processout/processout-python/tarball/6.29.0',
1212
keywords = ['ProcessOut', 'api', 'bindings'],
1313
classifiers = [],
1414
)

0 commit comments

Comments
 (0)