From ad2bbd5855237b3d2b98c87e2bae1fb399cbbb6e Mon Sep 17 00:00:00 2001 From: ProcessOut Fountain Date: Tue, 17 Sep 2024 05:34:29 -0400 Subject: [PATCH] feat: Add custom action structure to the create token flow --- processout/__init__.py | 11 +- processout/client.py | 70 +++- processout/exportlayout.py | 331 ++++++++++++++++++ processout/exportlayoutconfiguration.py | 113 ++++++ processout/exportlayoutconfigurationamount.py | 65 ++++ processout/exportlayoutconfigurationcolumn.py | 65 ++++ ...configurationconfigurationoptionsamount.py | 65 ++++ ...utconfigurationconfigurationoptionstime.py | 48 +++ .../exportlayoutconfigurationoptions.py | 126 +++++++ processout/exportlayoutconfigurationtime.py | 48 +++ processout/externalthreeds.py | 150 ++++++++ processout/invoice.py | 4 + processout/token.py | 7 +- setup.py | 4 +- 14 files changed, 1097 insertions(+), 10 deletions(-) create mode 100755 processout/exportlayout.py create mode 100755 processout/exportlayoutconfiguration.py create mode 100755 processout/exportlayoutconfigurationamount.py create mode 100755 processout/exportlayoutconfigurationcolumn.py create mode 100755 processout/exportlayoutconfigurationconfigurationoptionsamount.py create mode 100755 processout/exportlayoutconfigurationconfigurationoptionstime.py create mode 100755 processout/exportlayoutconfigurationoptions.py create mode 100755 processout/exportlayoutconfigurationtime.py create mode 100755 processout/externalthreeds.py diff --git a/processout/__init__.py b/processout/__init__.py index b7a744d..cde617b 100644 --- a/processout/__init__.py +++ b/processout/__init__.py @@ -18,6 +18,14 @@ from processout.token import Token from processout.discount import Discount from processout.event import Event +from processout.exportlayout import ExportLayout +from processout.exportlayoutconfiguration import ExportLayoutConfiguration +from processout.exportlayoutconfigurationcolumn import ExportLayoutConfigurationColumn +from processout.exportlayoutconfigurationtime import ExportLayoutConfigurationTime +from processout.exportlayoutconfigurationamount import ExportLayoutConfigurationAmount +from processout.exportlayoutconfigurationoptions import ExportLayoutConfigurationOptions +from processout.exportlayoutconfigurationconfigurationoptionstime import ExportLayoutConfigurationConfigurationOptionsTime +from processout.exportlayoutconfigurationconfigurationoptionsamount import ExportLayoutConfigurationConfigurationOptionsAmount from processout.gateway import Gateway from processout.gatewayconfiguration import GatewayConfiguration from processout.invoice import Invoice @@ -62,9 +70,10 @@ from processout.cardupdaterequest import CardUpdateRequest from processout.errorcodes import ErrorCodes from processout.categoryerrorcodes import CategoryErrorCodes +from processout.externalthreeds import ExternalThreeDS +from processout.nativeapmtransactiondetails import NativeAPMTransactionDetails from processout.nativeapmtransactiondetailsgateway import NativeAPMTransactionDetailsGateway from processout.nativeapmtransactiondetailsinvoice import NativeAPMTransactionDetailsInvoice -from processout.nativeapmtransactiondetails import NativeAPMTransactionDetails from processout.gatewayrequest import GatewayRequest diff --git a/processout/client.py b/processout/client.py index 0e2eeb0..07d2004 100644 --- a/processout/client.py +++ b/processout/client.py @@ -129,6 +129,58 @@ def new_event(self, prefill=None): prefill -- Data used to prefill the object (optional)""" return processout.Event(self, prefill) + def new_export_layout(self, prefill=None): + """Create a new ExportLayout instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.ExportLayout(self, prefill) + + def new_export_layout_configuration(self, prefill=None): + """Create a new ExportLayoutConfiguration instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.ExportLayoutConfiguration(self, prefill) + + def new_export_layout_configuration_column(self, prefill=None): + """Create a new ExportLayoutConfigurationColumn instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.ExportLayoutConfigurationColumn(self, prefill) + + def new_export_layout_configuration_time(self, prefill=None): + """Create a new ExportLayoutConfigurationTime instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.ExportLayoutConfigurationTime(self, prefill) + + def new_export_layout_configuration_amount(self, prefill=None): + """Create a new ExportLayoutConfigurationAmount instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.ExportLayoutConfigurationAmount(self, prefill) + + def new_export_layout_configuration_options(self, prefill=None): + """Create a new ExportLayoutConfigurationOptions instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.ExportLayoutConfigurationOptions(self, prefill) + + def new_export_layout_configuration_configuration_options_time( + self, prefill=None): + """Create a new ExportLayoutConfigurationConfigurationOptionsTime instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.ExportLayoutConfigurationConfigurationOptionsTime( + self, prefill) + + def new_export_layout_configuration_configuration_options_amount( + self, prefill=None): + """Create a new ExportLayoutConfigurationConfigurationOptionsAmount instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.ExportLayoutConfigurationConfigurationOptionsAmount( + self, prefill) + def new_gateway(self, prefill=None): """Create a new Gateway instance Keyword argument: @@ -393,6 +445,18 @@ def new_category_error_codes(self, prefill=None): prefill -- Data used to prefill the object (optional)""" return processout.CategoryErrorCodes(self, prefill) + def new_external_three_ds(self, prefill=None): + """Create a new ExternalThreeDS instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.ExternalThreeDS(self, prefill) + + def new_native_apm_transaction_details(self, prefill=None): + """Create a new NativeAPMTransactionDetails instance + Keyword argument: + prefill -- Data used to prefill the object (optional)""" + return processout.NativeAPMTransactionDetails(self, prefill) + def new_native_apm_transaction_details_gateway(self, prefill=None): """Create a new NativeAPMTransactionDetailsGateway instance Keyword argument: @@ -404,9 +468,3 @@ def new_native_apm_transaction_details_invoice(self, prefill=None): Keyword argument: prefill -- Data used to prefill the object (optional)""" return processout.NativeAPMTransactionDetailsInvoice(self, prefill) - - def new_native_apm_transaction_details(self, prefill=None): - """Create a new NativeAPMTransactionDetails instance - Keyword argument: - prefill -- Data used to prefill the object (optional)""" - return processout.NativeAPMTransactionDetails(self, prefill) diff --git a/processout/exportlayout.py b/processout/exportlayout.py new file mode 100755 index 0000000..8d60e3a --- /dev/null +++ b/processout/exportlayout.py @@ -0,0 +1,331 @@ +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 ExportLayout(object): + def __init__(self, client, prefill=None): + self._client = client + + self._id = None + self._project = None + self._project_id = None + self._created_at = None + self._name = None + self._type = None + self._is_default = None + self._configuration = 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 project(self): + """Get project""" + return self._project + + @project.setter + def project(self, val): + """Set project + Keyword argument: + val -- New project value""" + if val is None: + self._project = val + return self + + if isinstance(val, dict): + obj = processout.Project(self._client) + obj.fill_with_data(val) + self._project = obj + else: + self._project = val + return self + + @property + def project_id(self): + """Get project_id""" + return self._project_id + + @project_id.setter + def project_id(self, val): + """Set project_id + Keyword argument: + val -- New project_id value""" + self._project_id = val + return self + + @property + def created_at(self): + """Get created_at""" + return self._created_at + + @created_at.setter + def created_at(self, val): + """Set created_at + Keyword argument: + val -- New created_at value""" + self._created_at = 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 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 is_default(self): + """Get is_default""" + return self._is_default + + @is_default.setter + def is_default(self, val): + """Set is_default + Keyword argument: + val -- New is_default value""" + self._is_default = val + return self + + @property + def configuration(self): + """Get configuration""" + return self._configuration + + @configuration.setter + def configuration(self, val): + """Set configuration + Keyword argument: + val -- New configuration value""" + if val is None: + self._configuration = val + return self + + if isinstance(val, dict): + obj = processout.ExportLayoutConfiguration(self._client) + obj.fill_with_data(val) + self._configuration = obj + else: + self._configuration = 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 "project" in data.keys(): + self.project = data["project"] + if "project_id" in data.keys(): + self.project_id = data["project_id"] + if "created_at" in data.keys(): + self.created_at = data["created_at"] + if "name" in data.keys(): + self.name = data["name"] + if "type" in data.keys(): + self.type = data["type"] + if "is_default" in data.keys(): + self.is_default = data["is_default"] + if "configuration" in data.keys(): + self.configuration = data["configuration"] + + return self + + def to_json(self): + return { + "id": self.id, + "project": self.project, + "project_id": self.project_id, + "created_at": self.created_at, + "name": self.name, + "type": self.type, + "is_default": self.is_default, + "configuration": self.configuration, + } + + def all(self, options={}): + """Get all the export layouts. + Keyword argument: + + options -- Options for the request""" + self.fill_with_data(options) + + request = Request(self._client) + path = "/exports/layouts" + data = { + + } + + response = Response(request.get(path, data, options)) + return_values = [] + + a = [] + body = response.body + for v in body['export_layouts']: + tmp = processout.ExportLayout(self._client) + tmp.fill_with_data(v) + a.append(tmp) + + return_values.append(a) + + return return_values[0] + + def find(self, export_layout_id, options={}): + """Find an export layout by its ID. + Keyword argument: + export_layout_id -- ID of the export layout + options -- Options for the request""" + self.fill_with_data(options) + + request = Request(self._client) + path = "/exports/layouts/" + quote_plus(export_layout_id) + "" + data = { + + } + + response = Response(request.get(path, data, options)) + return_values = [] + + body = response.body + body = body["export_layout"] + + obj = processout.ExportLayout(self._client) + return_values.append(obj.fill_with_data(body)) + + return return_values[0] + + def find_default(self, export_type, options={}): + """Find the default export layout for given export type. + Keyword argument: + export_type -- Export type for which the default layout is assigned. + options -- Options for the request""" + self.fill_with_data(options) + + request = Request(self._client) + path = "/exports/layouts/default/" + quote_plus(export_type) + "" + data = { + + } + + response = Response(request.get(path, data, options)) + return_values = [] + + body = response.body + body = body["export_layout"] + + obj = processout.ExportLayout(self._client) + return_values.append(obj.fill_with_data(body)) + + return return_values[0] + + def create(self, options={}): + """Create a new export layout. + Keyword argument: + + options -- Options for the request""" + self.fill_with_data(options) + + request = Request(self._client) + path = "/exports/layouts" + data = { + 'name': self.name, + 'type': self.type, + 'is_default': self.is_default, + 'configuration': self.configuration + } + + response = Response(request.post(path, data, options)) + return_values = [] + + body = response.body + body = body["export_layout"] + + return_values.append(self.fill_with_data(body)) + + return return_values[0] + + def update(self, export_layout_id, options={}): + """Update the export layout. + Keyword argument: + export_layout_id -- ID of the export layout + options -- Options for the request""" + self.fill_with_data(options) + + request = Request(self._client) + path = "/exports/layouts/" + quote_plus(export_layout_id) + "" + data = { + 'name': self.name, + 'is_default': self.is_default, + 'configuration': self.configuration + } + + response = Response(request.put(path, data, options)) + return_values = [] + + body = response.body + body = body["export_layout"] + + return_values.append(self.fill_with_data(body)) + + return return_values[0] + + def delete(self, export_layout_id, options={}): + """Delete the export layout. + Keyword argument: + export_layout_id -- ID of the export layout + options -- Options for the request""" + self.fill_with_data(options) + + request = Request(self._client) + path = "/exports/layouts/" + quote_plus(export_layout_id) + "" + data = { + + } + + response = Response(request.delete(path, data, options)) + return_values = [] + + return_values.append(response.success) + + return return_values[0] diff --git a/processout/exportlayoutconfiguration.py b/processout/exportlayoutconfiguration.py new file mode 100755 index 0000000..3784069 --- /dev/null +++ b/processout/exportlayoutconfiguration.py @@ -0,0 +1,113 @@ +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 ExportLayoutConfiguration(object): + def __init__(self, client, prefill=None): + self._client = client + + self._columns = None + self._time = None + self._amount = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def columns(self): + """Get columns""" + return self._columns + + @columns.setter + def columns(self, val): + """Set columns + Keyword argument: + val -- New columns value""" + if val is None: + self._columns = [] + return self + + if len(val) > 0 and isinstance( + val[0], processout.ExportLayoutConfigurationColumn): + self._columns = val + else: + l = [] + for v in val: + obj = processout.ExportLayoutConfigurationColumn(self._client) + obj.fill_with_data(v) + l.append(obj) + self._columns = l + return self + + @property + def time(self): + """Get time""" + return self._time + + @time.setter + def time(self, val): + """Set time + Keyword argument: + val -- New time value""" + if val is None: + self._time = val + return self + + if isinstance(val, dict): + obj = processout.ExportLayoutConfigurationTime(self._client) + obj.fill_with_data(val) + self._time = obj + else: + self._time = val + return self + + @property + def amount(self): + """Get amount""" + return self._amount + + @amount.setter + def amount(self, val): + """Set amount + Keyword argument: + val -- New amount value""" + if val is None: + self._amount = val + return self + + if isinstance(val, dict): + obj = processout.ExportLayoutConfigurationAmount(self._client) + obj.fill_with_data(val) + self._amount = obj + else: + self._amount = 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 "columns" in data.keys(): + self.columns = data["columns"] + if "time" in data.keys(): + self.time = data["time"] + if "amount" in data.keys(): + self.amount = data["amount"] + + return self + + def to_json(self): + return { + "columns": self.columns, + "time": self.time, + "amount": self.amount, + } diff --git a/processout/exportlayoutconfigurationamount.py b/processout/exportlayoutconfigurationamount.py new file mode 100755 index 0000000..6ee0b69 --- /dev/null +++ b/processout/exportlayoutconfigurationamount.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 ExportLayoutConfigurationAmount(object): + def __init__(self, client, prefill=None): + self._client = client + + self._precision = None + self._separator = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def precision(self): + """Get precision""" + return self._precision + + @precision.setter + def precision(self, val): + """Set precision + Keyword argument: + val -- New precision value""" + self._precision = val + return self + + @property + def separator(self): + """Get separator""" + return self._separator + + @separator.setter + def separator(self, val): + """Set separator + Keyword argument: + val -- New separator value""" + self._separator = 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 "precision" in data.keys(): + self.precision = data["precision"] + if "separator" in data.keys(): + self.separator = data["separator"] + + return self + + def to_json(self): + return { + "precision": self.precision, + "separator": self.separator, + } diff --git a/processout/exportlayoutconfigurationcolumn.py b/processout/exportlayoutconfigurationcolumn.py new file mode 100755 index 0000000..4ad5145 --- /dev/null +++ b/processout/exportlayoutconfigurationcolumn.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 ExportLayoutConfigurationColumn(object): + def __init__(self, client, prefill=None): + self._client = client + + self._name = None + self._rename = None + if prefill is not None: + self.fill_with_data(prefill) + + @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 rename(self): + """Get rename""" + return self._rename + + @rename.setter + def rename(self, val): + """Set rename + Keyword argument: + val -- New rename value""" + self._rename = 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 "name" in data.keys(): + self.name = data["name"] + if "rename" in data.keys(): + self.rename = data["rename"] + + return self + + def to_json(self): + return { + "name": self.name, + "rename": self.rename, + } diff --git a/processout/exportlayoutconfigurationconfigurationoptionsamount.py b/processout/exportlayoutconfigurationconfigurationoptionsamount.py new file mode 100755 index 0000000..d3e9d5e --- /dev/null +++ b/processout/exportlayoutconfigurationconfigurationoptionsamount.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 ExportLayoutConfigurationConfigurationOptionsAmount(object): + def __init__(self, client, prefill=None): + self._client = client + + self._precision = None + self._separator = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def precision(self): + """Get precision""" + return self._precision + + @precision.setter + def precision(self, val): + """Set precision + Keyword argument: + val -- New precision value""" + self._precision = val + return self + + @property + def separator(self): + """Get separator""" + return self._separator + + @separator.setter + def separator(self, val): + """Set separator + Keyword argument: + val -- New separator value""" + self._separator = 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 "precision" in data.keys(): + self.precision = data["precision"] + if "separator" in data.keys(): + self.separator = data["separator"] + + return self + + def to_json(self): + return { + "precision": self.precision, + "separator": self.separator, + } diff --git a/processout/exportlayoutconfigurationconfigurationoptionstime.py b/processout/exportlayoutconfigurationconfigurationoptionstime.py new file mode 100755 index 0000000..8dd3a77 --- /dev/null +++ b/processout/exportlayoutconfigurationconfigurationoptionstime.py @@ -0,0 +1,48 @@ +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 ExportLayoutConfigurationConfigurationOptionsTime(object): + def __init__(self, client, prefill=None): + self._client = client + + self._format = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def format(self): + """Get format""" + return self._format + + @format.setter + def format(self, val): + """Set format + Keyword argument: + val -- New format value""" + self._format = 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 "format" in data.keys(): + self.format = data["format"] + + return self + + def to_json(self): + return { + "format": self.format, + } diff --git a/processout/exportlayoutconfigurationoptions.py b/processout/exportlayoutconfigurationoptions.py new file mode 100755 index 0000000..050655c --- /dev/null +++ b/processout/exportlayoutconfigurationoptions.py @@ -0,0 +1,126 @@ +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 ExportLayoutConfigurationOptions(object): + def __init__(self, client, prefill=None): + self._client = client + + self._columns = None + self._time = None + self._amount = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def columns(self): + """Get columns""" + return self._columns + + @columns.setter + def columns(self, val): + """Set columns + Keyword argument: + val -- New columns value""" + self._columns = val + return self + + @property + def time(self): + """Get time""" + return self._time + + @time.setter + def time(self, val): + """Set time + Keyword argument: + val -- New time value""" + if val is None: + self._time = val + return self + + if isinstance(val, dict): + obj = processout.ExportLayoutConfigurationConfigurationOptionsTime( + self._client) + obj.fill_with_data(val) + self._time = obj + else: + self._time = val + return self + + @property + def amount(self): + """Get amount""" + return self._amount + + @amount.setter + def amount(self, val): + """Set amount + Keyword argument: + val -- New amount value""" + if val is None: + self._amount = val + return self + + if isinstance(val, dict): + obj = processout.ExportLayoutConfigurationConfigurationOptionsAmount( + self._client) + obj.fill_with_data(val) + self._amount = obj + else: + self._amount = 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 "columns" in data.keys(): + self.columns = data["columns"] + if "time" in data.keys(): + self.time = data["time"] + if "amount" in data.keys(): + self.amount = data["amount"] + + return self + + def to_json(self): + return { + "columns": self.columns, + "time": self.time, + "amount": self.amount, + } + + def fetch(self, export_type, options={}): + """Fetch export layout configuration options. + Keyword argument: + export_type -- Export type + options -- Options for the request""" + self.fill_with_data(options) + + request = Request(self._client) + path = "/exports/layouts/options/" + quote_plus(export_type) + "" + data = { + + } + + response = Response(request.get(path, data, options)) + return_values = [] + + body = response.body + body = body["export_layout_configuration_options"] + + obj = processout.ExportLayoutConfigurationOptions(self._client) + return_values.append(obj.fill_with_data(body)) + + return return_values[0] diff --git a/processout/exportlayoutconfigurationtime.py b/processout/exportlayoutconfigurationtime.py new file mode 100755 index 0000000..10c9ece --- /dev/null +++ b/processout/exportlayoutconfigurationtime.py @@ -0,0 +1,48 @@ +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 ExportLayoutConfigurationTime(object): + def __init__(self, client, prefill=None): + self._client = client + + self._format = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def format(self): + """Get format""" + return self._format + + @format.setter + def format(self, val): + """Set format + Keyword argument: + val -- New format value""" + self._format = 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 "format" in data.keys(): + self.format = data["format"] + + return self + + def to_json(self): + return { + "format": self.format, + } diff --git a/processout/externalthreeds.py b/processout/externalthreeds.py new file mode 100755 index 0000000..846e59d --- /dev/null +++ b/processout/externalthreeds.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 ExternalThreeDS(object): + def __init__(self, client, prefill=None): + self._client = client + + self._xid = None + self._trans_status = None + self._eci = None + self._cavv = None + self._ds_trans_id = None + self._version = None + self._authentication_flow = None + if prefill is not None: + self.fill_with_data(prefill) + + @property + def xid(self): + """Get xid""" + return self._xid + + @xid.setter + def xid(self, val): + """Set xid + Keyword argument: + val -- New xid value""" + self._xid = val + return self + + @property + def trans_status(self): + """Get trans_status""" + return self._trans_status + + @trans_status.setter + def trans_status(self, val): + """Set trans_status + Keyword argument: + val -- New trans_status value""" + self._trans_status = val + return self + + @property + def eci(self): + """Get eci""" + return self._eci + + @eci.setter + def eci(self, val): + """Set eci + Keyword argument: + val -- New eci value""" + self._eci = val + return self + + @property + def cavv(self): + """Get cavv""" + return self._cavv + + @cavv.setter + def cavv(self, val): + """Set cavv + Keyword argument: + val -- New cavv value""" + self._cavv = val + return self + + @property + def ds_trans_id(self): + """Get ds_trans_id""" + return self._ds_trans_id + + @ds_trans_id.setter + def ds_trans_id(self, val): + """Set ds_trans_id + Keyword argument: + val -- New ds_trans_id value""" + self._ds_trans_id = val + return self + + @property + def version(self): + """Get version""" + return self._version + + @version.setter + def version(self, val): + """Set version + Keyword argument: + val -- New version value""" + self._version = val + return self + + @property + def authentication_flow(self): + """Get authentication_flow""" + return self._authentication_flow + + @authentication_flow.setter + def authentication_flow(self, val): + """Set authentication_flow + Keyword argument: + val -- New authentication_flow value""" + self._authentication_flow = 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 "xid" in data.keys(): + self.xid = data["xid"] + if "trans_status" in data.keys(): + self.trans_status = data["trans_status"] + if "eci" in data.keys(): + self.eci = data["eci"] + if "cavv" in data.keys(): + self.cavv = data["cavv"] + if "ds_trans_id" in data.keys(): + self.ds_trans_id = data["ds_trans_id"] + if "version" in data.keys(): + self.version = data["version"] + if "authentication_flow" in data.keys(): + self.authentication_flow = data["authentication_flow"] + + return self + + def to_json(self): + return { + "xid": self.xid, + "trans_status": self.trans_status, + "eci": self.eci, + "cavv": self.cavv, + "ds_trans_id": self.ds_trans_id, + "version": self.version, + "authentication_flow": self.authentication_flow, + } diff --git a/processout/invoice.py b/processout/invoice.py index bbf2783..f3212ff 100755 --- a/processout/invoice.py +++ b/processout/invoice.py @@ -1053,6 +1053,8 @@ def authorize(self, source, options={}): 'auto_capture_at': options.get("auto_capture_at"), 'metadata': options.get("metadata"), 'override_mac_blocking': options.get("override_mac_blocking"), + 'external_three_d_s': options.get("external_three_d_s"), + 'save_source': options.get("save_source"), 'source': source} response = Response(request.post(path, data, options)) @@ -1090,6 +1092,8 @@ def capture(self, source, options={}): 'metadata': options.get("metadata"), 'capture_statement_descriptor': options.get("capture_statement_descriptor"), 'override_mac_blocking': options.get("override_mac_blocking"), + 'external_three_d_s': options.get("external_three_d_s"), + 'save_source': options.get("save_source"), 'source': source} response = Response(request.post(path, data, options)) diff --git a/processout/token.py b/processout/token.py index 4d3fd46..5155f67 100755 --- a/processout/token.py +++ b/processout/token.py @@ -527,7 +527,12 @@ def create(self, options={}): return_values.append(self.fill_with_data(body)) - return return_values[0] + body = response.body + body = body["customer_action"] + customerAction = processout.CustomerAction(self._client) + return_values.append(customerAction.fill_with_data(body)) + + return tuple(return_values) def save(self, options={}): """Save the updated customer attributes. diff --git a/setup.py b/setup.py index 7ad6f33..6379b47 100644 --- a/setup.py +++ b/setup.py @@ -3,12 +3,12 @@ setup( name = 'processout', packages = ['processout', 'processout.errors', 'processout.networking'], - version = '7.0.0', + version = '7.1.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.0.0', + download_url = 'https://github.com/processout/processout-python/tarball/7.1.0', keywords = ['ProcessOut', 'api', 'bindings'], classifiers = [], )