Skip to content

Commit 0e4d739

Browse files
feat: added acquirer_name to transaction
1 parent f2b5768 commit 0e4d739

File tree

8 files changed

+229
-3
lines changed

8 files changed

+229
-3
lines changed

processout/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from processout.addon import Addon
77
from processout.apirequest import APIRequest
88
from processout.apiversion import APIVersion
9+
from processout.applepayalternativemerchantcertificates import ApplePayAlternativeMerchantCertificates
10+
from processout.alternativemerchantcertificate import AlternativeMerchantCertificate
911
from processout.balances import Balances
1012
from processout.balance import Balance
1113
from processout.card import Card
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
try:
2+
from urllib.parse import quote_plus
3+
except ImportError:
4+
from urllib import quote_plus
5+
6+
import processout
7+
import json
8+
9+
from processout.networking.request import Request
10+
from processout.networking.response import Response
11+
12+
# The content of this file was automatically generated
13+
14+
15+
class AlternativeMerchantCertificate(object):
16+
def __init__(self, client, prefill=None):
17+
self._client = client
18+
19+
self._id = None
20+
if prefill is not None:
21+
self.fill_with_data(prefill)
22+
23+
@property
24+
def id(self):
25+
"""Get id"""
26+
return self._id
27+
28+
@id.setter
29+
def id(self, val):
30+
"""Set id
31+
Keyword argument:
32+
val -- New id value"""
33+
self._id = val
34+
return self
35+
36+
def fill_with_data(self, data):
37+
"""Fill the current object with the new values pulled from data
38+
Keyword argument:
39+
data -- The data from which to pull the new values"""
40+
if "id" in data.keys():
41+
self.id = data["id"]
42+
43+
return self
44+
45+
def to_json(self):
46+
return {
47+
"id": self.id,
48+
}
49+
50+
def save(self, options={}):
51+
"""Save new alternative apple pay certificates
52+
Keyword argument:
53+
54+
options -- Options for the request"""
55+
self.fill_with_data(options)
56+
57+
request = Request(self._client)
58+
path = "/projects/applepay/alternative-merchant-certificates"
59+
data = {
60+
61+
}
62+
63+
response = Response(request.post(path, data, options))
64+
return_values = []
65+
66+
body = response.body
67+
body = body["alternative_merchant_certificate"]
68+
alternativeMerchantCertificate = processout.AlternativeMerchantCertificate(
69+
self._client)
70+
return_values.append(
71+
alternativeMerchantCertificate.fill_with_data(body))
72+
73+
return return_values[0]
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
try:
2+
from urllib.parse import quote_plus
3+
except ImportError:
4+
from urllib import quote_plus
5+
6+
import processout
7+
import json
8+
9+
from processout.networking.request import Request
10+
from processout.networking.response import Response
11+
12+
# The content of this file was automatically generated
13+
14+
15+
class ApplePayAlternativeMerchantCertificates(object):
16+
def __init__(self, client, prefill=None):
17+
self._client = client
18+
19+
self._alternative_merchant_certificates = None
20+
if prefill is not None:
21+
self.fill_with_data(prefill)
22+
23+
@property
24+
def alternative_merchant_certificates(self):
25+
"""Get alternative_merchant_certificates"""
26+
return self._alternative_merchant_certificates
27+
28+
@alternative_merchant_certificates.setter
29+
def alternative_merchant_certificates(self, val):
30+
"""Set alternative_merchant_certificates
31+
Keyword argument:
32+
val -- New alternative_merchant_certificates value"""
33+
if val is None:
34+
self._alternative_merchant_certificates = []
35+
return self
36+
37+
if len(val) > 0 and isinstance(
38+
val[0], processout.AlternativeMerchantCertificate):
39+
self._alternative_merchant_certificates = val
40+
else:
41+
l = []
42+
for v in val:
43+
obj = processout.AlternativeMerchantCertificate(self._client)
44+
obj.fill_with_data(v)
45+
l.append(obj)
46+
self._alternative_merchant_certificates = l
47+
return self
48+
49+
def fill_with_data(self, data):
50+
"""Fill the current object with the new values pulled from data
51+
Keyword argument:
52+
data -- The data from which to pull the new values"""
53+
if "alternative_merchant_certificates" in data.keys():
54+
self.alternative_merchant_certificates = data["alternative_merchant_certificates"]
55+
56+
return self
57+
58+
def to_json(self):
59+
return {
60+
"alternative_merchant_certificates": self.alternative_merchant_certificates,
61+
}
62+
63+
def fetch(self, options={}):
64+
"""Fetch the project's alternative certificates by ID
65+
Keyword argument:
66+
67+
options -- Options for the request"""
68+
self.fill_with_data(options)
69+
70+
request = Request(self._client)
71+
path = "/projects/applepay/alternative-merchant-certificates"
72+
data = {
73+
74+
}
75+
76+
response = Response(request.get(path, data, options))
77+
return_values = []
78+
79+
body = response.body
80+
body = body["applepay_certificates"]
81+
applePayAlternativeMerchantCertificates = processout.ApplePayAlternativeMerchantCertificates(
82+
self._client)
83+
return_values.append(
84+
applePayAlternativeMerchantCertificates.fill_with_data(body))
85+
86+
return return_values[0]

