diff --git a/processout/__init__.py b/processout/__init__.py index e89b762..818fb62 100644 --- a/processout/__init__.py +++ b/processout/__init__.py @@ -40,6 +40,9 @@ from processout.invoicebilling import InvoiceBilling from processout.unsupportedfeaturebypass import UnsupportedFeatureBypass from processout.invoicedetail import InvoiceDetail +from processout.invoicesubmerchant import InvoiceSubmerchant +from processout.submerchantphonenumber import SubmerchantPhoneNumber +from processout.submerchantaddress import SubmerchantAddress from processout.customeraction import CustomerAction from processout.dunningaction import DunningAction from processout.payout import Payout diff --git a/processout/client.py b/processout/client.py index 8981db4..3641254 100644 --- a/processout/client.py +++ b/processout/client.py @@ -265,6 +265,24 @@ def new_invoice_detail(self, prefill=None): prefill -- Data used to prefill the object (optional)""" return processout.InvoiceDetail(self, prefill) + def new_invoice_submerchant(self, prefill=None): + """Create a new InvoiceSubmerchant instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.InvoiceSubmerchant(self, prefill) + + def new_submerchant_phone_number(self, prefill=None): + """Create a new SubmerchantPhoneNumber instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.SubmerchantPhoneNumber(self, prefill) + + def new_submerchant_address(self, prefill=None): + """Create a new SubmerchantAddress instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.SubmerchantAddress(self, prefill) + def new_customer_action(self, prefill=None): """Create a new CustomerAction instance Keyword argument: diff --git a/processout/invoice.py b/processout/invoice.py index bcff342..6e8228b 100755 --- a/processout/invoice.py +++ b/processout/invoice.py @@ -28,6 +28,7 @@ def __init__(self, client, prefill=None): self._token = None self._token_id = None self._details = None + self._submerchant = None self._url = None self._url_qrcode = None self._name = None @@ -282,6 +283,28 @@ def details(self, val): self._details = l return self + @property + def submerchant(self): + """Get submerchant""" + return self._submerchant + + @submerchant.setter + def submerchant(self, val): + """Set submerchant + Keyword argument: + val -- New submerchant value""" + if val is None: + self._submerchant = val + return self + + if isinstance(val, dict): + obj = processout.InvoiceSubmerchant(self._client) + obj.fill_with_data(val) + self._submerchant = obj + else: + self._submerchant = val + return self + @property def url(self): """Get url""" @@ -876,6 +899,8 @@ def fill_with_data(self, data): self.token_id = data["token_id"] if "details" in data.keys(): self.details = data["details"] + if "submerchant" in data.keys(): + self.submerchant = data["submerchant"] if "url" in data.keys(): self.url = data["url"] if "url_qrcode" in data.keys(): @@ -969,6 +994,7 @@ def to_json(self): "token": self.token, "token_id": self.token_id, "details": self.details, + "submerchant": self.submerchant, "url": self.url, "url_qrcode": self.url_qrcode, "name": self.name, @@ -1354,6 +1380,7 @@ def create(self, options={}): 'currency': self.currency, 'metadata': self.metadata, 'details': self.details, + 'submerchant': self.submerchant, 'exemption_reason_3ds2': self.exemption_reason_3ds2, 'sca_exemption_reason': self.sca_exemption_reason, 'challenge_indicator': self.challenge_indicator, diff --git a/processout/invoicesubmerchant.py b/processout/invoicesubmerchant.py new file mode 100755 index 0000000..59fb235 --- /dev/null +++ b/processout/invoicesubmerchant.py @@ -0,0 +1,202 @@ +try: + from urllib.parse import quote_plus +except ImportError: + from urllib import quote_plus + +import processout +import json + +from processout.networking.request import Request +from processout.networking.response import Response + +# The content of this file was automatically generated + + +class InvoiceSubmerchant(object): + def __init__(self, client, prefill=None): + self._client = client + + self._id = None + self._name = None + self._reference = None + self._mcc = None + self._phone_number = None + self._email = None + self._address = None + self._tax_reference = None + self._service_establishment_number = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def id(self): + """Get id""" + return self._id + + @id.setter + def id(self, val): + """Set id + Keyword argument: + val -- New id value""" + self._id = val + return self + + @property + def name(self): + """Get name""" + return self._name + + @name.setter + def name(self, val): + """Set name + Keyword argument: + val -- New name value""" + self._name = val + return self + + @property + def reference(self): + """Get reference""" + return self._reference + + @reference.setter + def reference(self, val): + """Set reference + Keyword argument: + val -- New reference value""" + self._reference = val + return self + + @property + def mcc(self): + """Get mcc""" + return self._mcc + + @mcc.setter + def mcc(self, val): + """Set mcc + Keyword argument: + val -- New mcc value""" + self._mcc = val + return self + + @property + def phone_number(self): + """Get phone_number""" + return self._phone_number + + @phone_number.setter + def phone_number(self, val): + """Set phone_number + Keyword argument: + val -- New phone_number value""" + if val is None: + self._phone_number = val + return self + + if isinstance(val, dict): + obj = processout.SubmerchantPhoneNumber(self._client) + obj.fill_with_data(val) + self._phone_number = obj + else: + self._phone_number = val + return self + + @property + def email(self): + """Get email""" + return self._email + + @email.setter + def email(self, val): + """Set email + Keyword argument: + val -- New email value""" + self._email = val + return self + + @property + def address(self): + """Get address""" + return self._address + + @address.setter + def address(self, val): + """Set address + Keyword argument: + val -- New address value""" + if val is None: + self._address = val + return self + + if isinstance(val, dict): + obj = processout.SubmerchantAddress(self._client) + obj.fill_with_data(val) + self._address = obj + else: + self._address = val + return self + + @property + def tax_reference(self): + """Get tax_reference""" + return self._tax_reference + + @tax_reference.setter + def tax_reference(self, val): + """Set tax_reference + Keyword argument: + val -- New tax_reference value""" + self._tax_reference = val + return self + + @property + def service_establishment_number(self): + """Get service_establishment_number""" + return self._service_establishment_number + + @service_establishment_number.setter + def service_establishment_number(self, val): + """Set service_establishment_number + Keyword argument: + val -- New service_establishment_number value""" + self._service_establishment_number = val + return self + + def fill_with_data(self, data): + """Fill the current object with the new values pulled from data + Keyword argument: + data -- The data from which to pull the new values""" + if "id" in data.keys(): + self.id = data["id"] + if "name" in data.keys(): + self.name = data["name"] + if "reference" in data.keys(): + self.reference = data["reference"] + if "mcc" in data.keys(): + self.mcc = data["mcc"] + if "phone_number" in data.keys(): + self.phone_number = data["phone_number"] + if "email" in data.keys(): + self.email = data["email"] + if "address" in data.keys(): + self.address = data["address"] + if "tax_reference" in data.keys(): + self.tax_reference = data["tax_reference"] + if "service_establishment_number" in data.keys(): + self.service_establishment_number = data["service_establishment_number"] + + return self + + def to_json(self): + return { + "id": self.id, + "name": self.name, + "reference": self.reference, + "mcc": self.mcc, + "phone_number": self.phone_number, + "email": self.email, + "address": self.address, + "tax_reference": self.tax_reference, + "service_establishment_number": self.service_establishment_number, + } diff --git a/processout/submerchantaddress.py b/processout/submerchantaddress.py new file mode 100755 index 0000000..696ee5f --- /dev/null +++ b/processout/submerchantaddress.py @@ -0,0 +1,150 @@ +try: + from urllib.parse import quote_plus +except ImportError: + from urllib import quote_plus + +import processout +import json + +from processout.networking.request import Request +from processout.networking.response import Response + +# The content of this file was automatically generated + + +class SubmerchantAddress(object): + def __init__(self, client, prefill=None): + self._client = client + + self._line1 = None + self._line2 = None + self._city = None + self._state = None + self._country_code = None + self._zip = None + self._county = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def line1(self): + """Get line1""" + return self._line1 + + @line1.setter + def line1(self, val): + """Set line1 + Keyword argument: + val -- New line1 value""" + self._line1 = val + return self + + @property + def line2(self): + """Get line2""" + return self._line2 + + @line2.setter + def line2(self, val): + """Set line2 + Keyword argument: + val -- New line2 value""" + self._line2 = val + return self + + @property + def city(self): + """Get city""" + return self._city + + @city.setter + def city(self, val): + """Set city + Keyword argument: + val -- New city value""" + self._city = val + return self + + @property + def state(self): + """Get state""" + return self._state + + @state.setter + def state(self, val): + """Set state + Keyword argument: + val -- New state value""" + self._state = val + return self + + @property + def country_code(self): + """Get country_code""" + return self._country_code + + @country_code.setter + def country_code(self, val): + """Set country_code + Keyword argument: + val -- New country_code value""" + self._country_code = val + return self + + @property + def zip(self): + """Get zip""" + return self._zip + + @zip.setter + def zip(self, val): + """Set zip + Keyword argument: + val -- New zip value""" + self._zip = val + return self + + @property + def county(self): + """Get county""" + return self._county + + @county.setter + def county(self, val): + """Set county + Keyword argument: + val -- New county value""" + self._county = val + return self + + def fill_with_data(self, data): + """Fill the current object with the new values pulled from data + Keyword argument: + data -- The data from which to pull the new values""" + if "line1" in data.keys(): + self.line1 = data["line1"] + if "line2" in data.keys(): + self.line2 = data["line2"] + if "city" in data.keys(): + self.city = data["city"] + if "state" in data.keys(): + self.state = data["state"] + if "country_code" in data.keys(): + self.country_code = data["country_code"] + if "zip" in data.keys(): + self.zip = data["zip"] + if "county" in data.keys(): + self.county = data["county"] + + return self + + def to_json(self): + return { + "line1": self.line1, + "line2": self.line2, + "city": self.city, + "state": self.state, + "country_code": self.country_code, + "zip": self.zip, + "county": self.county, + } diff --git a/processout/submerchantphonenumber.py b/processout/submerchantphonenumber.py new file mode 100755 index 0000000..9da80e4 --- /dev/null +++ b/processout/submerchantphonenumber.py @@ -0,0 +1,65 @@ +try: + from urllib.parse import quote_plus +except ImportError: + from urllib import quote_plus + +import processout +import json + +from processout.networking.request import Request +from processout.networking.response import Response + +# The content of this file was automatically generated + + +class SubmerchantPhoneNumber(object): + def __init__(self, client, prefill=None): + self._client = client + + self._dialing_code = None + self._number = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def dialing_code(self): + """Get dialing_code""" + return self._dialing_code + + @dialing_code.setter + def dialing_code(self, val): + """Set dialing_code + Keyword argument: + val -- New dialing_code value""" + self._dialing_code = val + return self + + @property + def number(self): + """Get number""" + return self._number + + @number.setter + def number(self, val): + """Set number + Keyword argument: + val -- New number value""" + self._number = val + return self + + def fill_with_data(self, data): + """Fill the current object with the new values pulled from data + Keyword argument: + data -- The data from which to pull the new values""" + if "dialing_code" in data.keys(): + self.dialing_code = data["dialing_code"] + if "number" in data.keys(): + self.number = data["number"] + + return self + + def to_json(self): + return { + "dialing_code": self.dialing_code, + "number": self.number, + } diff --git a/processout/token.py b/processout/token.py index 5155f67..a7d6333 100755 --- a/processout/token.py +++ b/processout/token.py @@ -38,6 +38,7 @@ def __init__(self, client, prefill=None): self._manual_invoice_cancellation = None self._verification_status = None self._can_get_balance = None + self._webhook_url = None if prefill is not None: self.fill_with_data(prefill) @@ -363,6 +364,19 @@ def can_get_balance(self, val): self._can_get_balance = val return self + @property + def webhook_url(self): + """Get webhook_url""" + return self._webhook_url + + @webhook_url.setter + def webhook_url(self, val): + """Set webhook_url + Keyword argument: + val -- New webhook_url value""" + self._webhook_url = val + return self + def fill_with_data(self, data): """Fill the current object with the new values pulled from data Keyword argument: @@ -411,6 +425,8 @@ def fill_with_data(self, data): self.verification_status = data["verification_status"] if "can_get_balance" in data.keys(): self.can_get_balance = data["can_get_balance"] + if "webhook_url" in data.keys(): + self.webhook_url = data["webhook_url"] return self @@ -438,6 +454,7 @@ def to_json(self): "manual_invoice_cancellation": self.manual_invoice_cancellation, "verification_status": self.verification_status, "can_get_balance": self.can_get_balance, + "webhook_url": self.webhook_url, } def fetch_customer_tokens(self, customer_id, options={}): @@ -509,6 +526,7 @@ def create(self, options={}): 'description': self.description, 'invoice_id': self.invoice_id, 'manual_invoice_cancellation': self.manual_invoice_cancellation, + 'webhook_url': self.webhook_url, 'source': options.get("source"), 'settings': options.get("settings"), 'device': options.get("device"), diff --git a/setup.py b/setup.py index 56aff3f..bfe015b 100644 --- a/setup.py +++ b/setup.py @@ -3,12 +3,12 @@ setup( name = 'processout', packages = ['processout', 'processout.errors', 'processout.networking'], - version = '7.2.0', + version = '7.3.0', description = 'ProcessOut API bindings.', author = 'ProcessOut', author_email = 'hi@processout.com', url = 'https://github.com/processout/processout-python', - download_url = 'https://github.com/processout/processout-python/tarball/7.2.0', + download_url = 'https://github.com/processout/processout-python/tarball/7.3.0', keywords = ['ProcessOut', 'api', 'bindings'], classifiers = [], )