diff --git a/processout/__init__.py b/processout/__init__.py index 818fb62..50692f0 100644 --- a/processout/__init__.py +++ b/processout/__init__.py @@ -9,6 +9,7 @@ from processout.alternativemerchantcertificate import AlternativeMerchantCertificate from processout.balances import Balances from processout.balance import Balance +from processout.balancescustomeraction import BalancesCustomerAction from processout.card import Card from processout.cardinformation import CardInformation from processout.phone import Phone @@ -66,11 +67,11 @@ from processout.transactionoperation import TransactionOperation from processout.webhook import Webhook from processout.webhookendpoint import WebhookEndpoint -from processout.cardcreaterequest import CardCreateRequest from processout.device import Device from processout.cardcontact import CardContact from processout.cardshipping import CardShipping from processout.cardupdaterequest import CardUpdateRequest +from processout.cardcreaterequest import CardCreateRequest from processout.errorcodes import ErrorCodes from processout.categoryerrorcodes import CategoryErrorCodes from processout.externalthreeds import ExternalThreeDS diff --git a/processout/balances.py b/processout/balances.py index 012997d..06b953d 100755 --- a/processout/balances.py +++ b/processout/balances.py @@ -17,6 +17,8 @@ def __init__(self, client, prefill=None): self._client = client self._vouchers = None + self._available_balance = None + self._customer_action = None if prefill is not None: self.fill_with_data(prefill) @@ -45,18 +47,68 @@ def vouchers(self, val): self._vouchers = l return self + @property + def available_balance(self): + """Get available_balance""" + return self._available_balance + + @available_balance.setter + def available_balance(self, val): + """Set available_balance + Keyword argument: + val -- New available_balance value""" + if val is None: + self._available_balance = val + return self + + if isinstance(val, dict): + obj = processout.Balance(self._client) + obj.fill_with_data(val) + self._available_balance = obj + else: + self._available_balance = val + return self + + @property + def customer_action(self): + """Get customer_action""" + return self._customer_action + + @customer_action.setter + def customer_action(self, val): + """Set customer_action + Keyword argument: + val -- New customer_action value""" + if val is None: + self._customer_action = val + return self + + if isinstance(val, dict): + obj = processout.BalancesCustomerAction(self._client) + obj.fill_with_data(val) + self._customer_action = obj + else: + self._customer_action = 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 "vouchers" in data.keys(): self.vouchers = data["vouchers"] + if "available_balance" in data.keys(): + self.available_balance = data["available_balance"] + if "customer_action" in data.keys(): + self.customer_action = data["customer_action"] return self def to_json(self): return { "vouchers": self.vouchers, + "available_balance": self.available_balance, + "customer_action": self.customer_action, } def find(self, token_id, options={}): diff --git a/processout/balancescustomeraction.py b/processout/balancescustomeraction.py new file mode 100755 index 0000000..931c0b0 --- /dev/null +++ b/processout/balancescustomeraction.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 BalancesCustomerAction(object): + def __init__(self, client, prefill=None): + self._client = client + + self._type = None + self._value = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def type(self): + """Get type""" + return self._type + + @type.setter + def type(self, val): + """Set type + Keyword argument: + val -- New type value""" + self._type = val + return self + + @property + def value(self): + """Get value""" + return self._value + + @value.setter + def value(self, val): + """Set value + Keyword argument: + val -- New value value""" + self._value = 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 "type" in data.keys(): + self.type = data["type"] + if "value" in data.keys(): + self.value = data["value"] + + return self + + def to_json(self): + return { + "type": self.type, + "value": self.value, + } diff --git a/processout/client.py b/processout/client.py index 3641254..a051d14 100644 --- a/processout/client.py +++ b/processout/client.py @@ -75,6 +75,12 @@ def new_balance(self, prefill=None): prefill -- Data used to prefill the object (optional)""" return processout.Balance(self, prefill) + def new_balances_customer_action(self, prefill=None): + """Create a new BalancesCustomerAction instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.BalancesCustomerAction(self, prefill) + def new_card(self, prefill=None): """Create a new Card instance Keyword argument: @@ -421,12 +427,6 @@ def new_webhook_endpoint(self, prefill=None): prefill -- Data used to prefill the object (optional)""" return processout.WebhookEndpoint(self, prefill) - def new_card_create_request(self, prefill=None): - """Create a new CardCreateRequest instance - Keyword argument: - prefill -- Data used to prefill the object (optional)""" - return processout.CardCreateRequest(self, prefill) - def new_device(self, prefill=None): """Create a new Device instance Keyword argument: @@ -451,6 +451,12 @@ def new_card_update_request(self, prefill=None): prefill -- Data used to prefill the object (optional)""" return processout.CardUpdateRequest(self, prefill) + def new_card_create_request(self, prefill=None): + """Create a new CardCreateRequest instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.CardCreateRequest(self, prefill) + def new_error_codes(self, prefill=None): """Create a new ErrorCodes instance Keyword argument: diff --git a/processout/customer.py b/processout/customer.py index e0b1dbb..ebd4ebd 100755 --- a/processout/customer.py +++ b/processout/customer.py @@ -47,6 +47,7 @@ def __init__(self, client, prefill=None): self._created_at = None self._registered_at = None self._date_of_birth = None + self._reference_id = None if prefill is not None: self.fill_with_data(prefill) @@ -516,6 +517,19 @@ def date_of_birth(self, val): self._date_of_birth = val return self + @property + def reference_id(self): + """Get reference_id""" + return self._reference_id + + @reference_id.setter + def reference_id(self, val): + """Set reference_id + Keyword argument: + val -- New reference_id value""" + self._reference_id = val + return self + def fill_with_data(self, data): """Fill the current object with the new values pulled from data Keyword argument: @@ -582,6 +596,8 @@ def fill_with_data(self, data): self.registered_at = data["registered_at"] if "date_of_birth" in data.keys(): self.date_of_birth = data["date_of_birth"] + if "reference_id" in data.keys(): + self.reference_id = data["reference_id"] return self @@ -618,6 +634,7 @@ def to_json(self): "created_at": self.created_at, "registered_at": self.registered_at, "date_of_birth": self.date_of_birth, + "reference_id": self.reference_id, } def fetch_subscriptions(self, options={}): @@ -803,6 +820,7 @@ def create(self, options={}): 'sex': self.sex, 'metadata': self.metadata, 'id': self.id, + 'reference_id': self.reference_id, 'registered_at': self.registered_at, 'phone_number': self.phone_number } diff --git a/processout/invoice.py b/processout/invoice.py index 6e8228b..d04d983 100755 --- a/processout/invoice.py +++ b/processout/invoice.py @@ -67,6 +67,7 @@ def __init__(self, client, prefill=None): self._unsupported_feature_bypass = None self._verification = None self._auto_capture_at = None + self._reference_id = None if prefill is not None: self.fill_with_data(prefill) @@ -871,6 +872,19 @@ def auto_capture_at(self, val): self._auto_capture_at = val return self + @property + def reference_id(self): + """Get reference_id""" + return self._reference_id + + @reference_id.setter + def reference_id(self, val): + """Set reference_id + Keyword argument: + val -- New reference_id value""" + self._reference_id = val + return self + def fill_with_data(self, data): """Fill the current object with the new values pulled from data Keyword argument: @@ -977,6 +991,8 @@ def fill_with_data(self, data): self.verification = data["verification"] if "auto_capture_at" in data.keys(): self.auto_capture_at = data["auto_capture_at"] + if "reference_id" in data.keys(): + self.reference_id = data["reference_id"] return self @@ -1033,6 +1049,7 @@ def to_json(self): "unsupported_feature_bypass": self.unsupported_feature_bypass, "verification": self.verification, "auto_capture_at": self.auto_capture_at, + "reference_id": self.reference_id, } def increment_authorization(self, amount, options={}): @@ -1381,6 +1398,7 @@ def create(self, options={}): 'metadata': self.metadata, 'details': self.details, 'submerchant': self.submerchant, + 'reference_id': self.reference_id, 'exemption_reason_3ds2': self.exemption_reason_3ds2, 'sca_exemption_reason': self.sca_exemption_reason, 'challenge_indicator': self.challenge_indicator, diff --git a/processout/token.py b/processout/token.py index a7d6333..693a6f7 100755 --- a/processout/token.py +++ b/processout/token.py @@ -527,6 +527,7 @@ def create(self, options={}): 'invoice_id': self.invoice_id, 'manual_invoice_cancellation': self.manual_invoice_cancellation, 'webhook_url': self.webhook_url, + 'gateway_configuration_id': self.gateway_configuration_id, 'source': options.get("source"), 'settings': options.get("settings"), 'device': options.get("device"), @@ -570,7 +571,8 @@ def save(self, options={}): 'verify_metadata': options.get("verify_metadata"), 'set_default': options.get("set_default"), 'verify_statement_descriptor': options.get("verify_statement_descriptor"), - 'invoice_return_url': options.get("invoice_return_url")} + 'invoice_return_url': options.get("invoice_return_url"), + 'gateway_configuration_id': options.get("gateway_configuration_id")} response = Response(request.put(path, data, options)) return_values = [] diff --git a/setup.py b/setup.py index bfe015b..ab66970 100644 --- a/setup.py +++ b/setup.py @@ -3,12 +3,12 @@ setup( name = 'processout', packages = ['processout', 'processout.errors', 'processout.networking'], - version = '7.3.0', + version = '7.4.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.3.0', + download_url = 'https://github.com/processout/processout-python/tarball/7.4.0', keywords = ['ProcessOut', 'api', 'bindings'], classifiers = [], )