Skip to content

Commit

Permalink
Merge pull request #68 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Bump to v1.34.0
  • Loading branch information
Yusuf B authored Dec 13, 2022
2 parents cc84d16 + 4c9119b commit 67a1f0f
Show file tree
Hide file tree
Showing 28 changed files with 71 additions and 70 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<!-- @format -->
# 1.34.0

- Added `language` parameter to [Billing Request Flow](https://developer.gocardless.com/api-reference#billing-request-flows-create-a-billing-request-flow) creation.

# 1.33.0

- Added `mandate_request[description]` and `mandate_request[constraints]` parameters to Billing Request creation
Expand Down
5 changes: 0 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,6 @@ Mandate pdfs
# Create a mandate PDF
client.mandate_pdfs.create(params={...})
Mandate request constraints
''''''''''''''''''''''''''''''''''''''''''

.. code:: python
Payer authorisations
''''''''''''''''''''''''''''''''''''''''''

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.33.0'
__version__ = '1.34.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.33.0',
'GoCardless-Client-Version': '1.34.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.33.0',
'gocardless-pro-python/1.34.0',
'python/{0}'.format(python_version),
'{0}/{1}'.format(platform.python_implementation(), vm_version),
'{0}/{1}'.format(platform.system(), platform.release()),
Expand Down
4 changes: 0 additions & 4 deletions gocardless_pro/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ def mandate_import_entries(self):
def mandate_pdfs(self):
return services.MandatePdfsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict)

@property
def mandate_request_constraints(self):
return services.MandateRequestConstraintsService(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
2 changes: 0 additions & 2 deletions gocardless_pro/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@

from .mandate_pdf import MandatePdf

from .mandate_request_constraints import MandateRequestConstraints

from .payer_authorisation import PayerAuthorisation

from .payment import Payment
Expand Down
11 changes: 7 additions & 4 deletions gocardless_pro/resources/billing_request_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def id(self):
return self.attributes.get('id')


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


@property
def links(self):
return self.Links(self.attributes.get('links'))
Expand Down Expand Up @@ -105,6 +110,8 @@ def show_redirect_buttons(self):





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

Expand Down Expand Up @@ -183,10 +190,6 @@ def family_name(self):
def given_name(self):
return self.attributes.get('given_name')

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

@property
def postal_code(self):
return self.attributes.get('postal_code')
Expand Down
7 changes: 7 additions & 0 deletions gocardless_pro/resources/creditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ def created_at(self):
return self.attributes.get('created_at')


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


@property
def custom_payment_pages_enabled(self):
return self.attributes.get('custom_payment_pages_enabled')
Expand Down Expand Up @@ -137,6 +142,8 @@ def verification_status(self):








Expand Down
1 change: 0 additions & 1 deletion gocardless_pro/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from .mandate_imports_service import MandateImportsService
from .mandate_import_entries_service import MandateImportEntriesService
from .mandate_pdfs_service import MandatePdfsService
from .mandate_request_constraints_service import MandateRequestConstraintsService
from .payer_authorisations_service import PayerAuthorisationsService
from .payments_service import PaymentsService
from .payouts_service import PayoutsService
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@

setup(
name = 'gocardless_pro',
version = '1.33.0',
version = '1.34.0',
packages = find_packages(exclude=['tests']),
install_requires = ['requests>=2.6', 'six'],
author = 'GoCardless',
author_email = '[email protected]',
description = 'A client library for the GoCardless Pro API.',
long_description = long_description,
long_description_content_type='text/markdown',
license = 'MIT',
keywords = 'gocardless directdebit payments sepa bacs',
url = 'https://github.com/gocardless/gocardless-pro-python',
Expand Down
3 changes: 0 additions & 3 deletions tests/client_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ def test_mandate_import_entries_returns_service():
def test_mandate_pdfs_returns_service():
assert_is_instance(client.mandate_pdfs, services.MandatePdfsService)

def test_mandate_request_constraints_returns_service():
assert_is_instance(client.mandate_request_constraints, services.MandateRequestConstraintsService)

def test_payer_authorisations_returns_service():
assert_is_instance(client.payer_authorisations, services.PayerAuthorisationsService)

Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/bank_authorisations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"method": "GET",
"path_template": "/bank_authorisations/:identity",
"url_params": ["BAU123"],
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 8081","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2022-11-30T15:26:36.924Z","expires_at":"2022-11-30T15:26:36.924Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 8081","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2022-12-13T14:39:35.870Z","expires_at":"2022-12-13T14:39:35.870Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
},
"create": {
"method": "POST",
"path_template": "/bank_authorisations",
"url_params": [],
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 7887","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2022-11-30T15:26:36.924Z","expires_at":"2022-11-30T15:26:36.924Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 7887","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2022-12-13T14:39:35.870Z","expires_at":"2022-12-13T14:39:35.870Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
}
}
4 changes: 2 additions & 2 deletions tests/fixtures/billing_request_flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"method": "POST",
"path_template": "/billing_request_flows",
"url_params": [],
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":true,"created_at":"2022-11-30T15:26:36.928Z","exit_uri":"https://my-website.com/abc/callback","expires_at":"2022-11-30T15:26:36.928Z","id":"BRF123","links":{"billing_request":"BRQ123"},"lock_bank_account":true,"lock_currency":true,"lock_customer_details":false,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","language":"en","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":false}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":false,"created_at":"2022-12-13T14:39:35.874Z","exit_uri":"https://my-website.com/abc/callback","expires_at":"2022-12-13T14:39:35.874Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":true,"lock_currency":true,"lock_customer_details":true,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":false}}
},
"initialise": {
"method": "POST",
"path_template": "/billing_request_flows/:identity/actions/initialise",
"url_params": ["BRF123"],
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":true,"created_at":"2022-11-30T15:26:36.928Z","exit_uri":"https://my-website.com/abc/callback","expires_at":"2022-11-30T15:26:36.928Z","id":"BRF123","links":{"billing_request":"BRQ123"},"lock_bank_account":true,"lock_currency":false,"lock_customer_details":true,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","language":"en","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":true}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":true,"created_at":"2022-12-13T14:39:35.874Z","exit_uri":"https://my-website.com/abc/callback","expires_at":"2022-12-13T14:39:35.874Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":true,"lock_currency":true,"lock_customer_details":true,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":false}}
}
}
Loading

0 comments on commit 67a1f0f

Please sign in to comment.