processout/client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ def new_api_version(self, prefill=None):
5656
prefill -- Data used to prefill the object (optional)"""
5757
return processout.APIVersion(self, prefill)
5858

59+
def new_apple_pay_alternative_merchant_certificates(self, prefill=None):
60+
"""Create a new ApplePayAlternativeMerchantCertificates instance
61+
Keyword argument:
62+
prefill -- Data used to prefill the object (optional)"""
63+
return processout.ApplePayAlternativeMerchantCertificates(
64+
self, prefill)
65+
66+
def new_alternative_merchant_certificate(self, prefill=None):
67+
"""Create a new AlternativeMerchantCertificate instance
68+
Keyword argument:
69+
prefill -- Data used to prefill the object (optional)"""
70+
return processout.AlternativeMerchantCertificate(self, prefill)
71+
5972
def new_balances(self, prefill=None):
6073
"""Create a new Balances instance
6174
Keyword argument:

processout/invoicedetail.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class InvoiceDetail(object):
1616
def __init__(self, client, prefill=None):
1717
self._client = client
1818

19+
self._id = None
1920
self._name = None
2021
self._type = None
2122
self._amount = None
@@ -34,6 +35,19 @@ def __init__(self, client, prefill=None):
3435
if prefill is not None:
3536
self.fill_with_data(prefill)
3637

38+
@property
39+
def id(self):
40+
"""Get id"""
41+
return self._id
42+
43+
@id.setter
44+
def id(self, val):
45+
"""Set id
46+
Keyword argument:
47+
val -- New id value"""
48+
self._id = val
49+
return self
50+
3751
@property
3852
def name(self):
3953
"""Get name"""
@@ -233,6 +247,8 @@ def fill_with_data(self, data):
233247
"""Fill the current object with the new values pulled from data
234248
Keyword argument:
235249
data -- The data from which to pull the new values"""
250+
if "id" in data.keys():
251+
self.id = data["id"]
236252
if "name" in data.keys():
237253
self.name = data["name"]
238254
if "type" in data.keys():
@@ -268,6 +284,7 @@ def fill_with_data(self, data):
268284

269285
def to_json(self):
270286
return {
287+
"id": self.id,
271288
"name": self.name,
272289
"type": self.type,
273290
"amount": self.amount,

processout/refund.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __init__(self, client, prefill=None):
2626
self._metadata = None
2727
self._sandbox = None
2828
self._created_at = None
29+
self._invoice_detail_ids = None
2930
if prefill is not None:
3031
self.fill_with_data(prefill)
3132

@@ -168,6 +169,19 @@ def created_at(self, val):
168169
self._created_at = val
169170
return self
170171

172+
@property
173+
def invoice_detail_ids(self):
174+
"""Get invoice_detail_ids"""
175+
return self._invoice_detail_ids
176+
177+
@invoice_detail_ids.setter
178+
def invoice_detail_ids(self, val):
179+
"""Set invoice_detail_ids
180+
Keyword argument:
181+
val -- New invoice_detail_ids value"""
182+
self._invoice_detail_ids = val
183+
return self
184+
171185
def fill_with_data(self, data):
172186
"""Fill the current object with the new values pulled from data
173187
Keyword argument:
@@ -192,6 +206,8 @@ def fill_with_data(self, data):
192206
self.sandbox = data["sandbox"]
193207
if "created_at" in data.keys():
194208
self.created_at = data["created_at"]
209+
if "invoice_detail_ids" in data.keys():
210+
self.invoice_detail_ids = data["invoice_detail_ids"]
195211

196212
return self
197213

@@ -207,6 +223,7 @@ def to_json(self):
207223
"metadata": self.metadata,
208224
"sandbox": self.sandbox,
209225
"created_at": self.created_at,
226+
"invoice_detail_ids": self.invoice_detail_ids,
210227
}
211228

212229
def fetch_transaction_refunds(self, transaction_id, options={}):
@@ -275,7 +292,8 @@ def create(self, options={}):
275292
'amount': self.amount,
276293
'metadata': self.metadata,
277294
'reason': self.reason,
278-
'information': self.information
295+
'information': self.information,
296+
'invoice_detail_ids': self.invoice_detail_ids
279297
}
280298

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

processout/transaction.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def __init__(self, client, prefill=None):
4747
self._currency = None
4848
self._error_code = None
4949
self._error_message = None
50+
self._acquirer_name = None
5051
self._gateway_name = None
5152
self._three_d_s_status = None
5253
self._status = None
@@ -564,6 +565,19 @@ def error_message(self, val):
564565
self._error_message = val
565566
return self
566567

568+
@property
569+
def acquirer_name(self):
570+
"""Get acquirer_name"""
571+
return self._acquirer_name
572+
573+
@acquirer_name.setter
574+
def acquirer_name(self, val):
575+
"""Set acquirer_name
576+
Keyword argument:
577+
val -- New acquirer_name value"""
578+
self._acquirer_name = val
579+
return self
580+
567581
@property
568582
def gateway_name(self):
569583
"""Get gateway_name"""
@@ -938,6 +952,8 @@ def fill_with_data(self, data):
938952
self.error_code = data["error_code"]
939953
if "error_message" in data.keys():
940954
self.error_message = data["error_message"]
955+
if "acquirer_name" in data.keys():
956+
self.acquirer_name = data["acquirer_name"]
941957
if "gateway_name" in data.keys():
942958
self.gateway_name = data["gateway_name"]
943959
if "three_d_s_status" in data.keys():
@@ -1020,6 +1036,7 @@ def to_json(self):
10201036
"currency": self.currency,
10211037
"error_code": self.error_code,
10221038
"error_message": self.error_message,
1039+
"acquirer_name": self.acquirer_name,
10231040
"gateway_name": self.gateway_name,
10241041
"three_d_s_status": self.three_d_s_status,
10251042
"status": self.status,

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

0 commit comments

Comments
 (0)