Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion processout/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
52 changes: 52 additions & 0 deletions processout/balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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={}):
Expand Down
65 changes: 65 additions & 0 deletions processout/balancescustomeraction.py
Original file line number Diff line number Diff line change
@@ -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,
}
18 changes: 12 additions & 6 deletions processout/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions processout/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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={}):
Expand Down Expand Up @@ -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
}
Expand Down
18 changes: 18 additions & 0 deletions processout/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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={}):
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion processout/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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 = []
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '[email protected]',
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 = [],
)