Skip to content

Commit 013f43e

Browse files
feat: Add create/update card; PayoutItemAmountBreakdowns (#15)
Co-authored-by: ProcessOut Fountain <[email protected]>
1 parent eee6c13 commit 013f43e

File tree

11 files changed

+1296
-2
lines changed

11 files changed

+1296
-2
lines changed

processout/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from processout.balance import Balance
1212
from processout.card import Card
1313
from processout.cardinformation import CardInformation
14+
from processout.phone import Phone
1415
from processout.coupon import Coupon
1516
from processout.customer import Customer
1617
from processout.customerphone import CustomerPhone
@@ -35,6 +36,7 @@
3536
from processout.dunningaction import DunningAction
3637
from processout.payout import Payout
3738
from processout.payoutitem import PayoutItem
39+
from processout.payoutitemamountbreakdowns import PayoutItemAmountBreakdowns
3840
from processout.plan import Plan
3941
from processout.product import Product
4042
from processout.project import Project
@@ -52,6 +54,11 @@
5254
from processout.transactionoperation import TransactionOperation
5355
from processout.webhook import Webhook
5456
from processout.webhookendpoint import WebhookEndpoint
57+
from processout.cardcreaterequest import CardCreateRequest
58+
from processout.device import Device
59+
from processout.cardcontact import CardContact
60+
from processout.cardshipping import CardShipping
61+
from processout.cardupdaterequest import CardUpdateRequest
5562
from processout.errorcodes import ErrorCodes
5663
from processout.categoryerrorcodes import CategoryErrorCodes
5764
from processout.nativeapmtransactiondetailsgateway import NativeAPMTransactionDetailsGateway

processout/cardcontact.py

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
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 CardContact(object):
16+
def __init__(self, client, prefill=None):
17+
self._client = client
18+
19+
self._address1 = None
20+
self._address2 = None
21+
self._city = None
22+
self._state = None
23+
self._country_code = None
24+
self._zip = None
25+
if prefill is not None:
26+
self.fill_with_data(prefill)
27+
28+
@property
29+
def address1(self):
30+
"""Get address1"""
31+
return self._address1
32+
33+
@address1.setter
34+
def address1(self, val):
35+
"""Set address1
36+
Keyword argument:
37+
val -- New address1 value"""
38+
self._address1 = val
39+
return self
40+
41+
@property
42+
def address2(self):
43+
"""Get address2"""
44+
return self._address2
45+
46+
@address2.setter
47+
def address2(self, val):
48+
"""Set address2
49+
Keyword argument:
50+
val -- New address2 value"""
51+
self._address2 = val
52+
return self
53+
54+
@property
55+
def city(self):
56+
"""Get city"""
57+
return self._city
58+
59+
@city.setter
60+
def city(self, val):
61+
"""Set city
62+
Keyword argument:
63+
val -- New city value"""
64+
self._city = val
65+
return self
66+
67+
@property
68+
def state(self):
69+
"""Get state"""
70+
return self._state
71+
72+
@state.setter
73+
def state(self, val):
74+
"""Set state
75+
Keyword argument:
76+
val -- New state value"""
77+
self._state = val
78+
return self
79+
80+
@property
81+
def country_code(self):
82+
"""Get country_code"""
83+
return self._country_code
84+
85+
@country_code.setter
86+
def country_code(self, val):
87+
"""Set country_code
88+
Keyword argument:
89+
val -- New country_code value"""
90+
self._country_code = val
91+
return self
92+
93+
@property
94+
def zip(self):
95+
"""Get zip"""
96+
return self._zip
97+
98+
@zip.setter
99+
def zip(self, val):
100+
"""Set zip
101+
Keyword argument:
102+
val -- New zip value"""
103+
self._zip = val
104+
return self
105+
106+
def fill_with_data(self, data):
107+
"""Fill the current object with the new values pulled from data
108+
Keyword argument:
109+
data -- The data from which to pull the new values"""
110+
if "address1" in data.keys():
111+
self.address1 = data["address1"]
112+
if "address2" in data.keys():
113+
self.address2 = data["address2"]
114+
if "city" in data.keys():
115+
self.city = data["city"]
116+
if "state" in data.keys():
117+
self.state = data["state"]
118+
if "country_code" in data.keys():
119+
self.country_code = data["country_code"]
120+
if "zip" in data.keys():
121+
self.zip = data["zip"]
122+
123+
return self
124+
125+
def to_json(self):
126+
return {
127+
"address1": self.address1,
128+
"address2": self.address2,
129+
"city": self.city,
130+
"state": self.state,
131+
"country_code": self.country_code,
132+
"zip": self.zip,
133+
}

0 commit comments

Comments
 (0)