Skip to content

Commit

Permalink
Merge pull request #76 from gocardless/template-changes
Browse files Browse the repository at this point in the history
release v1.38.0
  • Loading branch information
jjholmes927 authored Jan 31, 2023
2 parents bcceb34 + 778a5bc commit 2ef01e3
Show file tree
Hide file tree
Showing 48 changed files with 958 additions and 89 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<!-- @format -->
# 1.38.0

- Adding POST `/verification_details` endpoint to allow integrators to submit information against creditors for KYC checks

- Expose scheme identifiers for CREATE/GET/LIST via the API and allow them to be applied to creditors via the `/creditors/:identity/actions/apply_scheme_identifier` route added

# 1.37.0

- Added background conversion of boolean values to string values in GET requests
Expand Down
28 changes: 28 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ Creditors
# Update a creditor
client.creditors.update('CR123', params={...})
# Apply a scheme identifier
client.creditors.apply_scheme_identifier('CR123', params={...})
Creditor bank accounts
''''''''''''''''''''''''''''''''''''''''''

Expand Down Expand Up @@ -522,6 +525,23 @@ Scenario simulators
# Simulate a scenario
client.scenario_simulators.run('payment_failed', params={...})
Schemeentifiers
''''''''''''''''''''''''''''''''''''''''''

.. code:: python
# Create a scheme identifier
client.scheme_identifiers.create(params={...})
# List scheme identifiers
client.scheme_identifiers.list(params={...})
# Iterate through all scheme_identifiers
client.scheme_identifiers.all(params={...})
# Get a single scheme identifier
client.scheme_identifiers.get('SU123', params={...})
Subscriptions
''''''''''''''''''''''''''''''''''''''''''

Expand Down Expand Up @@ -565,6 +585,14 @@ Tax rates
# Get a single tax rate
client.tax_rates.get('GB_VAT_1', params={...})
Verification details
''''''''''''''''''''''''''''''''''''''''''

.. code:: python
# Create a verification detail
client.verification_details.create(params={...})
Webhooks
''''''''''''''''''''''''''''''''''''''''''

Expand Down
2 changes: 1 addition & 1 deletion gocardless_pro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

from .client import Client

__version__ = '1.37.0'
__version__ = '1.38.0'

4 changes: 2 additions & 2 deletions gocardless_pro/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _default_headers(self):
'Authorization': 'Bearer {0}'.format(self.access_token),
'Content-Type': 'application/json',
'GoCardless-Client-Library': 'gocardless-pro-python',
'GoCardless-Client-Version': '1.37.0',
'GoCardless-Client-Version': '1.38.0',
'User-Agent': self._user_agent(),
'GoCardless-Version': '2015-07-06',
}
Expand All @@ -150,7 +150,7 @@ def _user_agent(self):
python_version = '.'.join(platform.python_version_tuple()[0:2])
vm_version = '{}.{}.{}-{}{}'.format(*sys.version_info)
return ' '.join([
'gocardless-pro-python/1.37.0',
'gocardless-pro-python/1.38.0',
'python/{0}'.format(python_version),
'{0}/{1}'.format(platform.python_implementation(), vm_version),
'{0}/{1}'.format(platform.system(), platform.release()),
Expand Down
8 changes: 8 additions & 0 deletions gocardless_pro/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def refunds(self):
def scenario_simulators(self):
return services.ScenarioSimulatorsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def scheme_identifiers(self):
return services.SchemeIdentifiersService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def subscriptions(self):
return services.SubscriptionsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)
Expand All @@ -149,6 +153,10 @@ def subscriptions(self):
def tax_rates(self):
return services.TaxRatesService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def verification_details(self):
return services.VerificationDetailsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def webhooks(self):
return services.WebhooksService(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 @@ -55,9 +55,13 @@

from .scenario_simulator import ScenarioSimulator

from .scheme_identifier import SchemeIdentifier

from .subscription import Subscription

from .tax_rate import TaxRate

from .verification_detail import VerificationDetail

from .webhook import Webhook

7 changes: 7 additions & 0 deletions gocardless_pro/resources/mandate.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ def status(self):
return self.attributes.get('status')


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





Expand Down Expand Up @@ -140,3 +145,5 @@ def new_mandate(self):





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

class SchemeIdentifier(object):
"""A thin wrapper around a scheme_identifier, providing easy access to its
attributes.
Example:
scheme_identifier = client.scheme_identifiers.get()
scheme_identifier.id
"""

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

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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







































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

class VerificationDetail(object):
"""A thin wrapper around a verification_detail, providing easy access to its
attributes.
Example:
verification_detail = client.verification_details.get()
verification_detail.id
"""

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

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


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


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


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


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


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


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


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


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


















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')





2 changes: 2 additions & 0 deletions gocardless_pro/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
from .redirect_flows_service import RedirectFlowsService
from .refunds_service import RefundsService
from .scenario_simulators_service import ScenarioSimulatorsService
from .scheme_identifiers_service import SchemeIdentifiersService
from .subscriptions_service import SubscriptionsService
from .tax_rates_service import TaxRatesService
from .verification_details_service import VerificationDetailsService
from .webhooks_service import WebhooksService
Loading

0 comments on commit 2ef01e3

Please sign in to comment.