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
28 changes: 28 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,34 @@ Outbound payments
# Outbound payment statistics
client.outbound_payments.stats(params={...})

Outbound payment imports
''''''''''''''''''''''''''''''''''''''''''

.. code:: python

# Create an outbound payment import
client.outbound_payment_imports.create(params={...})

# Get an outbound payment import
client.outbound_payment_imports.get('IM123', params={...})

# List outbound payment imports
client.outbound_payment_imports.list(params={...})

# Iterate through all outbound_payment_imports
client.outbound_payment_imports.all(params={...})

Outbound payment import entries
''''''''''''''''''''''''''''''''''''''''''

.. code:: python

# List outbound payment import entries
client.outbound_payment_import_entries.list(params={...})

# Iterate through all outbound_payment_import_entries
client.outbound_payment_import_entries.all(params={...})

Payer authorisations
''''''''''''''''''''''''''''''''''''''''''

Expand Down
8 changes: 8 additions & 0 deletions gocardless_pro/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ def negative_balance_limits(self):
def outbound_payments(self):
return services.OutboundPaymentsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def outbound_payment_imports(self):
return services.OutboundPaymentImportsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def outbound_payment_import_entries(self):
return services.OutboundPaymentImportEntriesService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def payer_authorisations(self):
return services.PayerAuthorisationsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)
Expand Down
4 changes: 4 additions & 0 deletions gocardless_pro/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@

from .outbound_payment import OutboundPayment

from .outbound_payment_import import OutboundPaymentImport

from .outbound_payment_import_entry import OutboundPaymentImportEntry

from .payer_authorisation import PayerAuthorisation

from .payer_theme import PayerTheme
Expand Down
7 changes: 7 additions & 0 deletions gocardless_pro/resources/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def download_url(self):
return self.attributes.get('download_url')


@property
def error_message(self):
return self.attributes.get('error_message')


@property
def export_type(self):
return self.attributes.get('export_type')
Expand All @@ -52,3 +57,5 @@ def id(self):





133 changes: 133 additions & 0 deletions gocardless_pro/resources/outbound_payment_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#

class OutboundPaymentImport(object):
"""A thin wrapper around a outbound_payment_import, providing easy access to its
attributes.

Example:
outbound_payment_import = client.outbound_payment_imports.get()
outbound_payment_import.id
"""

def __init__(self, attributes, api_response):
self.attributes = attributes
self.api_response = api_response

@property
def amount_sum(self):
return self.attributes.get('amount_sum')


@property
def authorisation_url(self):
return self.attributes.get('authorisation_url')


@property
def created_at(self):
return self.attributes.get('created_at')


@property
def currency(self):
return self.attributes.get('currency')


@property
def entry_counts(self):
return self.EntryCounts(self.attributes.get('entry_counts'))


@property
def id(self):
return self.attributes.get('id')


@property
def links(self):
return self.Links(self.attributes.get('links'))


@property
def status(self):
return self.attributes.get('status')












class EntryCounts(object):
"""Wrapper for the response's 'entry_counts' attribute."""

def __init__(self, attributes):
self.attributes = attributes

@property
def failed_to_process(self):
return self.attributes.get('failed_to_process')

@property
def invalid(self):
return self.attributes.get('invalid')

@property
def processed(self):
return self.attributes.get('processed')

@property
def total(self):
return self.attributes.get('total')

@property
def valid(self):
return self.attributes.get('valid')

@property
def verified(self):
return self.attributes.get('verified')

@property
def verified_with_full_match(self):
return self.attributes.get('verified_with_full_match')

@property
def verified_with_no_match(self):
return self.attributes.get('verified_with_no_match')

@property
def verified_with_partial_match(self):
return self.attributes.get('verified_with_partial_match')

@property
def verified_with_unable_to_match(self):
return self.attributes.get('verified_with_unable_to_match')






class Links(object):
"""Wrapper for the response's 'links' attribute."""

def __init__(self, attributes):
self.attributes = attributes

@property
def creditor(self):
return self.attributes.get('creditor')





119 changes: 119 additions & 0 deletions gocardless_pro/resources/outbound_payment_import_entry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#

class OutboundPaymentImportEntry(object):
"""A thin wrapper around a outbound_payment_import_entry, providing easy access to its
attributes.

Example:
outbound_payment_import_entry = client.outbound_payment_import_entries.get()
outbound_payment_import_entry.id
"""

def __init__(self, attributes, api_response):
self.attributes = attributes
self.api_response = api_response

@property
def amount(self):
return self.attributes.get('amount')


@property
def created_at(self):
return self.attributes.get('created_at')


@property
def id(self):
return self.attributes.get('id')


@property
def links(self):
return self.Links(self.attributes.get('links'))


@property
def metadata(self):
return self.attributes.get('metadata')


@property
def processed_at(self):
return self.attributes.get('processed_at')


@property
def reference(self):
return self.attributes.get('reference')


@property
def scheme(self):
return self.attributes.get('scheme')


@property
def validation_errors(self):
return self.ValidationErrors(self.attributes.get('validation_errors'))


@property
def verification_result(self):
return self.attributes.get('verification_result')










class Links(object):
"""Wrapper for the response's 'links' attribute."""

def __init__(self, attributes):
self.attributes = attributes

@property
def outbound_payment(self):
return self.attributes.get('outbound_payment')

@property
def outbound_payment_import(self):
return self.attributes.get('outbound_payment_import')

@property
def recipient_bank_account(self):
return self.attributes.get('recipient_bank_account')












class ValidationErrors(object):
"""Wrapper for the response's 'validation_errors' attribute."""

def __init__(self, attributes):
self.attributes = attributes

@property
def outbound_payment(self):
return self.attributes.get('outbound_payment')





2 changes: 2 additions & 0 deletions gocardless_pro/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
from .mandate_pdfs_service import MandatePdfsService
from .negative_balance_limits_service import NegativeBalanceLimitsService
from .outbound_payments_service import OutboundPaymentsService
from .outbound_payment_imports_service import OutboundPaymentImportsService
from .outbound_payment_import_entries_service import OutboundPaymentImportEntriesService
from .payer_authorisations_service import PayerAuthorisationsService
from .payer_themes_service import PayerThemesService
from .payments_service import PaymentsService
Expand Down
45 changes: 45 additions & 0 deletions gocardless_pro/services/outbound_payment_import_entries_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#

from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors

class OutboundPaymentImportEntriesService(base_service.BaseService):
"""Service class that provides access to the outbound_payment_import_entries
endpoints of the GoCardless Pro API.
"""

RESOURCE_CLASS = resources.OutboundPaymentImportEntry
RESOURCE_NAME = 'outbound_payment_import_entries'


def list(self,params=None, headers=None):
"""List outbound payment import entries.

Returns a [cursor-paginated](#api-usage-cursor-pagination) list of the
entries for a given outbound payment import.

Args:
params (dict, optional): Query string parameters.

Returns:
ListResponse of OutboundPaymentImportEntry instances
"""
path = '/outbound_payment_import_entries'


response = self._perform_request('GET', path, params, headers,
retry_failures=True)
return self._resource_for(response)

def all(self,params=None):
if params is None:
params = {}
return Paginator(self, params, identity_params={
})


Loading
Loading