diff --git a/README.rst b/README.rst index e050e0ce..859fba35 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ A Python client for interacting with the GoCardless Pro API. |pypi-badge| -Tested against Python 3.8, 3.9, 3.10, 3.11 and 3.12. +Tested against Python 3.9, 3.10, 3.11 and 3.12. - `"Getting Started" guide `_ with copy and paste Python code samples - `API reference`_ @@ -187,7 +187,7 @@ Billing request templates client.billing_request_templates.create(params={...}) # Update a Billing Request Template - client.billing_request_templates.update('BRQ123', params={...}) + client.billing_request_templates.update('BRT123', params={...}) Billing request with actions '''''''''''''''''''''''''''''''''''''''''' @@ -439,13 +439,13 @@ Mandate imports client.mandate_imports.create(params={...}) # Get a mandate import - client.mandate_imports.get('IM000010790WX1', params={...}) + client.mandate_imports.get('IM123', params={...}) # Submit a mandate import - client.mandate_imports.submit('IM000010790WX1', params={...}) + client.mandate_imports.submit('IM123', params={...}) # Cancel a mandate import - client.mandate_imports.cancel('IM000010790WX1', params={...}) + client.mandate_imports.cancel('IM123', params={...}) Mandate import entries '''''''''''''''''''''''''''''''''''''''''' @@ -492,13 +492,13 @@ Outbound payments client.outbound_payments.withdraw(params={...}) # Cancel an outbound payment - client.outbound_payments.cancel('OUT01JR7P5PKW3K7Q34CJAWC03E82', params={...}) + client.outbound_payments.cancel('OUT123', params={...}) # Approve an outbound payment - client.outbound_payments.approve('OUT01JR7P5PKW3K7Q34CJAWC03E82', params={...}) + client.outbound_payments.approve('OUT123', params={...}) # Get an outbound payment - client.outbound_payments.get('OUT01JR7P5PKW3K7Q34CJAWC03E82', params={...}) + client.outbound_payments.get('OUT123', params={...}) # List outbound payments client.outbound_payments.list(params={...}) @@ -507,7 +507,7 @@ Outbound payments client.outbound_payments.all(params={...}) # Update an outbound payment - client.outbound_payments.update('OUT01JR7P5PKW3K7Q34CJAWC03E82', params={...}) + client.outbound_payments.update('OUT123', params={...}) Payer authorisations '''''''''''''''''''''''''''''''''''''''''' @@ -563,6 +563,17 @@ Payments # Retry a payment client.payments.retry('PM123', params={...}) +Payment account transactions +'''''''''''''''''''''''''''''''''''''''''' + +.. code:: python + + # List payment account transactions + client.payment_account_transactions.list('BA123', params={...}) + + # Iterate through all payment_account_transactions + client.payment_account_transactions.all(params={...}) + Payouts '''''''''''''''''''''''''''''''''''''''''' diff --git a/gocardless_pro/client.py b/gocardless_pro/client.py index 5d550ac8..a33e0be0 100644 --- a/gocardless_pro/client.py +++ b/gocardless_pro/client.py @@ -153,6 +153,10 @@ def payer_themes(self): def payments(self): return services.PaymentsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict) + @property + def payment_account_transactions(self): + return services.PaymentAccountTransactionsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict) + @property def payouts(self): return services.PayoutsService(self._api_client, 3, 0.5, self._raise_on_idempotency_conflict) diff --git a/gocardless_pro/paginator.py b/gocardless_pro/paginator.py index baeea7e2..c6e09c63 100644 --- a/gocardless_pro/paginator.py +++ b/gocardless_pro/paginator.py @@ -8,9 +8,10 @@ class Paginator(object): loading each page until the last. """ - def __init__(self, service, params): + def __init__(self, service, params, identity_params=None): self._service = service self._params = params + self._identity_params = identity_params or {} def __iter__(self): return self._iterate() @@ -30,5 +31,5 @@ def _fetch_page(self, after): params = self._params.copy() if after is not None: params.update({'after': after}) - return self._service.list(params=params) + return self._service.list(**self._identity_params, params=params) diff --git a/gocardless_pro/resources/__init__.py b/gocardless_pro/resources/__init__.py index d3846cb7..dccc8b88 100644 --- a/gocardless_pro/resources/__init__.py +++ b/gocardless_pro/resources/__init__.py @@ -61,6 +61,8 @@ from .payment import Payment +from .payment_account_transaction import PaymentAccountTransaction + from .payout import Payout from .payout_item import PayoutItem diff --git a/gocardless_pro/resources/billing_request.py b/gocardless_pro/resources/billing_request.py index 0ab9ee5d..9e231691 100644 --- a/gocardless_pro/resources/billing_request.py +++ b/gocardless_pro/resources/billing_request.py @@ -242,6 +242,10 @@ def currency(self): def description(self): return self.attributes.get('description') + @property + def funds_settlement(self): + return self.attributes.get('funds_settlement') + @property def links(self): return self.attributes.get('links') diff --git a/gocardless_pro/resources/event.py b/gocardless_pro/resources/event.py index 3b59e1a8..53f2b066 100644 --- a/gocardless_pro/resources/event.py +++ b/gocardless_pro/resources/event.py @@ -61,6 +61,11 @@ def resource_type(self): return self.attributes.get('resource_type') + @property + def source(self): + return self.Source(self.attributes.get('source')) + + @@ -162,6 +167,10 @@ def instalment_schedule(self): def mandate(self): return self.attributes.get('mandate') + @property + def mandate_request(self): + return self.attributes.get('mandate_request') + @property def mandate_request_mandate(self): return self.attributes.get('mandate_request_mandate') @@ -222,3 +231,20 @@ def subscription(self): + + class Source(object): + """Wrapper for the response's 'source' attribute.""" + + def __init__(self, attributes): + self.attributes = attributes + + @property + def name(self): + return self.attributes.get('name') + + @property + def type(self): + return self.attributes.get('type') + + + diff --git a/gocardless_pro/resources/mandate.py b/gocardless_pro/resources/mandate.py index 55d60389..a2a4ce22 100644 --- a/gocardless_pro/resources/mandate.py +++ b/gocardless_pro/resources/mandate.py @@ -110,8 +110,16 @@ def max_amount_per_payment(self): return self.attributes.get('max_amount_per_payment') @property - def periods(self): - return self.attributes.get('periods') + def max_amount_per_period(self): + return self.attributes.get('max_amount_per_period') + + @property + def max_payments_per_period(self): + return self.attributes.get('max_payments_per_period') + + @property + def period(self): + return self.attributes.get('period') @property def start_date(self): diff --git a/gocardless_pro/resources/payment.py b/gocardless_pro/resources/payment.py index c8dd92aa..2bf04d27 100644 --- a/gocardless_pro/resources/payment.py +++ b/gocardless_pro/resources/payment.py @@ -81,6 +81,11 @@ def retry_if_possible(self): return self.attributes.get('retry_if_possible') + @property + def scheme(self): + return self.attributes.get('scheme') + + @property def status(self): return self.attributes.get('status') @@ -165,3 +170,5 @@ def subscription(self): + + diff --git a/gocardless_pro/resources/payment_account_transaction.py b/gocardless_pro/resources/payment_account_transaction.py new file mode 100644 index 00000000..20282fa8 --- /dev/null +++ b/gocardless_pro/resources/payment_account_transaction.py @@ -0,0 +1,108 @@ +# WARNING: Do not edit by hand, this file was generated by Crank: +# +# https://github.com/gocardless/crank +# + +class PaymentAccountTransaction(object): + """A thin wrapper around a payment_account_transaction, providing easy access to its + attributes. + + Example: + payment_account_transaction = client.payment_account_transactions.get() + payment_account_transaction.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 balance_after_transaction(self): + return self.attributes.get('balance_after_transaction') + + + @property + def counterparty_name(self): + return self.attributes.get('counterparty_name') + + + @property + def currency(self): + return self.attributes.get('currency') + + + @property + def description(self): + return self.attributes.get('description') + + + @property + def direction(self): + return self.attributes.get('direction') + + + @property + def id(self): + return self.attributes.get('id') + + + @property + def links(self): + return self.Links(self.attributes.get('links')) + + + @property + def reference(self): + return self.attributes.get('reference') + + + @property + def value_date(self): + return self.attributes.get('value_date') + + + + + + + + + + + + + + + + + + + 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 payment_bank_account(self): + return self.attributes.get('payment_bank_account') + + @property + def payout(self): + return self.attributes.get('payout') + + + + + + + diff --git a/gocardless_pro/services/__init__.py b/gocardless_pro/services/__init__.py index 603eb073..718c7681 100644 --- a/gocardless_pro/services/__init__.py +++ b/gocardless_pro/services/__init__.py @@ -32,6 +32,7 @@ from .payer_authorisations_service import PayerAuthorisationsService from .payer_themes_service import PayerThemesService from .payments_service import PaymentsService +from .payment_account_transactions_service import PaymentAccountTransactionsService from .payouts_service import PayoutsService from .payout_items_service import PayoutItemsService from .redirect_flows_service import RedirectFlowsService diff --git a/gocardless_pro/services/balances_service.py b/gocardless_pro/services/balances_service.py index d87a3667..0419863e 100644 --- a/gocardless_pro/services/balances_service.py +++ b/gocardless_pro/services/balances_service.py @@ -37,9 +37,10 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/bank_account_details_service.py b/gocardless_pro/services/bank_account_details_service.py index eb79711f..1ca3577b 100644 --- a/gocardless_pro/services/bank_account_details_service.py +++ b/gocardless_pro/services/bank_account_details_service.py @@ -21,7 +21,12 @@ def get(self,identity,params=None, headers=None): """Get encrypted bank details. Returns bank account details in the flattened JSON Web Encryption - format described in RFC 7516 + format described in RFC 7516. + + You must specify a `Gc-Key-Id` header when using this endpoint. See + [Public Key + Setup](https://developer.gocardless.com/gc-embed/bank-details-access#public_key_setup) + for more details. Args: identity (string): Unique identifier, beginning with "BA". diff --git a/gocardless_pro/services/billing_request_templates_service.py b/gocardless_pro/services/billing_request_templates_service.py index b4039d6b..7ed61982 100644 --- a/gocardless_pro/services/billing_request_templates_service.py +++ b/gocardless_pro/services/billing_request_templates_service.py @@ -36,10 +36,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) @@ -101,7 +102,7 @@ def update(self,identity,params=None, headers=None): Billing Requests created by this template. Args: - identity (string): Unique identifier, beginning with "BRQ". + identity (string): Unique identifier, beginning with "BRT". params (dict, optional): Request body. Returns: diff --git a/gocardless_pro/services/billing_requests_service.py b/gocardless_pro/services/billing_requests_service.py index 40481455..75485e95 100644 --- a/gocardless_pro/services/billing_requests_service.py +++ b/gocardless_pro/services/billing_requests_service.py @@ -230,10 +230,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/blocks_service.py b/gocardless_pro/services/blocks_service.py index 22ce71de..b57e1a24 100644 --- a/gocardless_pro/services/blocks_service.py +++ b/gocardless_pro/services/blocks_service.py @@ -87,10 +87,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/creditor_bank_accounts_service.py b/gocardless_pro/services/creditor_bank_accounts_service.py index 7f0f9ba0..b9ca1893 100644 --- a/gocardless_pro/services/creditor_bank_accounts_service.py +++ b/gocardless_pro/services/creditor_bank_accounts_service.py @@ -64,10 +64,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/creditors_service.py b/gocardless_pro/services/creditors_service.py index eb971502..02b2ac95 100644 --- a/gocardless_pro/services/creditors_service.py +++ b/gocardless_pro/services/creditors_service.py @@ -64,10 +64,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/currency_exchange_rates_service.py b/gocardless_pro/services/currency_exchange_rates_service.py index 49eceeaf..337b30ba 100644 --- a/gocardless_pro/services/currency_exchange_rates_service.py +++ b/gocardless_pro/services/currency_exchange_rates_service.py @@ -36,9 +36,10 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/customer_bank_accounts_service.py b/gocardless_pro/services/customer_bank_accounts_service.py index a66f409d..ccc0c9f0 100644 --- a/gocardless_pro/services/customer_bank_accounts_service.py +++ b/gocardless_pro/services/customer_bank_accounts_service.py @@ -76,10 +76,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/customers_service.py b/gocardless_pro/services/customers_service.py index 244f99f9..1c8e1bc3 100644 --- a/gocardless_pro/services/customers_service.py +++ b/gocardless_pro/services/customers_service.py @@ -64,10 +64,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/events_service.py b/gocardless_pro/services/events_service.py index 60b76556..db8a9487 100644 --- a/gocardless_pro/services/events_service.py +++ b/gocardless_pro/services/events_service.py @@ -36,10 +36,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/exports_service.py b/gocardless_pro/services/exports_service.py index 9d4ad52d..aadbcd1c 100644 --- a/gocardless_pro/services/exports_service.py +++ b/gocardless_pro/services/exports_service.py @@ -58,9 +58,10 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/instalment_schedules_service.py b/gocardless_pro/services/instalment_schedules_service.py index 2dd66f66..a24fc662 100644 --- a/gocardless_pro/services/instalment_schedules_service.py +++ b/gocardless_pro/services/instalment_schedules_service.py @@ -126,10 +126,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/institutions_service.py b/gocardless_pro/services/institutions_service.py index bd7d36ad..8e691eea 100644 --- a/gocardless_pro/services/institutions_service.py +++ b/gocardless_pro/services/institutions_service.py @@ -35,10 +35,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/mandate_import_entries_service.py b/gocardless_pro/services/mandate_import_entries_service.py index d2bba4f5..145aa64c 100644 --- a/gocardless_pro/services/mandate_import_entries_service.py +++ b/gocardless_pro/services/mandate_import_entries_service.py @@ -70,9 +70,10 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/mandates_service.py b/gocardless_pro/services/mandates_service.py index 56478c22..a7d5dcc8 100644 --- a/gocardless_pro/services/mandates_service.py +++ b/gocardless_pro/services/mandates_service.py @@ -64,10 +64,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/negative_balance_limits_service.py b/gocardless_pro/services/negative_balance_limits_service.py index 19ee9cea..d4d51061 100644 --- a/gocardless_pro/services/negative_balance_limits_service.py +++ b/gocardless_pro/services/negative_balance_limits_service.py @@ -36,9 +36,10 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/outbound_payments_service.py b/gocardless_pro/services/outbound_payments_service.py index 7ae5f8af..8f9926f8 100644 --- a/gocardless_pro/services/outbound_payments_service.py +++ b/gocardless_pro/services/outbound_payments_service.py @@ -161,10 +161,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/payment_account_transactions_service.py b/gocardless_pro/services/payment_account_transactions_service.py new file mode 100644 index 00000000..d5c2ef1c --- /dev/null +++ b/gocardless_pro/services/payment_account_transactions_service.py @@ -0,0 +1,50 @@ +# 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 PaymentAccountTransactionsService(base_service.BaseService): + """Service class that provides access to the payment_account_transactions + endpoints of the GoCardless Pro API. + """ + + RESOURCE_CLASS = resources.PaymentAccountTransaction + RESOURCE_NAME = 'payment_account_transactions' + + + def list(self,identity,params=None, headers=None): + """List payment account transactions. + + List transactions for a given payment account. + + Args: + identity (string): The unique ID of the [bank account](#core-endpoints-creditor-bank-accounts) which happens to be the payment account. + params (dict, optional): Query string parameters. + + Returns: + ListResponse of PaymentAccountTransaction instances + """ + path = self._sub_url_params('/payment_accounts/:identity/transactions', { + + 'identity': identity, + }) + + + response = self._perform_request('GET', path, params, headers, + retry_failures=True) + return self._resource_for(response) + + def all(self,identity,params=None): + if params is None: + params = {} + return Paginator(self, params, identity_params={ + + 'identity': identity, + }) + + diff --git a/gocardless_pro/services/payments_service.py b/gocardless_pro/services/payments_service.py index 2f876693..3a736ee0 100644 --- a/gocardless_pro/services/payments_service.py +++ b/gocardless_pro/services/payments_service.py @@ -70,10 +70,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/payout_items_service.py b/gocardless_pro/services/payout_items_service.py index 884df2f6..47bc979f 100644 --- a/gocardless_pro/services/payout_items_service.py +++ b/gocardless_pro/services/payout_items_service.py @@ -41,9 +41,10 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/payouts_service.py b/gocardless_pro/services/payouts_service.py index 29960e54..50bcb720 100644 --- a/gocardless_pro/services/payouts_service.py +++ b/gocardless_pro/services/payouts_service.py @@ -36,10 +36,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/refunds_service.py b/gocardless_pro/services/refunds_service.py index b02f90c8..19d4d0e6 100644 --- a/gocardless_pro/services/refunds_service.py +++ b/gocardless_pro/services/refunds_service.py @@ -78,10 +78,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/scenario_simulators_service.py b/gocardless_pro/services/scenario_simulators_service.py index 800d55c9..0802cd17 100644 --- a/gocardless_pro/services/scenario_simulators_service.py +++ b/gocardless_pro/services/scenario_simulators_service.py @@ -51,6 +51,7 @@ def run(self,identity,params=None, headers=None):
  • `payout_bounced`: Transitions a payout to `bounced`. It must start in the `paid` state.
  • `billing_request_fulfilled`: Authorises the billing request, and then fulfils it. The billing request must be in the `pending` state, with all actions completed except for `bank_authorisation`. Only billing requests with a `payment_request` are supported.
  • `billing_request_fulfilled_and_payment_failed`: Authorises the billing request, fulfils it, and moves the associated payment to `failed`. The billing request must be in the `pending` state, with all actions completed except for `bank_authorisation`. Only billing requests with a `payment_request` are supported.
  • +
  • `billing_request_fulfilled_and_payment_confirmed_to_failed`: Authorises the billing request, fulfils it, moves the associated payment to `confirmed` and then moves it to `failed`. The billing request must be in the `pending` state, with all actions completed except for `bank_authorisation`. Only billing requests with a `payment_request` are supported.
  • `billing_request_fulfilled_and_payment_paid_out`: Authorises the billing request, fulfils it, and moves the associated payment to `paid_out`. The billing request must be in the `pending` state, with all actions completed except for `bank_authorisation`. Only billing requests with a `payment_request` are supported.
  • params (dict, optional): Request body. diff --git a/gocardless_pro/services/scheme_identifiers_service.py b/gocardless_pro/services/scheme_identifiers_service.py index e31626ed..2dc11a46 100644 --- a/gocardless_pro/services/scheme_identifiers_service.py +++ b/gocardless_pro/services/scheme_identifiers_service.py @@ -103,10 +103,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/subscriptions_service.py b/gocardless_pro/services/subscriptions_service.py index abecb656..be5d3c84 100644 --- a/gocardless_pro/services/subscriptions_service.py +++ b/gocardless_pro/services/subscriptions_service.py @@ -66,10 +66,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/tax_rates_service.py b/gocardless_pro/services/tax_rates_service.py index 73875a1c..20b7842c 100644 --- a/gocardless_pro/services/tax_rates_service.py +++ b/gocardless_pro/services/tax_rates_service.py @@ -36,10 +36,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/verification_details_service.py b/gocardless_pro/services/verification_details_service.py index 20f8fd68..4ea95e7e 100644 --- a/gocardless_pro/services/verification_details_service.py +++ b/gocardless_pro/services/verification_details_service.py @@ -56,9 +56,10 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/gocardless_pro/services/webhooks_service.py b/gocardless_pro/services/webhooks_service.py index f4ab9229..9a12982a 100644 --- a/gocardless_pro/services/webhooks_service.py +++ b/gocardless_pro/services/webhooks_service.py @@ -36,10 +36,11 @@ def list(self,params=None, headers=None): retry_failures=True) return self._resource_for(response) - def all(self, params=None): + def all(self,params=None): if params is None: params = {} - return Paginator(self, params) + return Paginator(self, params, identity_params={ + }) diff --git a/tests/client_test.py b/tests/client_test.py index a141de85..28d05fdd 100644 --- a/tests/client_test.py +++ b/tests/client_test.py @@ -104,6 +104,9 @@ def test_payer_themes_returns_service(): def test_payments_returns_service(): assert isinstance(client.payments, services.PaymentsService) +def test_payment_account_transactions_returns_service(): + assert isinstance(client.payment_account_transactions, services.PaymentAccountTransactionsService) + def test_payouts_returns_service(): assert isinstance(client.payouts, services.PayoutsService) diff --git a/tests/client_tests.py b/tests/client_tests.py deleted file mode 100644 index 3516f3bb..00000000 --- a/tests/client_tests.py +++ /dev/null @@ -1,114 +0,0 @@ -# WARNING: Do not edit by hand, this file was generated by Crank: -# -# https://github.com/gocardless/crank -# - -import requests -import responses -from nose.tools import assert_is_instance, assert_raises - -from gocardless_pro import Client -from gocardless_pro import services - -access_token = 'access-token-xyz' -client = Client(access_token=access_token, base_url='http://example.com') - -def test_requires_valid_environment(): - assert_raises(ValueError, Client, access_token=access_token, environment='invalid') - -def test_bank_authorisations_returns_service(): - assert_is_instance(client.bank_authorisations, services.BankAuthorisationsService) - -def test_bank_details_lookups_returns_service(): - assert_is_instance(client.bank_details_lookups, services.BankDetailsLookupsService) - -def test_billing_requests_returns_service(): - assert_is_instance(client.billing_requests, services.BillingRequestsService) - -def test_billing_request_flows_returns_service(): - assert_is_instance(client.billing_request_flows, services.BillingRequestFlowsService) - -def test_billing_request_templates_returns_service(): - assert_is_instance(client.billing_request_templates, services.BillingRequestTemplatesService) - -def test_blocks_returns_service(): - assert_is_instance(client.blocks, services.BlocksService) - -def test_creditors_returns_service(): - assert_is_instance(client.creditors, services.CreditorsService) - -def test_creditor_bank_accounts_returns_service(): - assert_is_instance(client.creditor_bank_accounts, services.CreditorBankAccountsService) - -def test_currency_exchange_rates_returns_service(): - assert_is_instance(client.currency_exchange_rates, services.CurrencyExchangeRatesService) - -def test_customers_returns_service(): - assert_is_instance(client.customers, services.CustomersService) - -def test_customer_bank_accounts_returns_service(): - assert_is_instance(client.customer_bank_accounts, services.CustomerBankAccountsService) - -def test_customer_notifications_returns_service(): - assert_is_instance(client.customer_notifications, services.CustomerNotificationsService) - -def test_events_returns_service(): - assert_is_instance(client.events, services.EventsService) - -def test_instalment_schedules_returns_service(): - assert_is_instance(client.instalment_schedules, services.InstalmentSchedulesService) - -def test_institutions_returns_service(): - assert_is_instance(client.institutions, services.InstitutionsService) - -def test_mandates_returns_service(): - assert_is_instance(client.mandates, services.MandatesService) - -def test_mandate_imports_returns_service(): - assert_is_instance(client.mandate_imports, services.MandateImportsService) - -def test_mandate_import_entries_returns_service(): - assert_is_instance(client.mandate_import_entries, services.MandateImportEntriesService) - -def test_mandate_pdfs_returns_service(): - assert_is_instance(client.mandate_pdfs, services.MandatePdfsService) - -def test_negative_balance_limits_returns_service(): - assert_is_instance(client.negative_balance_limits, services.NegativeBalanceLimitsService) - -def test_payer_authorisations_returns_service(): - assert_is_instance(client.payer_authorisations, services.PayerAuthorisationsService) - -def test_payments_returns_service(): - assert_is_instance(client.payments, services.PaymentsService) - -def test_payouts_returns_service(): - assert_is_instance(client.payouts, services.PayoutsService) - -def test_payout_items_returns_service(): - assert_is_instance(client.payout_items, services.PayoutItemsService) - -def test_redirect_flows_returns_service(): - assert_is_instance(client.redirect_flows, services.RedirectFlowsService) - -def test_refunds_returns_service(): - assert_is_instance(client.refunds, services.RefundsService) - -def test_scenario_simulators_returns_service(): - assert_is_instance(client.scenario_simulators, services.ScenarioSimulatorsService) - -def test_scheme_identifiers_returns_service(): - assert_is_instance(client.scheme_identifiers, services.SchemeIdentifiersService) - -def test_subscriptions_returns_service(): - assert_is_instance(client.subscriptions, services.SubscriptionsService) - -def test_tax_rates_returns_service(): - assert_is_instance(client.tax_rates, services.TaxRatesService) - -def test_verification_details_returns_service(): - assert_is_instance(client.verification_details, services.VerificationDetailsService) - -def test_webhooks_returns_service(): - assert_is_instance(client.webhooks, services.WebhooksService) - diff --git a/tests/error_tests.py b/tests/error_tests.py deleted file mode 100644 index a6c8ca22..00000000 --- a/tests/error_tests.py +++ /dev/null @@ -1,57 +0,0 @@ -# WARNING: Do not edit by hand, this file was generated by Crank: -# -# https://github.com/gocardless/crank -# - -from nose.tools import assert_equal -from gocardless_pro import errors - -from . import helpers - -def test_invalid_state_error_message(): - fixture = helpers.load_fixture('invalid_state_error') - response_errors = fixture.get('error').get('errors', []) - error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) - assert_equal(errors.InvalidStateError, error) - error = error(fixture['error']) - assert_equal(str(error), 'Mandate is already active or being submitted') - -def test_invalid_api_usage_message(): - fixture = helpers.load_fixture('invalid_api_usage_error') - response_errors = fixture.get('error').get('errors', []) - error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) - assert_equal(errors.InvalidApiUsageError, error) - error = error(fixture['error']) - assert_equal(str(error), 'Invalid document structure (Root element must be an object.)') - -def test_validation_failed_message(): - fixture = helpers.load_fixture('validation_failed_error') - response_errors = fixture.get('error').get('errors', []) - error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) - assert_equal(errors.ValidationFailedError, error) - error = error(fixture['error']) - assert_equal(str(error), 'Validation failed (branch_code must be a number, country_code is invalid)') - -def test_validation_failed_duplicate_bank_account_message(): - fixture = helpers.load_fixture('validation_failed_duplicate_bank_account_error') - response_errors = fixture.get('error').get('errors', []) - error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) - assert_equal(errors.ValidationFailedError, error) - error = error(fixture['error']) - assert_equal(str(error), 'Bank account already exists') - -def test_gocardless_error_message(): - fixture = helpers.load_fixture('gocardless_error') - response_errors = fixture.get('error').get('errors', []) - error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], response_errors) - assert_equal(errors.GoCardlessInternalError, error) - error = error(fixture['error']) - assert_equal(str(error), 'Uh-oh!') - -def test_idempotent_creation_conflict_error_message(): - fixture = helpers.idempotent_creation_conflict_body('PM00001078ZJJN') - error = errors.ApiError.exception_for(fixture['error']['code'],fixture['error']['type'], fixture['error']['errors']) - assert_equal(errors.IdempotentCreationConflictError, error) - error = error(fixture['error']) - assert_equal(str(error), 'None (A resource has already been created with this idempotency key)') - assert_equal(error.conflicting_resource_id, "PM00001078ZJJN") diff --git a/tests/fixtures/bank_account_details.json b/tests/fixtures/bank_account_details.json index f963fefb..266315f2 100644 --- a/tests/fixtures/bank_account_details.json +++ b/tests/fixtures/bank_account_details.json @@ -3,6 +3,6 @@ "method": "GET", "path_template": "/bank_account_details/:identity", "url_params": ["BA123"], - "body": {"bank_account_details":{"ciphertext":"example ciphertext 456","encrypted_key":"example encrypted_key 4425","iv":"example iv 2540","protected":"example protected 1318","tag":"example tag 2081"}} + "body": {"bank_account_details":{"ciphertext":"example ciphertext 4425","encrypted_key":"example encrypted_key 2081","iv":"example iv 1318","protected":"example protected 456","tag":"example tag 2540"}} } } diff --git a/tests/fixtures/bank_authorisations.json b/tests/fixtures/bank_authorisations.json index 4e4a1904..26bec99f 100644 --- a/tests/fixtures/bank_authorisations.json +++ b/tests/fixtures/bank_authorisations.json @@ -3,12 +3,12 @@ "method": "POST", "path_template": "/bank_authorisations", "url_params": [], - "body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 3300","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2025-06-23T10:21:09.159Z","expires_at":"2025-06-23T10:21:09.159Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}} + "body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 3300","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2025-11-20T08:25:53.465Z","expires_at":"2025-11-20T08:25:53.465Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}} }, "get": { "method": "GET", "path_template": "/bank_authorisations/:identity", "url_params": ["BAU123"], - "body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 694","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2025-06-23T10:21:09.160Z","expires_at":"2025-06-23T10:21:09.160Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}} + "body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 694","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2025-11-20T08:25:53.465Z","expires_at":"2025-11-20T08:25:53.465Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}} } } diff --git a/tests/fixtures/billing_request_flows.json b/tests/fixtures/billing_request_flows.json index 5787387f..3e7579d2 100644 --- a/tests/fixtures/billing_request_flows.json +++ b/tests/fixtures/billing_request_flows.json @@ -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":"2025-06-23T10:21:09.171Z","customer_details_captured":false,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2025-06-23T10:21:09.171Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":false,"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":"user@example.com","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":true,"show_success_redirect_button":false,"skip_success_screen":true}} + "body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":false,"created_at":"2025-11-20T08:25:53.469Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2025-11-20T08:25:53.469Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":false,"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":"user@example.com","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":true,"show_success_redirect_button":false,"skip_success_screen":true}} }, "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":false,"created_at":"2025-06-23T10:21:09.171Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2025-06-23T10:21:09.171Z","id":"BRF123","language":"en","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":"user@example.com","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,"show_success_redirect_button":true,"skip_success_screen":true}} + "body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":true,"created_at":"2025-11-20T08:25:53.469Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2025-11-20T08:25:53.469Z","id":"BRF123","language":"en","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":"user@example.com","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,"show_success_redirect_button":false,"skip_success_screen":true}} } } diff --git a/tests/fixtures/billing_request_templates.json b/tests/fixtures/billing_request_templates.json index 5b98c9be..89d42cd3 100644 --- a/tests/fixtures/billing_request_templates.json +++ b/tests/fixtures/billing_request_templates.json @@ -3,24 +3,24 @@ "method": "GET", "path_template": "/billing_request_templates", "url_params": [], - "body": {"billing_request_templates":[{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 2205","max_amount_per_payment":1406,"payment_method":"example payment_method 2474","periodic_limits":[{"alignment":"calendar","max_payments":894,"max_total_amount":1723,"period":"flexible"}],"start_date":"example start_date 3780"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"},{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 7574","max_amount_per_payment":8610,"payment_method":"example payment_method 30","periodic_limits":[{"alignment":"creation_date","max_payments":7650,"max_total_amount":2523,"period":"flexible"}],"start_date":"example start_date 8033"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 9277","before":"example before 909"},"limit":50}} + "body": {"billing_request_templates":[{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 2474","max_amount_per_payment":3544,"payment_method":"example payment_method 1723","periodic_limits":[{"alignment":"creation_date","max_payments":3922,"max_total_amount":894,"period":"flexible"}],"start_date":"example start_date 1406"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"},{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 7650","max_amount_per_payment":909,"payment_method":"example payment_method 9277","periodic_limits":[{"alignment":"calendar","max_payments":5395,"max_total_amount":30,"period":"day"}],"start_date":"example start_date 2523"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 671","before":"example before 5645"},"limit":50}} }, "get": { "method": "GET", "path_template": "/billing_request_templates/:identity", "url_params": ["BRT123"], - "body": {"billing_request_templates":{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 5645","max_amount_per_payment":671,"payment_method":"example payment_method 7208","periodic_limits":[{"alignment":"calendar","max_payments":8879,"max_total_amount":2734,"period":"year"}],"start_date":"example start_date 4721"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}} + "body": {"billing_request_templates":{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 8198","max_amount_per_payment":2734,"payment_method":"example payment_method 8879","periodic_limits":[{"alignment":"calendar","max_payments":7587,"max_total_amount":4721,"period":"flexible"}],"start_date":"example start_date 7208"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}} }, "create": { "method": "POST", "path_template": "/billing_request_templates", "url_params": [], - "body": {"billing_request_templates":{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 9326","max_amount_per_payment":10,"payment_method":"example payment_method 3921","periodic_limits":[{"alignment":"calendar","max_payments":8849,"max_total_amount":9301,"period":"month"}],"start_date":"example start_date 7587"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}} + "body": {"billing_request_templates":{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 3920","max_amount_per_payment":8374,"payment_method":"example payment_method 10","periodic_limits":[{"alignment":"creation_date","max_payments":9301,"max_total_amount":1267,"period":"week"}],"start_date":"example start_date 9488"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}} }, "update": { "method": "PUT", "path_template": "/billing_request_templates/:identity", - "url_params": ["BRQ123"], - "body": {"billing_request_templates":{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 75","max_amount_per_payment":3920,"payment_method":"example payment_method 8374","periodic_limits":[{"alignment":"calendar","max_payments":4401,"max_total_amount":5596,"period":"year"}],"start_date":"example start_date 9466"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}} + "url_params": ["BRT123"], + "body": {"billing_request_templates":{"authorisation_url":"https://pay.gocardless.com/BRT123","created_at":"2021-01-01T12:00:00.000Z","id":"BRT123","mandate_request_constraints":{"end_date":"example end_date 4401","max_amount_per_payment":8140,"payment_method":"example payment_method 3973","periodic_limits":[{"alignment":"calendar","max_payments":5596,"max_total_amount":6110,"period":"day"}],"start_date":"example start_date 6872"},"mandate_request_currency":"GBP","mandate_request_description":"Top-up Payment","mandate_request_metadata":{},"mandate_request_scheme":"bacs","mandate_request_verify":null,"metadata":{},"name":"12 Month Gold Plan","payment_request_amount":"100.00","payment_request_currency":"GBP","payment_request_description":"Top-up Payment","payment_request_metadata":{},"payment_request_scheme":"faster_payments","redirect_uri":"https://my-website.com/abc/callback","updated_at":"2021-01-01T12:00:00.000Z"}} } } diff --git a/tests/fixtures/billing_request_with_actions.json b/tests/fixtures/billing_request_with_actions.json index b661054d..aca9beac 100644 --- a/tests/fixtures/billing_request_with_actions.json +++ b/tests/fixtures/billing_request_with_actions.json @@ -3,6 +3,6 @@ "method": "POST", "path_template": "/billing_requests/create_with_actions", "url_params": [], - "body": {"billing_request_with_actions":{"bank_authorisations":{"authorisation_type":"example authorisation_type 6110","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2025-06-23T10:21:09.173Z","expires_at":"2025-06-23T10:21:09.173Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"},"billing_requests":{"actions":[{"available_currencies":["example available_currencies 7221"],"bank_authorisation":{"adapter":"example adapter 2239","authorisation_type":"example authorisation_type 7694"},"collect_customer_details":{"default_country_code":"example default_country_code 7045","incomplete_fields":{"customer":["example customer 541"],"customer_billing_detail":["example customer_billing_detail 5642"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 5214"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 7913","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 6872","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 1300","constraints":{"end_date":"example end_date 1488","max_amount_per_payment":8223,"payment_method":"example payment_method 1925","periodic_limits":[{"alignment":"calendar","max_payments":9219,"max_total_amount":9026,"period":"flexible"}],"start_date":"example start_date 6487"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 8619"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":true,"verify":"when_available"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 1436"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"pension","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 1446"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 325"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 913"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}}} + "body": {"billing_request_with_actions":{"bank_authorisations":{"authorisation_type":"example authorisation_type 9750","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2025-11-20T08:25:53.471Z","expires_at":"2025-11-20T08:25:53.471Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"},"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 1446","authorisation_type":"example authorisation_type 9921"},"collect_customer_details":{"default_country_code":"example default_country_code 6244","incomplete_fields":{"customer":["example customer 7063"],"customer_billing_detail":["example customer_billing_detail 1436"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 325"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 8223","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 1925","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 9434","constraints":{"end_date":"example end_date 8051","max_amount_per_payment":9026,"payment_method":"example payment_method 9219","periodic_limits":[{"alignment":"calendar","max_payments":8730,"max_total_amount":3114,"period":"day"}],"start_date":"example start_date 1300"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"mandate":"example mandate 7045"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":false,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 7694"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"Trade","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 6487"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 1488"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 7913"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}}} } } diff --git a/tests/fixtures/billing_requests.json b/tests/fixtures/billing_requests.json index b0dc0332..c76d31ff 100644 --- a/tests/fixtures/billing_requests.json +++ b/tests/fixtures/billing_requests.json @@ -3,72 +3,72 @@ "method": "POST", "path_template": "/billing_requests", "url_params": [], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 1211"],"bank_authorisation":{"adapter":"example adapter 4728","authorisation_type":"example authorisation_type 3274"},"collect_customer_details":{"default_country_code":"example default_country_code 8511","incomplete_fields":{"customer":["example customer 8162"],"customer_billing_detail":["example customer_billing_detail 5089"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 5194"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 1737","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 5356","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 3237","constraints":{"end_date":"example end_date 8047","max_amount_per_payment":9947,"payment_method":"example payment_method 8287","periodic_limits":[{"alignment":"calendar","max_payments":5466,"max_total_amount":495,"period":"week"}],"start_date":"example start_date 6258"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 3015"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 5026"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"personal","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 5429"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 6831"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 408"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 1737","authorisation_type":"example authorisation_type 631"},"collect_customer_details":{"default_country_code":"example default_country_code 6831","incomplete_fields":{"customer":["example customer 5429"],"customer_billing_detail":["example customer_billing_detail 5356"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 1211"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 8162","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 8511","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"web","consent_type":"example consent_type 3015","constraints":{"end_date":"example end_date 2888","max_amount_per_payment":495,"payment_method":"example payment_method 5466","periodic_limits":[{"alignment":"creation_date","max_payments":6258,"max_total_amount":1528,"period":"month"}],"start_date":"example start_date 8287"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"mandate":"example mandate 5541"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"when_available"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 563"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"Commercial","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 3090"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 6413"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 4728"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} }, "collect_customer_details": { "method": "POST", "path_template": "/billing_requests/:identity/actions/collect_customer_details", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 5746"],"bank_authorisation":{"adapter":"example adapter 7202","authorisation_type":"example authorisation_type 4783"},"collect_customer_details":{"default_country_code":"example default_country_code 8266","incomplete_fields":{"customer":["example customer 9828"],"customer_billing_detail":["example customer_billing_detail 5561"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 2433"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 4078","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 4324","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"web","consent_type":"example consent_type 3721","constraints":{"end_date":"example end_date 4538","max_amount_per_payment":9703,"payment_method":"example payment_method 9355","periodic_limits":[{"alignment":"creation_date","max_payments":7189,"max_total_amount":8705,"period":"day"}],"start_date":"example start_date 2888"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 1353"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"always"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 1577"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"mortgage","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 5447"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 9718"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 9002"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 5746","authorisation_type":"example authorisation_type 1563"},"collect_customer_details":{"default_country_code":"example default_country_code 4376","incomplete_fields":{"customer":["example customer 9002"],"customer_billing_detail":["example customer_billing_detail 9718"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 7202"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 8266","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 9828","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 2888","constraints":{"end_date":"example end_date 2433","max_amount_per_payment":4147,"payment_method":"example payment_method 4078","periodic_limits":[{"alignment":"creation_date","max_payments":1353,"max_total_amount":6159,"period":"flexible"}],"start_date":"example start_date 3721"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"mandate":"example mandate 8705"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 156"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"personal","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 1577"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 5094"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 9355"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} }, "collect_bank_account": { "method": "POST", "path_template": "/billing_requests/:identity/actions/collect_bank_account", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 1137"],"bank_authorisation":{"adapter":"example adapter 7463","authorisation_type":"example authorisation_type 7996"},"collect_customer_details":{"default_country_code":"example default_country_code 6420","incomplete_fields":{"customer":["example customer 953"],"customer_billing_detail":["example customer_billing_detail 8623"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 3033"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 2002","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 3891","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 9843","constraints":{"end_date":"example end_date 2205","max_amount_per_payment":1598,"payment_method":"example payment_method 7425","periodic_limits":[{"alignment":"creation_date","max_payments":1351,"max_total_amount":3687,"period":"month"}],"start_date":"example start_date 8010"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 552"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":true,"verify":"when_available"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 2546"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"loan","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 6503"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 7940"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 3133"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 7463","authorisation_type":"example authorisation_type 7996"},"collect_customer_details":{"default_country_code":"example default_country_code 6420","incomplete_fields":{"customer":["example customer 8623"],"customer_billing_detail":["example customer_billing_detail 953"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 8878"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 9241","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 3133","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 8590","constraints":{"end_date":"example end_date 9757","max_amount_per_payment":552,"payment_method":"example payment_method 9843","periodic_limits":[{"alignment":"creation_date","max_payments":7425,"max_total_amount":1598,"period":"day"}],"start_date":"example start_date 1515"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"mandate":"example mandate 3632"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":false,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 9107"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"pension","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 2546"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 9336"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 8643"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} }, "confirm_payer_details": { "method": "POST", "path_template": "/billing_requests/:identity/actions/confirm_payer_details", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 6137"],"bank_authorisation":{"adapter":"example adapter 1297","authorisation_type":"example authorisation_type 9267"},"collect_customer_details":{"default_country_code":"example default_country_code 9271","incomplete_fields":{"customer":["example customer 7726"],"customer_billing_detail":["example customer_billing_detail 5894"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 4547"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 8582","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 8591","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 4885","constraints":{"end_date":"example end_date 3086","max_amount_per_payment":9819,"payment_method":"example payment_method 5802","periodic_limits":[{"alignment":"creation_date","max_payments":3981,"max_total_amount":1270,"period":"week"}],"start_date":"example start_date 493"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 7175"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"minimum"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 3098"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"mortgage","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 1528"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 3749"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 7903"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 3749","authorisation_type":"example authorisation_type 1528"},"collect_customer_details":{"default_country_code":"example default_country_code 2818","incomplete_fields":{"customer":["example customer 7903"],"customer_billing_detail":["example customer_billing_detail 4384"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 8582"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 6052","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 7175","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 1297","constraints":{"end_date":"example end_date 7726","max_amount_per_payment":5802,"payment_method":"example payment_method 3981","periodic_limits":[{"alignment":"calendar","max_payments":2066,"max_total_amount":2079,"period":"year"}],"start_date":"example start_date 5894"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"mandate":"example mandate 9271"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 4885"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"Epayment","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 4547"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 1224"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 8553"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} }, "fulfil": { "method": "POST", "path_template": "/billing_requests/:identity/actions/fulfil", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 7051"],"bank_authorisation":{"adapter":"example adapter 540","authorisation_type":"example authorisation_type 5786"},"collect_customer_details":{"default_country_code":"example default_country_code 1532","incomplete_fields":{"customer":["example customer 3616"],"customer_billing_detail":["example customer_billing_detail 7839"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 8844"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 440","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 4535","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"web","consent_type":"example consent_type 4208","constraints":{"end_date":"example end_date 8154","max_amount_per_payment":7822,"payment_method":"example payment_method 1223","periodic_limits":[{"alignment":"creation_date","max_payments":3767,"max_total_amount":2258,"period":"month"}],"start_date":"example start_date 7578"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 7342"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":false,"verify":"when_available"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 3640"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"tax","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 9183"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 2305"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 1166"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 1532","authorisation_type":"example authorisation_type 3616"},"collect_customer_details":{"default_country_code":"example default_country_code 5786","incomplete_fields":{"customer":["example customer 540"],"customer_billing_detail":["example customer_billing_detail 7839"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 7822"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 7743","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 1968","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 3231","constraints":{"end_date":"example end_date 7351","max_amount_per_payment":8844,"payment_method":"example payment_method 364","periodic_limits":[{"alignment":"creation_date","max_payments":90,"max_total_amount":4801,"period":"year"}],"start_date":"example start_date 3640"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"mandate":"example mandate 7578"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"always"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 3162"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"government","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 7342"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 1223"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 3710"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} }, "cancel": { "method": "POST", "path_template": "/billing_requests/:identity/actions/cancel", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 5399"],"bank_authorisation":{"adapter":"example adapter 7886","authorisation_type":"example authorisation_type 5320"},"collect_customer_details":{"default_country_code":"example default_country_code 1092","incomplete_fields":{"customer":["example customer 8831"],"customer_billing_detail":["example customer_billing_detail 7577"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 4415"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 3447","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 1162","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 783","constraints":{"end_date":"example end_date 870","max_amount_per_payment":2984,"payment_method":"example payment_method 8247","periodic_limits":[{"alignment":"calendar","max_payments":565,"max_total_amount":8010,"period":"flexible"}],"start_date":"example start_date 7920"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 9513"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":false,"verify":"when_available"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 2048"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"government","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 6200"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 8666"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 9371"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 783","authorisation_type":"example authorisation_type 6720"},"collect_customer_details":{"default_country_code":"example default_country_code 870","incomplete_fields":{"customer":["example customer 8247"],"customer_billing_detail":["example customer_billing_detail 2984"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 3430"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 8010","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 565","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 6629","constraints":{"end_date":"example end_date 8666","max_amount_per_payment":6200,"payment_method":"example payment_method 4162","periodic_limits":[{"alignment":"calendar","max_payments":6829,"max_total_amount":6756,"period":"year"}],"start_date":"example start_date 5695"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"mandate":"example mandate 8831"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":false,"verify":"minimum"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 5399"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"utility","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 4415"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 9371"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 9700"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} }, "list": { "method": "GET", "path_template": "/billing_requests", "url_params": [], - "body": {"billing_requests":[{"created_at":"2015-01-01T12:00:00.000Z","id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 9386"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 2632","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 2520","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 1853","constraints":{"end_date":"example end_date 9103","max_amount_per_payment":9888,"payment_method":"example payment_method 8318","periodic_limits":[{"alignment":"creation_date","max_payments":7807,"max_total_amount":2019,"period":"week"}],"start_date":"example start_date 6611"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 2181"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"always"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 8795"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 1393"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}},{"created_at":"2015-01-01T12:00:00.000Z","id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 260"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 7029","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 1661","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"web","consent_type":"example consent_type 1079","constraints":{"end_date":"example end_date 4637","max_amount_per_payment":2060,"payment_method":"example payment_method 9551","periodic_limits":[{"alignment":"calendar","max_payments":1757,"max_total_amount":1181,"period":"day"}],"start_date":"example start_date 7039"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 2420"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":true,"verify":"minimum"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 5561"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 6685"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}],"meta":{"cursors":{"after":"example after 1719","before":"example before 1215"},"limit":50}} + "body": {"billing_requests":[{"created_at":"2015-01-01T12:00:00.000Z","id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 9386"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 1888","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 292","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 1853","constraints":{"end_date":"example end_date 8652","max_amount_per_payment":8675,"payment_method":"example payment_method 9888","periodic_limits":[{"alignment":"creation_date","max_payments":2019,"max_total_amount":3756,"period":"year"}],"start_date":"example start_date 6157"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"mandate":"example mandate 9103"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":false,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 2520"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 8470"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}},{"created_at":"2015-01-01T12:00:00.000Z","id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 60"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 2954","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 1464","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 1509","constraints":{"end_date":"example end_date 600","max_amount_per_payment":7039,"payment_method":"example payment_method 4637","periodic_limits":[{"alignment":"creation_date","max_payments":1181,"max_total_amount":9551,"period":"day"}],"start_date":"example start_date 9516"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"mandate":"example mandate 2804"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":false,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 2420"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 3922"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}],"meta":{"cursors":{"after":"example after 1040","before":"example before 5014"},"limit":50}} }, "get": { "method": "GET", "path_template": "/billing_requests/:identity", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 8662"],"bank_authorisation":{"adapter":"example adapter 3173","authorisation_type":"example authorisation_type 235"},"collect_customer_details":{"default_country_code":"example default_country_code 5740","incomplete_fields":{"customer":["example customer 6000"],"customer_billing_detail":["example customer_billing_detail 9284"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 7420"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 1040","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 5014","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 8070","constraints":{"end_date":"example end_date 1544","max_amount_per_payment":2395,"payment_method":"example payment_method 2174","periodic_limits":[{"alignment":"calendar","max_payments":7293,"max_total_amount":3524,"period":"month"}],"start_date":"example start_date 3472"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 3338"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":false,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 5265"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"salary","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 8151"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 6117"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 421"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 3479","authorisation_type":"example authorisation_type 6592"},"collect_customer_details":{"default_country_code":"example default_country_code 8151","incomplete_fields":{"customer":["example customer 8682"],"customer_billing_detail":["example customer_billing_detail 5265"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 8662"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 9284","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 6000","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"web","consent_type":"example consent_type 6336","constraints":{"end_date":"example end_date 3472","max_amount_per_payment":1544,"payment_method":"example payment_method 2395","periodic_limits":[{"alignment":"calendar","max_payments":1237,"max_total_amount":2174,"period":"year"}],"start_date":"example start_date 3338"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"mandate":"example mandate 2869"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"minimum"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 8622"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"other","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 574"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 2390"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 235"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} }, "notify": { "method": "POST", "path_template": "/billing_requests/:identity/actions/notify", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 3546"],"bank_authorisation":{"adapter":"example adapter 4467","authorisation_type":"example authorisation_type 2286"},"collect_customer_details":{"default_country_code":"example default_country_code 6114","incomplete_fields":{"customer":["example customer 4658"],"customer_billing_detail":["example customer_billing_detail 259"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 1874"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 7587","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 1657","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 5528","constraints":{"end_date":"example end_date 5166","max_amount_per_payment":9859,"payment_method":"example payment_method 4231","periodic_limits":[{"alignment":"creation_date","max_payments":4511,"max_total_amount":855,"period":"week"}],"start_date":"example start_date 1053"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 7008"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 9723"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"government","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 6537"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 106"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 6774"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 4511","authorisation_type":"example authorisation_type 5343"},"collect_customer_details":{"default_country_code":"example default_country_code 1053","incomplete_fields":{"customer":["example customer 5166"],"customer_billing_detail":["example customer_billing_detail 9859"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 8721"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 6039","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 6531","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"web","consent_type":"example consent_type 4658","constraints":{"end_date":"example end_date 8284","max_amount_per_payment":2375,"payment_method":"example payment_method 1874","periodic_limits":[{"alignment":"calendar","max_payments":6537,"max_total_amount":106,"period":"month"}],"start_date":"example start_date 6114"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"mandate":"example mandate 9723"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":false,"verify":"minimum"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 7587"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"gambling","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 8408"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 9867"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 4231"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} }, "fallback": { "method": "POST", "path_template": "/billing_requests/:identity/actions/fallback", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 5516"],"bank_authorisation":{"adapter":"example adapter 4983","authorisation_type":"example authorisation_type 928"},"collect_customer_details":{"default_country_code":"example default_country_code 6039","incomplete_fields":{"customer":["example customer 8146"],"customer_billing_detail":["example customer_billing_detail 6531"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 9081"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 7418","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 8345","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"web","consent_type":"example consent_type 7477","constraints":{"end_date":"example end_date 6789","max_amount_per_payment":4698,"payment_method":"example payment_method 2887","periodic_limits":[{"alignment":"creation_date","max_payments":5036,"max_total_amount":7412,"period":"day"}],"start_date":"example start_date 7762"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 4926"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 7653"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"pension","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 8602"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 6861"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 2120"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 4405","authorisation_type":"example authorisation_type 9081"},"collect_customer_details":{"default_country_code":"example default_country_code 7276","incomplete_fields":{"customer":["example customer 1466"],"customer_billing_detail":["example customer_billing_detail 1509"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 4983"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 5036","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 7412","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"telephone","consent_type":"example consent_type 2120","constraints":{"end_date":"example end_date 7871","max_amount_per_payment":7653,"payment_method":"example payment_method 1128","periodic_limits":[{"alignment":"calendar","max_payments":8602,"max_total_amount":6861,"period":"flexible"}],"start_date":"example start_date 8345"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"mandate":"example mandate 4698"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"minimum"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"payment":"example payment 7762"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"dependant_support","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 7477"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 4926"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 556"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} }, "choose_currency": { "method": "POST", "path_template": "/billing_requests/:identity/actions/choose_currency", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 4993"],"bank_authorisation":{"adapter":"example adapter 3380","authorisation_type":"example authorisation_type 3808"},"collect_customer_details":{"default_country_code":"example default_country_code 4267","incomplete_fields":{"customer":["example customer 1478"],"customer_billing_detail":["example customer_billing_detail 2175"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 2677"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 8477","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 4834","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 496","constraints":{"end_date":"example end_date 3162","max_amount_per_payment":9673,"payment_method":"example payment_method 6972","periodic_limits":[{"alignment":"creation_date","max_payments":442,"max_total_amount":2884,"period":"year"}],"start_date":"example start_date 9023"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 5527"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":false,"verify":"when_available"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 8531"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"dependant_support","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 2574"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 9731"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 7695"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 3808","authorisation_type":"example authorisation_type 2631"},"collect_customer_details":{"default_country_code":"example default_country_code 2884","incomplete_fields":{"customer":["example customer 8265"],"customer_billing_detail":["example customer_billing_detail 8558"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 2677"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 4834","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 580","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"web","consent_type":"example consent_type 3740","constraints":{"end_date":"example end_date 5048","max_amount_per_payment":3162,"payment_method":"example payment_method 9673","periodic_limits":[{"alignment":"calendar","max_payments":5527,"max_total_amount":9158,"period":"year"}],"start_date":"example start_date 496"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"mandate":"example mandate 9023"},"metadata":{},"payer_requested_dual_signature":false,"scheme":"bacs","sweeping":true,"verify":"when_available"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 3654"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"salary","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 4993"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 3380"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 8477"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}} }, "select_institution": { "method": "POST", "path_template": "/billing_requests/:identity/actions/select_institution", "url_params": ["BRQ123"], - "body": {"billing_requests":{"actions":[{"available_currencies":["example available_currencies 5740"],"bank_authorisation":{"adapter":"example adapter 7774","authorisation_type":"example authorisation_type 8475"},"collect_customer_details":{"default_country_code":"example default_country_code 8089","incomplete_fields":{"customer":["example customer 5814"],"customer_billing_detail":["example customer_billing_detail 545"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 5402"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 8193","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 3421","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 8853","constraints":{"end_date":"example end_date 922","max_amount_per_payment":45,"payment_method":"example payment_method 6494","periodic_limits":[{"alignment":"calendar","max_payments":4024,"max_total_amount":8999,"period":"week"}],"start_date":"example start_date 6765"},"currency":"GBP","description":"Top-up Payment","links":{"mandate":"example mandate 4007"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":false,"verify":"recommended"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 604"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"gambling","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 4330"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 3483"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 4187"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} + "body": {"billing_requests":{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 4024","authorisation_type":"example authorisation_type 1420"},"collect_customer_details":{"default_country_code":"example default_country_code 6494","incomplete_fields":{"customer":["example customer 4806"],"customer_billing_detail":["example customer_billing_detail 8999"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":true,"fallback_occurred":false,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 4187"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":false,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 604","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 3421","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 7759","constraints":{"end_date":"example end_date 5740","max_amount_per_payment":8089,"payment_method":"example payment_method 5814","periodic_limits":[{"alignment":"calendar","max_payments":8853,"max_total_amount":3357,"period":"flexible"}],"start_date":"example start_date 8475"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"direct","links":{"mandate":"example mandate 545"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":true,"verify":"always"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 8193"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"Commercial","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 922"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 6765"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 3483"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21"}}} } } diff --git a/tests/fixtures/blocks.json b/tests/fixtures/blocks.json index 1cdbf80b..6ef7ca3d 100644 --- a/tests/fixtures/blocks.json +++ b/tests/fixtures/blocks.json @@ -3,36 +3,36 @@ "method": "POST", "path_template": "/blocks", "url_params": [], - "body": {"blocks":{"active":true,"block_type":"example block_type 701","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 9485","reason_type":"example reason_type 9750","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}} + "body": {"blocks":{"active":true,"block_type":"example block_type 9485","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 864","reason_type":"example reason_type 2088","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}} }, "get": { "method": "GET", "path_template": "/blocks/:identity", "url_params": ["BLC123"], - "body": {"blocks":{"active":true,"block_type":"example block_type 2088","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 4560","reason_type":"example reason_type 864","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}} + "body": {"blocks":{"active":true,"block_type":"example block_type 4560","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 9719","reason_type":"example reason_type 6216","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}} }, "list": { "method": "GET", "path_template": "/blocks", "url_params": [], - "body": {"blocks":[{"active":true,"block_type":"example block_type 6216","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 1582","reason_type":"example reason_type 9719","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"},{"active":true,"block_type":"example block_type 6813","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 6316","reason_type":"example reason_type 2516","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 3322","before":"example before 6301"},"limit":50}} + "body": {"blocks":[{"active":true,"block_type":"example block_type 6813","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 6316","reason_type":"example reason_type 1582","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"},{"active":true,"block_type":"example block_type 3322","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 2516","reason_type":"example reason_type 6301","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 9277","before":"example before 9555"},"limit":50}} }, "disable": { "method": "POST", "path_template": "/blocks/:identity/actions/disable", "url_params": ["BLC123"], - "body": {"blocks":{"active":true,"block_type":"example block_type 9555","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 3963","reason_type":"example reason_type 9277","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}} + "body": {"blocks":{"active":true,"block_type":"example block_type 3963","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 758","reason_type":"example reason_type 6217","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}} }, "enable": { "method": "POST", "path_template": "/blocks/:identity/actions/enable", "url_params": ["BLC123"], - "body": {"blocks":{"active":true,"block_type":"example block_type 6217","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 2232","reason_type":"example reason_type 758","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}} + "body": {"blocks":{"active":true,"block_type":"example block_type 2232","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 3875","reason_type":"example reason_type 7179","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}} }, "block_by_ref": { "method": "POST", "path_template": "/blocks/block_by_ref", "url_params": [], - "body": {"blocks":[{"active":true,"block_type":"example block_type 7179","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 3333","reason_type":"example reason_type 3875","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"},{"active":true,"block_type":"example block_type 3740","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 4534","reason_type":"example reason_type 7627","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 3928","before":"example before 1552"},"limit":50}} + "body": {"blocks":[{"active":true,"block_type":"example block_type 3333","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 7627","reason_type":"example reason_type 3740","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"},{"active":true,"block_type":"example block_type 1552","created_at":"2014-01-01T12:00:00.000Z","id":"BLC123","reason_description":"example reason_description 4534","reason_type":"example reason_type 3928","resource_reference":"example@example.com","updated_at":"2014-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 4647","before":"example before 7037"},"limit":50}} } } diff --git a/tests/fixtures/creditor_bank_accounts.json b/tests/fixtures/creditor_bank_accounts.json index 4c5cedbe..fc5c5eae 100644 --- a/tests/fixtures/creditor_bank_accounts.json +++ b/tests/fixtures/creditor_bank_accounts.json @@ -9,7 +9,7 @@ "method": "GET", "path_template": "/creditor_bank_accounts", "url_params": [], - "body": {"creditor_bank_accounts":[{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{},"verification_status":"successful"},{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{},"verification_status":"successful"}],"meta":{"cursors":{"after":"example after 9401","before":"example before 7328"},"limit":50}} + "body": {"creditor_bank_accounts":[{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{},"verification_status":"successful"},{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"creditor":"CR123"},"metadata":{},"verification_status":"successful"}],"meta":{"cursors":{"after":"example after 6184","before":"example before 1757"},"limit":50}} }, "get": { "method": "GET", diff --git a/tests/fixtures/creditors.json b/tests/fixtures/creditors.json index b8afe241..b929ff0a 100644 --- a/tests/fixtures/creditors.json +++ b/tests/fixtures/creditors.json @@ -3,24 +3,24 @@ "method": "POST", "path_template": "/creditors", "url_params": [], - "body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 712","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 9969","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 4647","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 7037","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"}} + "body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 9969","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 1009","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 6346","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 712","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"}} }, "list": { "method": "GET", "path_template": "/creditors", "url_params": [], - "body": {"creditors":[{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 9356","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 6346","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 104","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 1009","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"},{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 2442","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 7223","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 3589","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 6314","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"}],"meta":{"cursors":{"after":"example after 5339","before":"example before 7764"},"limit":50}} + "body": {"creditors":[{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 3589","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 6314","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 9356","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 104","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"},{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 7223","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 2442","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 5339","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 7764","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"}],"meta":{"cursors":{"after":"example after 5619","before":"example before 1730"},"limit":50}} }, "get": { "method": "GET", "path_template": "/creditors/:identity", "url_params": ["CR123"], - "body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 3360","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 9953","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 1730","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 5619","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"}} + "body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 9953","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 3360","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 894","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 5985","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"}} }, "update": { "method": "PUT", "path_template": "/creditors/:identity", "url_params": ["CR123"], - "body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 6213","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 5721","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 5985","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 894","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"}} + "body": {"creditors":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 7328","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 5721","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 9401","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 6213","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"}} } } diff --git a/tests/fixtures/currency_exchange_rates.json b/tests/fixtures/currency_exchange_rates.json index ed9323d6..4e3008a8 100644 --- a/tests/fixtures/currency_exchange_rates.json +++ b/tests/fixtures/currency_exchange_rates.json @@ -3,6 +3,6 @@ "method": "GET", "path_template": "/currency_exchange_rates", "url_params": [], - "body": {"currency_exchange_rates":[{"rate":"1.1234567890","source":"GBP","target":"EUR","time":"2014-01-01T12:00:00Z"},{"rate":"1.1234567890","source":"GBP","target":"EUR","time":"2014-01-01T12:00:00Z"}],"meta":{"cursors":{"after":"example after 6184","before":"example before 1757"},"limit":50}} + "body": {"currency_exchange_rates":[{"rate":"1.1234567890","source":"GBP","target":"EUR","time":"2014-01-01T12:00:00Z"},{"rate":"1.1234567890","source":"GBP","target":"EUR","time":"2014-01-01T12:00:00Z"}],"meta":{"cursors":{"after":"example after 4283","before":"example before 6262"},"limit":50}} } } diff --git a/tests/fixtures/customer_bank_accounts.json b/tests/fixtures/customer_bank_accounts.json index b82b53d5..94e28ef0 100644 --- a/tests/fixtures/customer_bank_accounts.json +++ b/tests/fixtures/customer_bank_accounts.json @@ -3,30 +3,30 @@ "method": "POST", "path_template": "/customer_bank_accounts", "url_params": [], - "body": {"customer_bank_accounts":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 4721"},"metadata":{}}} + "body": {"customer_bank_accounts":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 1315"},"metadata":{}}} }, "list": { "method": "GET", "path_template": "/customer_bank_accounts", "url_params": [], - "body": {"customer_bank_accounts":[{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 5540"},"metadata":{}},{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 4492"},"metadata":{}}],"meta":{"cursors":{"after":"example after 1315","before":"example before 1350"},"limit":50}} + "body": {"customer_bank_accounts":[{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 5540"},"metadata":{}},{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 4492"},"metadata":{}}],"meta":{"cursors":{"after":"example after 6591","before":"example before 342"},"limit":50}} }, "get": { "method": "GET", "path_template": "/customer_bank_accounts/:identity", "url_params": ["BA123"], - "body": {"customer_bank_accounts":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 342"},"metadata":{}}} + "body": {"customer_bank_accounts":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 1898"},"metadata":{}}} }, "update": { "method": "PUT", "path_template": "/customer_bank_accounts/:identity", "url_params": ["BA123"], - "body": {"customer_bank_accounts":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 6591"},"metadata":{}}} + "body": {"customer_bank_accounts":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 3401"},"metadata":{}}} }, "disable": { "method": "POST", "path_template": "/customer_bank_accounts/:identity/actions/disable", "url_params": ["BA123"], - "body": {"customer_bank_accounts":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 1898"},"metadata":{}}} + "body": {"customer_bank_accounts":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 5707"},"metadata":{}}} } } diff --git a/tests/fixtures/customer_notifications.json b/tests/fixtures/customer_notifications.json index 83a3ce1a..3a3231d6 100644 --- a/tests/fixtures/customer_notifications.json +++ b/tests/fixtures/customer_notifications.json @@ -3,6 +3,6 @@ "method": "POST", "path_template": "/customer_notifications/:identity/actions/handle", "url_params": ["PCN123"], - "body": {"customer_notifications":{"action_taken":"example action_taken 3401","action_taken_at":"2025-06-23T10:21:09.184Z","action_taken_by":"example action_taken_by 5707","id":"PCN123","links":{"customer":"CU123","event":"EV123","mandate":"MD123","payment":"PM123","refund":"RF123","subscription":"SB123"},"type":"payment_created"}} + "body": {"customer_notifications":{"action_taken":"example action_taken 7912","action_taken_at":"2025-11-20T08:25:53.476Z","action_taken_by":"example action_taken_by 9695","id":"PCN123","links":{"customer":"CU123","event":"EV123","mandate":"MD123","payment":"PM123","refund":"RF123","subscription":"SB123"},"type":"payment_created"}} } } diff --git a/tests/fixtures/customers.json b/tests/fixtures/customers.json index 14d9b141..91218144 100644 --- a/tests/fixtures/customers.json +++ b/tests/fixtures/customers.json @@ -9,7 +9,7 @@ "method": "GET", "path_template": "/customers", "url_params": [], - "body": {"customers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"}],"meta":{"cursors":{"after":"example after 6262","before":"example before 4283"},"limit":50}} + "body": {"customers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"}],"meta":{"cursors":{"after":"example after 1350","before":"example before 4721"},"limit":50}} }, "get": { "method": "GET", diff --git a/tests/fixtures/events.json b/tests/fixtures/events.json index 2118f764..dc4ee6fb 100644 --- a/tests/fixtures/events.json +++ b/tests/fixtures/events.json @@ -3,12 +3,12 @@ "method": "GET", "path_template": "/events", "url_params": [], - "body": {"events":[{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","customer_notifications":[{"deadline":"2025-06-23T10:21:09.185Z","id":"PCN123","mandatory":true,"type":"example type 6516"}],"details":{"bank_account_id":"BA123","cause":"bank_account_disabled","currency":"GBP","description":"Customer's bank account closed","item_count":10,"not_retried_reason":"failure_filter_applied","origin":"bank","property":"fx_payout_currency","reason_code":"ADDACS-B","scheme":"bacs","will_attempt_retry":true},"id":"EV123","links":{"bank_authorisation":"BAU123","billing_request":"BRQ123","billing_request_flow":"BRF123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","instalment_schedule":"IS123","mandate":"MD123","mandate_request_mandate":"MD123","new_customer_bank_account":"BA123","new_mandate":"MD123","organisation":"OR123","parent_event":"EV123","payer_authorisation":"PAU123","payment":"PM123","payment_request_payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","scheme_identifier":"SU123","subscription":"SB123"},"metadata":{},"resource_metadata":{},"resource_type":"mandates"},{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","customer_notifications":[{"deadline":"2025-06-23T10:21:09.185Z","id":"PCN123","mandatory":false,"type":"example type 2283"}],"details":{"bank_account_id":"BA123","cause":"bank_account_disabled","currency":"GBP","description":"Customer's bank account closed","item_count":10,"not_retried_reason":"failure_filter_applied","origin":"bank","property":"fx_payout_currency","reason_code":"ADDACS-B","scheme":"bacs","will_attempt_retry":true},"id":"EV123","links":{"bank_authorisation":"BAU123","billing_request":"BRQ123","billing_request_flow":"BRF123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","instalment_schedule":"IS123","mandate":"MD123","mandate_request_mandate":"MD123","new_customer_bank_account":"BA123","new_mandate":"MD123","organisation":"OR123","parent_event":"EV123","payer_authorisation":"PAU123","payment":"PM123","payment_request_payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","scheme_identifier":"SU123","subscription":"SB123"},"metadata":{},"resource_metadata":{},"resource_type":"mandates"}],"meta":{"cursors":{"after":"example after 9695","before":"example before 7912"},"limit":50}} + "body": {"events":[{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","customer_notifications":[{"deadline":"2025-11-20T08:25:53.477Z","id":"PCN123","mandatory":false,"type":"example type 6452"}],"details":{"bank_account_id":"BA123","cause":"bank_account_disabled","currency":"GBP","description":"Customer's bank account closed","item_count":10,"not_retried_reason":"failure_filter_applied","origin":"bank","property":"fx_payout_currency","reason_code":"ADDACS-B","scheme":"bacs","will_attempt_retry":true},"id":"EV123","links":{"bank_authorisation":"BAU123","billing_request":"BRQ123","billing_request_flow":"BRF123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","instalment_schedule":"IS123","mandate":"MD123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","new_customer_bank_account":"BA123","new_mandate":"MD123","organisation":"OR123","parent_event":"EV123","payer_authorisation":"PAU123","payment":"PM123","payment_request_payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","scheme_identifier":"SU123","subscription":"SB123"},"metadata":{},"resource_metadata":{},"resource_type":"mandates","source":{"name":"Joe Bloggs","type":"app"}},{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","customer_notifications":[{"deadline":"2025-11-20T08:25:53.477Z","id":"PCN123","mandatory":false,"type":"example type 3755"}],"details":{"bank_account_id":"BA123","cause":"bank_account_disabled","currency":"GBP","description":"Customer's bank account closed","item_count":10,"not_retried_reason":"failure_filter_applied","origin":"bank","property":"fx_payout_currency","reason_code":"ADDACS-B","scheme":"bacs","will_attempt_retry":true},"id":"EV123","links":{"bank_authorisation":"BAU123","billing_request":"BRQ123","billing_request_flow":"BRF123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","instalment_schedule":"IS123","mandate":"MD123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","new_customer_bank_account":"BA123","new_mandate":"MD123","organisation":"OR123","parent_event":"EV123","payer_authorisation":"PAU123","payment":"PM123","payment_request_payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","scheme_identifier":"SU123","subscription":"SB123"},"metadata":{},"resource_metadata":{},"resource_type":"mandates","source":{"name":"Joe Bloggs","type":"app"}}],"linked":{"billing_requests":[{"actions":[{"available_currencies":["GBP"],"bank_authorisation":{"adapter":"example adapter 4135","authorisation_type":"example authorisation_type 2748"},"collect_customer_details":{"default_country_code":"example default_country_code 9350","incomplete_fields":{"customer":["example customer 5652"],"customer_billing_detail":["example customer_billing_detail 3040"]}},"completes_actions":["collect_bank_account"],"institution_guess_status":"pending","required":true,"requires_actions":["collect_bank_account"],"status":"pending","type":"collect_bank_details"}],"created_at":"2015-01-01T12:00:00.000Z","fallback_enabled":false,"fallback_occurred":true,"id":"BRQ123","instalment_schedule_request":{"app_fee":100,"currency":"USD","instalments_with_dates":[{"amount":250,"charge_date":"2020-11-03"}],"instalments_with_schedule":{"amounts":[1000],"interval":1,"interval_unit":"monthly","start_date":"2014-10-21"},"links":{"instalment_schedule":"example instalment_schedule 4666"},"metadata":{},"name":"Invoice 4404","payment_reference":"GOLDPLAN","retry_if_possible":true,"total_amount":1000},"links":{"bank_authorisation":"example bank_authorisation 4490","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","customer_billing_detail":"example customer_billing_detail 8798","instalment_schedule_request":"ISR123","instalment_schedule_request_instalment_schedule":"IS123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","organisation":"OR123","payment_provider":"PP123","payment_request":"PRQ123","payment_request_payment":"PM123","subscription_request":"SBR123","subscription_request_subscription":"SB123"},"mandate_request":{"authorisation_source":"paper","consent_type":"example consent_type 9401","constraints":{"end_date":"example end_date 9681","max_amount_per_payment":6848,"payment_method":"example payment_method 2356","periodic_limits":[{"alignment":"creation_date","max_payments":573,"max_total_amount":1099,"period":"flexible"}],"start_date":"example start_date 1051"},"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"mandate":"example mandate 3161"},"metadata":{},"payer_requested_dual_signature":true,"scheme":"bacs","sweeping":false,"verify":"always"},"metadata":{},"payment_request":{"amount":1000,"app_fee":100,"currency":"GBP","description":"Top-up Payment","funds_settlement":"managed","links":{"payment":"example payment 6118"},"metadata":{},"reference":"some-custom-ref","scheme":"faster_payments"},"purpose_code":"Epayment","resources":{"customer":{"company_name":"Hamilton Trading Ltd.","created_at":"2014-01-01T12:00:00.000Z","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999"},"customer_bank_account":{"account_holder_name":"Billie Jean","account_number_ending":"1234","account_type":"savings","bank_account_token":"bat_f975ab3c-ecee-47a1-9590-5bb1d56fa113","bank_name":"BARCLAYS BANK PLC","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","enabled":true,"id":"BA123","links":{"customer":"example customer 9841"},"metadata":{}},"customer_billing_detail":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","id":"CU123","ip_address":"127.0.0.1","postal_code":"NW1 6XE","region":"Greater London","schemes":["example schemes 1086"],"swedish_identity_number":"556564-5404"}},"status":"pending","subscription_request":{"amount":1000,"app_fee":100,"count":5,"currency":"USD","day_of_month":28,"interval":1,"interval_unit":"monthly","links":{"subscription":"example subscription 1092"},"metadata":{},"month":"january","name":"12 month subscription","payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21"}}],"creditors":[{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 5768","bank_reference_prefix":"ACME","can_create_refunds":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","creditor_type":"company","custom_payment_pages_enabled":true,"fx_payout_currency":"EUR","id":"CR123","links":{"default_aud_payout_account":"BA234","default_cad_payout_account":"BA792","default_dkk_payout_account":"BA790","default_eur_payout_account":"BA456","default_gbp_payout_account":"BA123","default_nzd_payout_account":"BA791","default_sek_payout_account":"BA789","default_usd_payout_account":"BA792"},"logo_url":"https://uploads.gocardless.com/logo.png","mandate_imports_enabled":true,"merchant_responsible_for_notifications":true,"name":"Acme","postal_code":"EC1V 7LQ","region":"example region 8825","scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 4196","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 1526","region":"Greater London","scheme":"bacs","status":"pending"}],"verification_status":"action_required"}],"customers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","danish_identity_number":"220550-6218","email":"user@example.com","family_name":"Osborne","given_name":"Frank","id":"CU123","language":"en","metadata":{},"phone_number":"+64 4 817 9999","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"}],"instalment_schedules":[{"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"IS123","links":{"customer":"CU123","mandate":"MD123","payments":["PM123","PM456"]},"metadata":{},"name":"Invoice 4404","payment_errors":{"0":[{"field":"charge_date","message":"must be on or after mandate's next_possible_customer_charge_date"}]},"status":"active","total_amount":1000}],"mandates":[{"authorisation_source":"paper","consent_parameters":{"end_date":"example end_date 7093","max_amount_per_payment":2243,"max_amount_per_period":4121,"max_payments_per_period":2713,"period":"week","start_date":"example start_date 3709"},"consent_type":"example consent_type 4870","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"direct","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}],"outbound_payments":[{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT123","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-QC2FI7GBEW7VCXL","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}],"payer_authorisations":[{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 3414","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 3882","message":"example message 1590","request_pointer":"example request_pointer 7417"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}],"payments":[{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":true,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":true,"scheme":"bacs","status":"submitted"}],"payouts":[{"amount":1000,"arrival_date":"2014-01-01","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","deducted_fees":20,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PO123","links":{"creditor":"CR123","creditor_bank_account":"BA123"},"metadata":{"salesforce_id":"ABCD1234"},"payout_type":"merchant","reference":"ref-1","status":"pending","tax_currency":"EUR"}],"refunds":[{"amount":150,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"RF123","links":{"mandate":"MD123","payment":"PM123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"}],"scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 8268","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 4476","region":"Greater London","scheme":"bacs","status":"pending"}],"subscriptions":[{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}]},"meta":{"cursors":{"after":"example after 7694","before":"example before 8098"},"limit":50}} }, "get": { "method": "GET", "path_template": "/events/:identity", "url_params": ["EV123"], - "body": {"events":{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","customer_notifications":[{"deadline":"2025-06-23T10:21:09.186Z","id":"PCN123","mandatory":true,"type":"example type 4769"}],"details":{"bank_account_id":"BA123","cause":"bank_account_disabled","currency":"GBP","description":"Customer's bank account closed","item_count":10,"not_retried_reason":"failure_filter_applied","origin":"bank","property":"fx_payout_currency","reason_code":"ADDACS-B","scheme":"bacs","will_attempt_retry":true},"id":"EV123","links":{"bank_authorisation":"BAU123","billing_request":"BRQ123","billing_request_flow":"BRF123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","instalment_schedule":"IS123","mandate":"MD123","mandate_request_mandate":"MD123","new_customer_bank_account":"BA123","new_mandate":"MD123","organisation":"OR123","parent_event":"EV123","payer_authorisation":"PAU123","payment":"PM123","payment_request_payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","scheme_identifier":"SU123","subscription":"SB123"},"metadata":{},"resource_metadata":{},"resource_type":"mandates"}} + "body": {"events":{"action":"cancelled","created_at":"2014-01-01T12:00:00.000Z","customer_notifications":[{"deadline":"2025-11-20T08:25:53.477Z","id":"PCN123","mandatory":false,"type":"example type 3794"}],"details":{"bank_account_id":"BA123","cause":"bank_account_disabled","currency":"GBP","description":"Customer's bank account closed","item_count":10,"not_retried_reason":"failure_filter_applied","origin":"bank","property":"fx_payout_currency","reason_code":"ADDACS-B","scheme":"bacs","will_attempt_retry":true},"id":"EV123","links":{"bank_authorisation":"BAU123","billing_request":"BRQ123","billing_request_flow":"BRF123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","instalment_schedule":"IS123","mandate":"MD123","mandate_request":"MRQ123","mandate_request_mandate":"MD123","new_customer_bank_account":"BA123","new_mandate":"MD123","organisation":"OR123","parent_event":"EV123","payer_authorisation":"PAU123","payment":"PM123","payment_request_payment":"PM123","payout":"PO123","previous_customer_bank_account":"BA123","refund":"RF123","scheme_identifier":"SU123","subscription":"SB123"},"metadata":{},"resource_metadata":{},"resource_type":"mandates","source":{"name":"Joe Bloggs","type":"access_token"}}} } } diff --git a/tests/fixtures/exports.json b/tests/fixtures/exports.json index 17de9a3c..6ab9d6a5 100644 --- a/tests/fixtures/exports.json +++ b/tests/fixtures/exports.json @@ -3,12 +3,12 @@ "method": "GET", "path_template": "/exports/:identity", "url_params": ["EX123"], - "body": {"exports":{"created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","download_url":"example download_url 7694","export_type":"payments_index","id":"EX123"}} + "body": {"exports":{"created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","download_url":"example download_url 5666","export_type":"payments_index","id":"EX123"}} }, "list": { "method": "GET", "path_template": "/exports", "url_params": [], - "body": {"exports":[{"created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","export_type":"payments_index","id":"EX123"},{"created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","export_type":"payments_index","id":"EX123"}],"meta":{"cursors":{"after":"example after 1590","before":"example before 8098"},"limit":50}} + "body": {"exports":[{"created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","export_type":"payments_index","id":"EX123"},{"created_at":"2014-01-01T12:00:00.000Z","currency":"GBP","export_type":"payments_index","id":"EX123"}],"meta":{"cursors":{"after":"example after 722","before":"example before 8601"},"limit":50}} } } diff --git a/tests/fixtures/instalment_schedules.json b/tests/fixtures/instalment_schedules.json index cb6b3774..58ceca2c 100644 --- a/tests/fixtures/instalment_schedules.json +++ b/tests/fixtures/instalment_schedules.json @@ -15,7 +15,7 @@ "method": "GET", "path_template": "/instalment_schedules", "url_params": [], - "body": {"instalment_schedules":[{"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"IS123","links":{"customer":"CU123","mandate":"MD123","payments":["PM123","PM456"]},"metadata":{},"name":"Invoice 4404","payment_errors":{"0":[{"field":"charge_date","message":"must be on or after mandate's next_possible_customer_charge_date"}]},"status":"active","total_amount":1000},{"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"IS123","links":{"customer":"CU123","mandate":"MD123","payments":["PM123","PM456"]},"metadata":{},"name":"Invoice 4404","payment_errors":{"0":[{"field":"charge_date","message":"must be on or after mandate's next_possible_customer_charge_date"}]},"status":"active","total_amount":1000}],"meta":{"cursors":{"after":"example after 3882","before":"example before 7417"},"limit":50}} + "body": {"instalment_schedules":[{"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"IS123","links":{"customer":"CU123","mandate":"MD123","payments":["PM123","PM456"]},"metadata":{},"name":"Invoice 4404","payment_errors":{"0":[{"field":"charge_date","message":"must be on or after mandate's next_possible_customer_charge_date"}]},"status":"active","total_amount":1000},{"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"IS123","links":{"customer":"CU123","mandate":"MD123","payments":["PM123","PM456"]},"metadata":{},"name":"Invoice 4404","payment_errors":{"0":[{"field":"charge_date","message":"must be on or after mandate's next_possible_customer_charge_date"}]},"status":"active","total_amount":1000}],"meta":{"cursors":{"after":"example after 3834","before":"example before 1060"},"limit":50}} }, "get": { "method": "GET", diff --git a/tests/fixtures/institutions.json b/tests/fixtures/institutions.json index 82f5511e..84bc41fe 100644 --- a/tests/fixtures/institutions.json +++ b/tests/fixtures/institutions.json @@ -3,12 +3,12 @@ "method": "GET", "path_template": "/institutions", "url_params": [], - "body": {"institutions":[{"autocompletes_collect_bank_account":true,"country_code":"GB","icon_url":"https://gocardless/assets/icons/monzo","id":"monzo","limits":{"daily":{},"single":{}},"logo_url":"https://gocardless/assets/logos/monzo","name":"VAT","status":"enabled"},{"autocompletes_collect_bank_account":true,"country_code":"GB","icon_url":"https://gocardless/assets/icons/monzo","id":"monzo","limits":{"daily":{},"single":{}},"logo_url":"https://gocardless/assets/logos/monzo","name":"VAT","status":"enabled"}],"meta":{"cursors":{"after":"example after 2370","before":"example before 3414"},"limit":50}} + "body": {"institutions":[{"autocompletes_collect_bank_account":true,"country_code":"GB","icon_url":"https://gocardless/assets/icons/monzo","id":"monzo","limits":{"daily":{},"single":{}},"logo_url":"https://gocardless/assets/logos/monzo","name":"VAT","status":"enabled"},{"autocompletes_collect_bank_account":true,"country_code":"GB","icon_url":"https://gocardless/assets/icons/monzo","id":"monzo","limits":{"daily":{},"single":{}},"logo_url":"https://gocardless/assets/logos/monzo","name":"VAT","status":"enabled"}],"meta":{"cursors":{"after":"example after 162","before":"example before 6013"},"limit":50}} }, "list_for_billing_request": { "method": "GET", "path_template": "/billing_requests/:identity/institutions", "url_params": ["BRQ123"], - "body": {"institutions":[{"autocompletes_collect_bank_account":true,"country_code":"GB","icon_url":"https://gocardless/assets/icons/monzo","id":"monzo","limits":{"daily":{},"single":{}},"logo_url":"https://gocardless/assets/logos/monzo","name":"VAT","status":"enabled"},{"autocompletes_collect_bank_account":true,"country_code":"GB","icon_url":"https://gocardless/assets/icons/monzo","id":"monzo","limits":{"daily":{},"single":{}},"logo_url":"https://gocardless/assets/logos/monzo","name":"VAT","status":"enabled"}],"meta":{"cursors":{"after":"example after 8268","before":"example before 7182"},"limit":50}} + "body": {"institutions":[{"autocompletes_collect_bank_account":true,"country_code":"GB","icon_url":"https://gocardless/assets/icons/monzo","id":"monzo","limits":{"daily":{},"single":{}},"logo_url":"https://gocardless/assets/logos/monzo","name":"VAT","status":"enabled"},{"autocompletes_collect_bank_account":true,"country_code":"GB","icon_url":"https://gocardless/assets/icons/monzo","id":"monzo","limits":{"daily":{},"single":{}},"logo_url":"https://gocardless/assets/logos/monzo","name":"VAT","status":"enabled"}],"meta":{"cursors":{"after":"example after 3817","before":"example before 6898"},"limit":50}} } } diff --git a/tests/fixtures/mandate_import_entries.json b/tests/fixtures/mandate_import_entries.json index 5d483ce2..8f59e0d1 100644 --- a/tests/fixtures/mandate_import_entries.json +++ b/tests/fixtures/mandate_import_entries.json @@ -9,6 +9,6 @@ "method": "GET", "path_template": "/mandate_import_entries", "url_params": [], - "body": {"mandate_import_entries":[{"created_at":"2014-01-01T12:00:00.000Z","links":{"customer":"CU123","customer_bank_account":"BA123","mandate":"MD123","mandate_import":"IM0000AAAAAAA"},"processing_errors":{},"record_identifier":"bank-file.xml/line-1"},{"created_at":"2014-01-01T12:00:00.000Z","links":{"customer":"CU123","customer_bank_account":"BA123","mandate":"MD123","mandate_import":"IM0000AAAAAAA"},"processing_errors":{},"record_identifier":"bank-file.xml/line-1"}],"meta":{"cursors":{"after":"example after 7601","before":"example before 3006"},"limit":50}} + "body": {"mandate_import_entries":[{"created_at":"2014-01-01T12:00:00.000Z","links":{"customer":"CU123","customer_bank_account":"BA123","mandate":"MD123","mandate_import":"IM0000AAAAAAA"},"processing_errors":{},"record_identifier":"bank-file.xml/line-1"},{"created_at":"2014-01-01T12:00:00.000Z","links":{"customer":"CU123","customer_bank_account":"BA123","mandate":"MD123","mandate_import":"IM0000AAAAAAA"},"processing_errors":{},"record_identifier":"bank-file.xml/line-1"}],"meta":{"cursors":{"after":"example after 7563","before":"example before 779"},"limit":50}} } } diff --git a/tests/fixtures/mandate_imports.json b/tests/fixtures/mandate_imports.json index a7d51b09..596840af 100644 --- a/tests/fixtures/mandate_imports.json +++ b/tests/fixtures/mandate_imports.json @@ -3,24 +3,24 @@ "method": "POST", "path_template": "/mandate_imports", "url_params": [], - "body": {"mandate_imports":{"created_at":"2014-01-01T12:00:00.000Z","id":"IM000010790WX1","links":{"creditor":"CR123"},"scheme":"bacs","status":"created"}} + "body": {"mandate_imports":{"created_at":"2014-01-01T12:00:00.000Z","id":"IM123","links":{"creditor":"CR123"},"scheme":"bacs","status":"created"}} }, "get": { "method": "GET", "path_template": "/mandate_imports/:identity", - "url_params": ["IM000010790WX1"], - "body": {"mandate_imports":{"created_at":"2014-01-01T12:00:00.000Z","id":"IM000010790WX1","links":{"creditor":"CR123"},"scheme":"bacs","status":"created"}} + "url_params": ["IM123"], + "body": {"mandate_imports":{"created_at":"2014-01-01T12:00:00.000Z","id":"IM123","links":{"creditor":"CR123"},"scheme":"bacs","status":"created"}} }, "submit": { "method": "POST", "path_template": "/mandate_imports/:identity/actions/submit", - "url_params": ["IM000010790WX1"], - "body": {"mandate_imports":{"created_at":"2014-01-01T12:00:00.000Z","id":"IM000010790WX1","links":{"creditor":"CR123"},"scheme":"bacs","status":"created"}} + "url_params": ["IM123"], + "body": {"mandate_imports":{"created_at":"2014-01-01T12:00:00.000Z","id":"IM123","links":{"creditor":"CR123"},"scheme":"bacs","status":"created"}} }, "cancel": { "method": "POST", "path_template": "/mandate_imports/:identity/actions/cancel", - "url_params": ["IM000010790WX1"], - "body": {"mandate_imports":{"created_at":"2014-01-01T12:00:00.000Z","id":"IM000010790WX1","links":{"creditor":"CR123"},"scheme":"bacs","status":"created"}} + "url_params": ["IM123"], + "body": {"mandate_imports":{"created_at":"2014-01-01T12:00:00.000Z","id":"IM123","links":{"creditor":"CR123"},"scheme":"bacs","status":"created"}} } } diff --git a/tests/fixtures/mandates.json b/tests/fixtures/mandates.json index 7521ec2c..d39a6498 100644 --- a/tests/fixtures/mandates.json +++ b/tests/fixtures/mandates.json @@ -3,36 +3,36 @@ "method": "POST", "path_template": "/mandates", "url_params": [], - "body": {"mandates":{"authorisation_source":"telephone","consent_parameters":{"end_date":"example end_date 2762","max_amount_per_payment":4476,"periods":[{"max_amount_per_period":1526,"max_payments_per_period":4196,"period":"day"}],"start_date":"example start_date 5768"},"consent_type":"example consent_type 4121","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"direct","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} + "body": {"mandates":{"authorisation_source":"web","consent_parameters":{"end_date":"example end_date 6053","max_amount_per_payment":6218,"max_amount_per_period":3006,"max_payments_per_period":2188,"period":"week","start_date":"example start_date 6840"},"consent_type":"example consent_type 3571","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"direct","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} }, "list": { "method": "GET", "path_template": "/mandates", "url_params": [], - "body": {"mandates":[{"authorisation_source":"web","consent_parameters":{"end_date":"example end_date 4490","max_amount_per_payment":7093,"periods":[{"max_amount_per_period":8937,"max_payments_per_period":1086,"period":"day"}],"start_date":"example start_date 9841"},"consent_type":"example consent_type 8798","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"direct","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"},{"authorisation_source":"paper","consent_parameters":{"end_date":"example end_date 718","max_amount_per_payment":5392,"periods":[{"max_amount_per_period":5815,"max_payments_per_period":9681,"period":"day"}],"start_date":"example start_date 6848"},"consent_type":"example consent_type 9401","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"direct","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 5617","before":"example before 2356"},"limit":50}} + "body": {"mandates":[{"authorisation_source":"web","consent_parameters":{"end_date":"example end_date 2945","max_amount_per_payment":9407,"max_amount_per_period":7150,"max_payments_per_period":4907,"period":"flexible","start_date":"example start_date 7222"},"consent_type":"example consent_type 7630","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"direct","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"},{"authorisation_source":"paper","consent_parameters":{"end_date":"example end_date 562","max_amount_per_payment":4752,"max_amount_per_period":8114,"max_payments_per_period":3207,"period":"day","start_date":"example start_date 6904"},"consent_type":"example consent_type 5453","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"direct","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}],"meta":{"cursors":{"after":"example after 242","before":"example before 817"},"limit":50}} }, "get": { "method": "GET", "path_template": "/mandates/:identity", "url_params": ["MD123"], - "body": {"mandates":{"authorisation_source":"web","consent_parameters":{"end_date":"example end_date 4214","max_amount_per_payment":1051,"periods":[{"max_amount_per_period":8460,"max_payments_per_period":1092,"period":"week"}],"start_date":"example start_date 6524"},"consent_type":"example consent_type 1099","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"managed","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} + "body": {"mandates":{"authorisation_source":"telephone","consent_parameters":{"end_date":"example end_date 6138","max_amount_per_payment":8399,"max_amount_per_period":3045,"max_payments_per_period":9227,"period":"day","start_date":"example start_date 5299"},"consent_type":"example consent_type 4195","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"managed","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} }, "update": { "method": "PUT", "path_template": "/mandates/:identity", "url_params": ["MD123"], - "body": {"mandates":{"authorisation_source":"web","consent_parameters":{"end_date":"example end_date 3040","max_amount_per_payment":5652,"periods":[{"max_amount_per_period":2748,"max_payments_per_period":5063,"period":"day"}],"start_date":"example start_date 9350"},"consent_type":"example consent_type 4666","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"managed","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} + "body": {"mandates":{"authorisation_source":"telephone","consent_parameters":{"end_date":"example end_date 593","max_amount_per_payment":1775,"max_amount_per_period":5340,"max_payments_per_period":860,"period":"year","start_date":"example start_date 3539"},"consent_type":"example consent_type 2551","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"managed","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} }, "cancel": { "method": "POST", "path_template": "/mandates/:identity/actions/cancel", "url_params": ["MD123"], - "body": {"mandates":{"authorisation_source":"web","consent_parameters":{"end_date":"example end_date 8351","max_amount_per_payment":5666,"periods":[{"max_amount_per_period":760,"max_payments_per_period":3794,"period":"flexible"}],"start_date":"example start_date 7510"},"consent_type":"example consent_type 722","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"managed","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} + "body": {"mandates":{"authorisation_source":"paper","consent_parameters":{"end_date":"example end_date 7185","max_amount_per_payment":5511,"max_amount_per_period":1106,"max_payments_per_period":3179,"period":"year","start_date":"example start_date 4615"},"consent_type":"example consent_type 1281","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"managed","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} }, "reinstate": { "method": "POST", "path_template": "/mandates/:identity/actions/reinstate", "url_params": ["MD123"], - "body": {"mandates":{"authorisation_source":"telephone","consent_parameters":{"end_date":"example end_date 6898","max_amount_per_payment":3817,"periods":[{"max_amount_per_period":6840,"max_payments_per_period":6053,"period":"year"}],"start_date":"example start_date 162"},"consent_type":"example consent_type 3834","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"direct","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} + "body": {"mandates":{"authorisation_source":"web","consent_parameters":{"end_date":"example end_date 7483","max_amount_per_payment":6128,"max_amount_per_period":3360,"max_payments_per_period":5836,"period":"week","start_date":"example start_date 3906"},"consent_type":"example consent_type 8612","created_at":"2014-01-01T12:00:00.000Z","funds_settlement":"direct","id":"MD123","links":{"creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","new_mandate":"MD123"},"metadata":{},"next_possible_charge_date":"2014-10-27","next_possible_standard_ach_charge_date":"2014-10-27","payments_require_approval":false,"reference":"REF-123","scheme":"bacs","status":"pending_submission","verified_at":"2021-01-01T12:00:00.000Z"}} } } diff --git a/tests/fixtures/negative_balance_limits.json b/tests/fixtures/negative_balance_limits.json index 0e521625..4830fb6e 100644 --- a/tests/fixtures/negative_balance_limits.json +++ b/tests/fixtures/negative_balance_limits.json @@ -3,6 +3,6 @@ "method": "GET", "path_template": "/negative_balance_limits", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 2188","before":"example before 3571"},"limit":50},"negative_balance_limits":[{"balance_limit":10000,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"NBL123","links":{"creator_user":"US123","creditor":"CR123"}},{"balance_limit":10000,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"NBL123","links":{"creator_user":"US123","creditor":"CR123"}}]} + "body": {"meta":{"cursors":{"after":"example after 3787","before":"example before 8143"},"limit":50},"negative_balance_limits":[{"balance_limit":10000,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"NBL123","links":{"creator_user":"US123","creditor":"CR123"}},{"balance_limit":10000,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","id":"NBL123","links":{"creator_user":"US123","creditor":"CR123"}}]} } } diff --git a/tests/fixtures/outbound_payments.json b/tests/fixtures/outbound_payments.json index 7ddfd3ec..b6d133a2 100644 --- a/tests/fixtures/outbound_payments.json +++ b/tests/fixtures/outbound_payments.json @@ -3,42 +3,42 @@ "method": "POST", "path_template": "/outbound_payments", "url_params": [], - "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT01JR7P5PKW3K7Q34CJAWC03E82","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-058408d9","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} + "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT123","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-QC2FI7GBEW7VCXL","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} }, "withdraw": { "method": "POST", "path_template": "/outbound_payments/withdrawal", "url_params": [], - "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT01JR7P5PKW3K7Q34CJAWC03E82","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-058408d9","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} + "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT123","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-QC2FI7GBEW7VCXL","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} }, "cancel": { "method": "POST", "path_template": "/outbound_payments/:identity/actions/cancel", - "url_params": ["OUT01JR7P5PKW3K7Q34CJAWC03E82"], - "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT01JR7P5PKW3K7Q34CJAWC03E82","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-058408d9","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} + "url_params": ["OUT123"], + "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT123","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-QC2FI7GBEW7VCXL","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} }, "approve": { "method": "POST", "path_template": "/outbound_payments/:identity/actions/approve", - "url_params": ["OUT01JR7P5PKW3K7Q34CJAWC03E82"], - "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT01JR7P5PKW3K7Q34CJAWC03E82","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-058408d9","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} + "url_params": ["OUT123"], + "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT123","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-QC2FI7GBEW7VCXL","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} }, "get": { "method": "GET", "path_template": "/outbound_payments/:identity", - "url_params": ["OUT01JR7P5PKW3K7Q34CJAWC03E82"], - "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT01JR7P5PKW3K7Q34CJAWC03E82","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-058408d9","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} + "url_params": ["OUT123"], + "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT123","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-QC2FI7GBEW7VCXL","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} }, "list": { "method": "GET", "path_template": "/outbound_payments", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 242","before":"example before 3577"},"limit":50},"outbound_payments":[{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT01JR7P5PKW3K7Q34CJAWC03E82","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-058408d9","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}},{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT01JR7P5PKW3K7Q34CJAWC03E82","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-058408d9","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}]} + "body": {"meta":{"cursors":{"after":"example after 6532","before":"example before 1523"},"limit":50},"outbound_payments":[{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT123","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-QC2FI7GBEW7VCXL","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}},{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT123","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-QC2FI7GBEW7VCXL","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}]} }, "update": { "method": "PUT", "path_template": "/outbound_payments/:identity", - "url_params": ["OUT01JR7P5PKW3K7Q34CJAWC03E82"], - "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT01JR7P5PKW3K7Q34CJAWC03E82","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-058408d9","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} + "url_params": ["OUT123"], + "body": {"outbound_payments":{"amount":1000,"created_at":"2024-01-01T12:00:00.000Z","currency":"GBP","description":"Reward Payment (August 2024)","execution_date":"2024-08-31","id":"OUT123","is_withdrawal":true,"links":{"creditor":"CR123","customer":"CU123","recipient_bank_account":"BA123"},"metadata":{},"reference":"GC-QC2FI7GBEW7VCXL","scheme":"faster_payments","status":"cancelled","verifications":{"recipient_bank_account_holder_verification":{"actual_account_name":"Jo Doe","result":"partial_match","type":"confirmation_of_payee"}}}} } } diff --git a/tests/fixtures/payer_authorisations.json b/tests/fixtures/payer_authorisations.json index 4a2e2b1e..2591673d 100644 --- a/tests/fixtures/payer_authorisations.json +++ b/tests/fixtures/payer_authorisations.json @@ -3,30 +3,30 @@ "method": "GET", "path_template": "/payer_authorisations/:identity", "url_params": ["PA123"], - "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 7150","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 817","message":"example message 9407","request_pointer":"example request_pointer 8284"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} + "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 277","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 9723","message":"example message 2825","request_pointer":"example request_pointer 1190"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} }, "create": { "method": "POST", "path_template": "/payer_authorisations", "url_params": [], - "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 4907","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 2945","message":"example message 2835","request_pointer":"example request_pointer 7222"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} + "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 4801","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 6501","message":"example message 3847","request_pointer":"example request_pointer 7808"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} }, "update": { "method": "PUT", "path_template": "/payer_authorisations/:identity", "url_params": ["PA123"], - "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 7248","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 7630","message":"example message 6904","request_pointer":"example request_pointer 562"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} + "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 1096","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 7407","message":"example message 4659","request_pointer":"example request_pointer 2414"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} }, "submit": { "method": "POST", "path_template": "/payer_authorisations/:identity/actions/submit", "url_params": ["PA123"], - "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 3207","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 4752","message":"example message 6775","request_pointer":"example request_pointer 8114"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} + "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 6152","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 1364","message":"example message 6588","request_pointer":"example request_pointer 3237"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} }, "confirm": { "method": "POST", "path_template": "/payer_authorisations/:identity/actions/confirm", "url_params": ["PA123"], - "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 3201","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 5453","message":"example message 8701","request_pointer":"example request_pointer 7173"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} + "body": {"payer_authorisations":{"bank_account":{"account_holder_name":"Billie Jean","account_number":"55779911","account_number_ending":"1234","account_number_suffix":"00","account_type":"savings","bank_code":"example bank_code 2395","branch_code":"20-00-00","country_code":"GB","currency":"EUR","iban":"GB60BARC20000055779911","metadata":{}},"created_at":"2020-01-01T12:00:00.000Z","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":"user@example.com","family_name":"Osborne","given_name":"Frank","locale":"en-GB","metadata":{},"postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"id":"PA123","incomplete_fields":[{"field":"example field 1192","message":"example message 5138","request_pointer":"example request_pointer 1800"}],"links":{"bank_account":"BA123","customer":"CU123","mandate":"MD123"},"mandate":{"metadata":{},"payer_ip_address":"127.0.0.1","reference":"REF-123","scheme":"bacs"},"status":"created"}} } } diff --git a/tests/fixtures/payment_account_transactions.json b/tests/fixtures/payment_account_transactions.json new file mode 100644 index 00000000..b0f7a8ea --- /dev/null +++ b/tests/fixtures/payment_account_transactions.json @@ -0,0 +1,8 @@ +{ + "list": { + "method": "GET", + "path_template": "/payment_accounts/:identity/transactions", + "url_params": ["BA123"], + "body": {"meta":{"cursors":{"after":"example after 3527","before":"example before 7636"},"limit":50},"payment_account_transactions":[{"amount":1000,"balance_after_transaction":1000,"counterparty_name":"Acme Ltd","currency":"example currency 2641","description":"Reward Payment (August 2024)","direction":"credit","id":"PATR1234","links":{"outbound_payment":"OUT123","payment_bank_account":"BA123","payout":"PO123"},"reference":"GC-058408d9","value_date":"2014-01-01"},{"amount":1000,"balance_after_transaction":1000,"counterparty_name":"Acme Ltd","currency":"example currency 8314","description":"Reward Payment (August 2024)","direction":"credit","id":"PATR1234","links":{"outbound_payment":"OUT123","payment_bank_account":"BA123","payout":"PO123"},"reference":"GC-058408d9","value_date":"2014-01-01"}]} + } +} diff --git a/tests/fixtures/payments.json b/tests/fixtures/payments.json index 97c7465c..3ebd1b38 100644 --- a/tests/fixtures/payments.json +++ b/tests/fixtures/payments.json @@ -3,36 +3,36 @@ "method": "POST", "path_template": "/payments", "url_params": [], - "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":false,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":true,"status":"submitted"}} + "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":true,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":false,"scheme":"bacs","status":"submitted"}} }, "list": { "method": "GET", "path_template": "/payments", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 4615","before":"example before 8399"},"limit":50},"payments":[{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":false,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":false,"status":"submitted"},{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":false,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":false,"status":"submitted"}]} + "body": {"meta":{"cursors":{"after":"example after 7352","before":"example before 8454"},"limit":50},"payments":[{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":true,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":true,"scheme":"bacs","status":"submitted"},{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":true,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":false,"scheme":"bacs","status":"submitted"}]} }, "get": { "method": "GET", "path_template": "/payments/:identity", "url_params": ["PM123"], - "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":true,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":false,"status":"submitted"}} + "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":true,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":true,"scheme":"bacs","status":"submitted"}} }, "update": { "method": "PUT", "path_template": "/payments/:identity", "url_params": ["PM123"], - "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":true,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":false,"status":"submitted"}} + "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":false,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":true,"scheme":"bacs","status":"submitted"}} }, "cancel": { "method": "POST", "path_template": "/payments/:identity/actions/cancel", "url_params": ["PM123"], - "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":true,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":false,"status":"submitted"}} + "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":false,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":true,"scheme":"bacs","status":"submitted"}} }, "retry": { "method": "POST", "path_template": "/payments/:identity/actions/retry", "url_params": ["PM123"], - "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":false,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":true,"status":"submitted"}} + "body": {"payments":{"amount":1000,"amount_refunded":150,"charge_date":"2014-05-21","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","description":"One-off upgrade fee","faster_ach":true,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PM123","links":{"creditor":"CR123","instalment_schedule":"IS123","mandate":"MD123","payout":"PO123","subscription":"SU123"},"metadata":{},"reference":"WINEBOX001","retry_if_possible":true,"scheme":"bacs","status":"submitted"}} } } diff --git a/tests/fixtures/payout_items.json b/tests/fixtures/payout_items.json index 74522d82..d698dd3d 100644 --- a/tests/fixtures/payout_items.json +++ b/tests/fixtures/payout_items.json @@ -3,6 +3,6 @@ "method": "GET", "path_template": "/payout_items", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 3179","before":"example before 1106"},"limit":50},"payout_items":[{"amount":"45.0","links":{"mandate":"MD123","payment":"PM123","refund":"RF123"},"taxes":[{"amount":"1.1","currency":"EUR","destination_amount":"1.1","destination_currency":"EUR","exchange_rate":"1.11205","tax_rate_id":"GB_VAT_1"}],"type":"payment_paid_out"},{"amount":"45.0","links":{"mandate":"MD123","payment":"PM123","refund":"RF123"},"taxes":[{"amount":"1.1","currency":"EUR","destination_amount":"1.1","destination_currency":"EUR","exchange_rate":"1.11205","tax_rate_id":"GB_VAT_1"}],"type":"payment_paid_out"}]} + "body": {"meta":{"cursors":{"after":"example after 3237","before":"example before 7044"},"limit":50},"payout_items":[{"amount":"45.0","links":{"mandate":"MD123","payment":"PM123","refund":"RF123"},"taxes":[{"amount":"1.1","currency":"EUR","destination_amount":"1.1","destination_currency":"EUR","exchange_rate":"1.11205","tax_rate_id":"GB_VAT_1"}],"type":"payment_paid_out"},{"amount":"45.0","links":{"mandate":"MD123","payment":"PM123","refund":"RF123"},"taxes":[{"amount":"1.1","currency":"EUR","destination_amount":"1.1","destination_currency":"EUR","exchange_rate":"1.11205","tax_rate_id":"GB_VAT_1"}],"type":"payment_paid_out"}]} } } diff --git a/tests/fixtures/payouts.json b/tests/fixtures/payouts.json index e65d935a..a5804772 100644 --- a/tests/fixtures/payouts.json +++ b/tests/fixtures/payouts.json @@ -3,7 +3,7 @@ "method": "GET", "path_template": "/payouts", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 1281","before":"example before 1778"},"limit":50},"payouts":[{"amount":1000,"arrival_date":"2014-01-01","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","deducted_fees":20,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PO123","links":{"creditor":"CR123","creditor_bank_account":"BA123"},"metadata":{"salesforce_id":"ABCD1234"},"payout_type":"merchant","reference":"ref-1","status":"pending","tax_currency":"EUR"},{"amount":1000,"arrival_date":"2014-01-01","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","deducted_fees":20,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PO123","links":{"creditor":"CR123","creditor_bank_account":"BA123"},"metadata":{"salesforce_id":"ABCD1234"},"payout_type":"merchant","reference":"ref-1","status":"pending","tax_currency":"EUR"}]} + "body": {"meta":{"cursors":{"after":"example after 8784","before":"example before 9338"},"limit":50},"payouts":[{"amount":1000,"arrival_date":"2014-01-01","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","deducted_fees":20,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PO123","links":{"creditor":"CR123","creditor_bank_account":"BA123"},"metadata":{"salesforce_id":"ABCD1234"},"payout_type":"merchant","reference":"ref-1","status":"pending","tax_currency":"EUR"},{"amount":1000,"arrival_date":"2014-01-01","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","deducted_fees":20,"fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"PO123","links":{"creditor":"CR123","creditor_bank_account":"BA123"},"metadata":{"salesforce_id":"ABCD1234"},"payout_type":"merchant","reference":"ref-1","status":"pending","tax_currency":"EUR"}]} }, "get": { "method": "GET", diff --git a/tests/fixtures/redirect_flows.json b/tests/fixtures/redirect_flows.json index e70f0a51..7e32e8de 100644 --- a/tests/fixtures/redirect_flows.json +++ b/tests/fixtures/redirect_flows.json @@ -3,18 +3,18 @@ "method": "POST", "path_template": "/redirect_flows", "url_params": [], - "body": {"redirect_flows":{"confirmation_url":"https://pay.gocardless.com/flow/RE123/success","created_at":"2014-01-01T12:00:00.000Z","description":"Standard subscription","id":"RE123456","links":{"billing_request":"BR123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","mandate":"MD123"},"mandate_reference":"example mandate_reference 4615","metadata":{"salesforce_id":"ABCD1234"},"redirect_url":"http://pay.gocardless.com/flow/RE123","scheme":"bacs","session_token":"SESS_wSs0uGYMISxzqOBq","success_redirect_url":"https://example.com/pay/confirm"}} + "body": {"redirect_flows":{"confirmation_url":"https://pay.gocardless.com/flow/RE123/success","created_at":"2014-01-01T12:00:00.000Z","description":"Standard subscription","id":"RE123456","links":{"billing_request":"BR123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","mandate":"MD123"},"mandate_reference":"example mandate_reference 998","metadata":{"salesforce_id":"ABCD1234"},"redirect_url":"http://pay.gocardless.com/flow/RE123","scheme":"bacs","session_token":"SESS_wSs0uGYMISxzqOBq","success_redirect_url":"https://example.com/pay/confirm"}} }, "get": { "method": "GET", "path_template": "/redirect_flows/:identity", "url_params": ["RE123456"], - "body": {"redirect_flows":{"confirmation_url":"https://pay.gocardless.com/flow/RE123/success","created_at":"2014-01-01T12:00:00.000Z","description":"Standard subscription","id":"RE123456","links":{"billing_request":"BR123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","mandate":"MD123"},"mandate_reference":"example mandate_reference 7185","metadata":{"salesforce_id":"ABCD1234"},"redirect_url":"http://pay.gocardless.com/flow/RE123","scheme":"bacs","session_token":"SESS_wSs0uGYMISxzqOBq","success_redirect_url":"https://example.com/pay/confirm"}} + "body": {"redirect_flows":{"confirmation_url":"https://pay.gocardless.com/flow/RE123/success","created_at":"2014-01-01T12:00:00.000Z","description":"Standard subscription","id":"RE123456","links":{"billing_request":"BR123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","mandate":"MD123"},"mandate_reference":"example mandate_reference 2523","metadata":{"salesforce_id":"ABCD1234"},"redirect_url":"http://pay.gocardless.com/flow/RE123","scheme":"bacs","session_token":"SESS_wSs0uGYMISxzqOBq","success_redirect_url":"https://example.com/pay/confirm"}} }, "complete": { "method": "POST", "path_template": "/redirect_flows/:identity/actions/complete", "url_params": ["RE123456"], - "body": {"redirect_flows":{"confirmation_url":"https://pay.gocardless.com/flow/RE123/success","created_at":"2014-01-01T12:00:00.000Z","description":"Standard subscription","id":"RE123456","links":{"billing_request":"BR123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","mandate":"MD123"},"mandate_reference":"example mandate_reference 5511","metadata":{"salesforce_id":"ABCD1234"},"redirect_url":"http://pay.gocardless.com/flow/RE123","scheme":"bacs","session_token":"SESS_wSs0uGYMISxzqOBq","success_redirect_url":"https://example.com/pay/confirm"}} + "body": {"redirect_flows":{"confirmation_url":"https://pay.gocardless.com/flow/RE123/success","created_at":"2014-01-01T12:00:00.000Z","description":"Standard subscription","id":"RE123456","links":{"billing_request":"BR123","creditor":"CR123","customer":"CU123","customer_bank_account":"BA123","mandate":"MD123"},"mandate_reference":"example mandate_reference 5394","metadata":{"salesforce_id":"ABCD1234"},"redirect_url":"http://pay.gocardless.com/flow/RE123","scheme":"bacs","session_token":"SESS_wSs0uGYMISxzqOBq","success_redirect_url":"https://example.com/pay/confirm"}} } } diff --git a/tests/fixtures/refunds.json b/tests/fixtures/refunds.json index 144b0a13..2184b89d 100644 --- a/tests/fixtures/refunds.json +++ b/tests/fixtures/refunds.json @@ -9,7 +9,7 @@ "method": "GET", "path_template": "/refunds", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 1648","before":"example before 8314"},"limit":50},"refunds":[{"amount":150,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"RF123","links":{"mandate":"MD123","payment":"PM123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"},{"amount":150,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"RF123","links":{"mandate":"MD123","payment":"PM123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"}]} + "body": {"meta":{"cursors":{"after":"example after 6362","before":"example before 9995"},"limit":50},"refunds":[{"amount":150,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"RF123","links":{"mandate":"MD123","payment":"PM123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"},{"amount":150,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","fx":{"estimated_exchange_rate":"1.1234567890","exchange_rate":"1.1234567890","fx_amount":1150,"fx_currency":"EUR"},"id":"RF123","links":{"mandate":"MD123","payment":"PM123"},"metadata":{},"reference":"WINEBOX001","status":"submitted"}]} }, "get": { "method": "GET", diff --git a/tests/fixtures/scheme_identifiers.json b/tests/fixtures/scheme_identifiers.json index 007e7f03..7fd5b4b2 100644 --- a/tests/fixtures/scheme_identifiers.json +++ b/tests/fixtures/scheme_identifiers.json @@ -3,18 +3,18 @@ "method": "POST", "path_template": "/scheme_identifiers", "url_params": [], - "body": {"scheme_identifiers":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 6836","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 5093","region":"Greater London","scheme":"bacs","status":"pending"}} + "body": {"scheme_identifiers":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 7635","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 2079","region":"Greater London","scheme":"bacs","status":"pending"}} }, "list": { "method": "GET", "path_template": "/scheme_identifiers", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 3360","before":"example before 6955"},"limit":50},"scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 5836","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 3906","region":"Greater London","scheme":"bacs","status":"pending"},{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 6128","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 7483","region":"Greater London","scheme":"bacs","status":"pending"}]} + "body": {"meta":{"cursors":{"after":"example after 1878","before":"example before 856"},"limit":50},"scheme_identifiers":[{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 7107","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 1428","region":"Greater London","scheme":"bacs","status":"pending"},{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 3495","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 6082","region":"Greater London","scheme":"bacs","status":"pending"}]} }, "get": { "method": "GET", "path_template": "/scheme_identifiers/:identity", "url_params": ["SU123"], - "body": {"scheme_identifiers":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 7201","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 8612","region":"Greater London","scheme":"bacs","status":"pending"}} + "body": {"scheme_identifiers":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","can_specify_mandate_reference":false,"city":"London","country_code":"GB","created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","email":"user@example.com","id":"SU123","minimum_advance_notice":3,"name":"example name 72","phone_number":"+44 20 1234 1234","postal_code":"NW1 6XE","reference":"example reference 989","region":"Greater London","scheme":"bacs","status":"pending"}} } } diff --git a/tests/fixtures/subscriptions.json b/tests/fixtures/subscriptions.json index 974b688f..3f70daaa 100644 --- a/tests/fixtures/subscriptions.json +++ b/tests/fixtures/subscriptions.json @@ -3,42 +3,42 @@ "method": "POST", "path_template": "/subscriptions", "url_params": [], - "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} + "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} }, "list": { "method": "GET", "path_template": "/subscriptions", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 3787","before":"example before 8143"},"limit":50},"subscriptions":[{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":true,"payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]},{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}]} + "body": {"meta":{"cursors":{"after":"example after 8804","before":"example before 503"},"limit":50},"subscriptions":[{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":true,"payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]},{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}]} }, "get": { "method": "GET", "path_template": "/subscriptions/:identity", "url_params": ["SB123"], - "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":true,"payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} + "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} }, "update": { "method": "PUT", "path_template": "/subscriptions/:identity", "url_params": ["SB123"], - "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} + "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":true,"payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} }, "pause": { "method": "POST", "path_template": "/subscriptions/:identity/actions/pause", "url_params": ["SB123"], - "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":true,"payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} + "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} }, "resume": { "method": "POST", "path_template": "/subscriptions/:identity/actions/resume", "url_params": ["SB123"], - "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} + "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":true,"payment_reference":"GOLDPLAN","retry_if_possible":true,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} }, "cancel": { "method": "POST", "path_template": "/subscriptions/:identity/actions/cancel", "url_params": ["SB123"], - "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":false,"payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} + "body": {"subscriptions":{"amount":1000,"app_fee":100,"count":5,"created_at":"2014-01-01T12:00:00.000Z","currency":"EUR","day_of_month":28,"earliest_charge_date_after_resume":"2014-11-03","end_date":"2015-10-21","id":"SB123","interval":1,"interval_unit":"monthly","links":{"mandate":"MD123"},"metadata":{},"month":"january","name":"12 month subscription","parent_plan_paused":true,"payment_reference":"GOLDPLAN","retry_if_possible":false,"start_date":"2014-10-21","status":"active","upcoming_payments":[{"amount":2500,"charge_date":"2014-11-03"}]}} } } diff --git a/tests/fixtures/tax_rates.json b/tests/fixtures/tax_rates.json index 689a7177..be959451 100644 --- a/tests/fixtures/tax_rates.json +++ b/tests/fixtures/tax_rates.json @@ -3,7 +3,7 @@ "method": "GET", "path_template": "/tax_rates", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 6152","before":"example before 1364"},"limit":50},"tax_rates":[{"end_date":"2014-01-01","id":"GB_VAT_1","jurisdiction":"GBP","percentage":"20.0","start_date":"2014-01-01","type":"VAT"},{"end_date":"2014-01-01","id":"GB_VAT_1","jurisdiction":"GBP","percentage":"20.0","start_date":"2014-01-01","type":"VAT"}]} + "body": {"meta":{"cursors":{"after":"example after 3380","before":"example before 7251"},"limit":50},"tax_rates":[{"end_date":"2014-01-01","id":"GB_VAT_1","jurisdiction":"GBP","percentage":"20.0","start_date":"2014-01-01","type":"VAT"},{"end_date":"2014-01-01","id":"GB_VAT_1","jurisdiction":"GBP","percentage":"20.0","start_date":"2014-01-01","type":"VAT"}]} }, "get": { "method": "GET", diff --git a/tests/fixtures/transferred_mandates.json b/tests/fixtures/transferred_mandates.json index 49d0c149..80b2a53b 100644 --- a/tests/fixtures/transferred_mandates.json +++ b/tests/fixtures/transferred_mandates.json @@ -3,6 +3,6 @@ "method": "GET", "path_template": "/transferred_mandates/:identity", "url_params": ["MD123"], - "body": {"transferred_mandates":{"encrypted_customer_bank_details":"example encrypted_customer_bank_details 1800","encrypted_decryption_key":"example encrypted_decryption_key 6588","links":{"customer_bank_account":"BA123","mandate":"MD123"},"public_key_id":"example public_key_id 3237"}} + "body": {"transferred_mandates":{"encrypted_customer_bank_details":"example encrypted_customer_bank_details 9962","encrypted_decryption_key":"example encrypted_decryption_key 4832","links":{"customer_bank_account":"BA123","mandate":"MD123"},"public_key_id":"example public_key_id 3332"}} } } diff --git a/tests/fixtures/verification_details.json b/tests/fixtures/verification_details.json index d589726a..f52aa2f6 100644 --- a/tests/fixtures/verification_details.json +++ b/tests/fixtures/verification_details.json @@ -3,12 +3,12 @@ "method": "POST", "path_template": "/verification_details", "url_params": [], - "body": {"verification_details":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 1192","city":"London","company_number":"07495895","description":"Wine and cheese seller","directors":[{"city":"London","country_code":"GB","date_of_birth":"1986-02-19","family_name":"Jones","given_name":"Tom","postal_code":"EC1V 7LQ","street":"example street 5138"}],"links":{"creditor":"CR123"},"name":"Acme Limited","postal_code":"EC1V 7LQ"}} + "body": {"verification_details":{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 6458","city":"London","company_number":"07495895","description":"Wine and cheese seller","directors":[{"city":"London","country_code":"GB","date_of_birth":"1986-02-19","family_name":"Jones","given_name":"Tom","postal_code":"EC1V 7LQ","street":"example street 8464"}],"links":{"creditor":"CR123"},"name":"Acme Limited","postal_code":"EC1V 7LQ"}} }, "list": { "method": "GET", "path_template": "/verification_details", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 9727","before":"example before 1608"},"limit":50},"verification_details":[{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 2395","city":"London","company_number":"07495895","description":"Wine and cheese seller","directors":[{"city":"London","country_code":"GB","date_of_birth":"1986-02-19","family_name":"Jones","given_name":"Tom","postal_code":"EC1V 7LQ","street":"example street 5197"}],"links":{"creditor":"CR123"},"name":"Acme Limited","postal_code":"EC1V 7LQ"},{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 3078","city":"London","company_number":"07495895","description":"Wine and cheese seller","directors":[{"city":"London","country_code":"GB","date_of_birth":"1986-02-19","family_name":"Jones","given_name":"Tom","postal_code":"EC1V 7LQ","street":"example street 144"}],"links":{"creditor":"CR123"},"name":"Acme Limited","postal_code":"EC1V 7LQ"}]} + "body": {"meta":{"cursors":{"after":"example after 3416","before":"example before 7356"},"limit":50},"verification_details":[{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 9438","city":"London","company_number":"07495895","description":"Wine and cheese seller","directors":[{"city":"London","country_code":"GB","date_of_birth":"1986-02-19","family_name":"Jones","given_name":"Tom","postal_code":"EC1V 7LQ","street":"example street 9249"}],"links":{"creditor":"CR123"},"name":"Acme Limited","postal_code":"EC1V 7LQ"},{"address_line1":"338-346 Goswell Road","address_line2":"Islington","address_line3":"example address_line3 8788","city":"London","company_number":"07495895","description":"Wine and cheese seller","directors":[{"city":"London","country_code":"GB","date_of_birth":"1986-02-19","family_name":"Jones","given_name":"Tom","postal_code":"EC1V 7LQ","street":"example street 5809"}],"links":{"creditor":"CR123"},"name":"Acme Limited","postal_code":"EC1V 7LQ"}]} } } diff --git a/tests/fixtures/webhooks.json b/tests/fixtures/webhooks.json index 41e7f79f..316680a7 100644 --- a/tests/fixtures/webhooks.json +++ b/tests/fixtures/webhooks.json @@ -3,18 +3,18 @@ "method": "GET", "path_template": "/webhooks", "url_params": [], - "body": {"meta":{"cursors":{"after":"example after 7044","before":"example before 8784"},"limit":50},"webhooks":[{"created_at":"2014-01-01T12:00:00.000Z","id":"WB123","is_test":false,"request_body":"example request_body 8454","request_headers":{},"response_body":"example response_body 7352","response_body_truncated":true,"response_code":8401,"response_headers":{},"response_headers_content_truncated":false,"response_headers_count_truncated":true,"successful":true,"url":"https://example.com/webhooks"},{"created_at":"2014-01-01T12:00:00.000Z","id":"WB123","is_test":true,"request_body":"example request_body 9338","request_headers":{},"response_body":"example response_body 3780","response_body_truncated":false,"response_code":2641,"response_headers":{},"response_headers_content_truncated":true,"response_headers_count_truncated":true,"successful":false,"url":"https://example.com/webhooks"}]} + "body": {"meta":{"cursors":{"after":"example after 4191","before":"example before 1561"},"limit":50},"webhooks":[{"created_at":"2014-01-01T12:00:00.000Z","id":"WB123","is_test":true,"request_body":"example request_body 9244","request_headers":{},"response_body":"example response_body 7346","response_body_truncated":false,"response_code":4633,"response_headers":{},"response_headers_content_truncated":false,"response_headers_count_truncated":false,"successful":false,"url":"https://example.com/webhooks"},{"created_at":"2014-01-01T12:00:00.000Z","id":"WB123","is_test":true,"request_body":"example request_body 344","request_headers":{},"response_body":"example response_body 1806","response_body_truncated":true,"response_code":7800,"response_headers":{},"response_headers_content_truncated":false,"response_headers_count_truncated":true,"successful":true,"url":"https://example.com/webhooks"}]} }, "get": { "method": "GET", "path_template": "/webhooks/:identity", "url_params": ["WB123"], - "body": {"webhooks":{"created_at":"2014-01-01T12:00:00.000Z","id":"WB123","is_test":false,"request_body":"example request_body 3237","request_headers":{},"response_body":"example response_body 2523","response_body_truncated":true,"response_code":998,"response_headers":{},"response_headers_content_truncated":false,"response_headers_count_truncated":true,"successful":true,"url":"https://example.com/webhooks"}} + "body": {"webhooks":{"created_at":"2014-01-01T12:00:00.000Z","id":"WB123","is_test":true,"request_body":"example request_body 6312","request_headers":{},"response_body":"example response_body 6444","response_body_truncated":false,"response_code":4278,"response_headers":{},"response_headers_content_truncated":false,"response_headers_count_truncated":true,"successful":false,"url":"https://example.com/webhooks"}} }, "retry": { "method": "POST", "path_template": "/webhooks/:identity/actions/retry", "url_params": ["WB123"], - "body": {"webhooks":{"created_at":"2014-01-01T12:00:00.000Z","id":"WB123","is_test":true,"request_body":"example request_body 1428","request_headers":{},"response_body":"example response_body 3495","response_body_truncated":true,"response_code":72,"response_headers":{},"response_headers_content_truncated":true,"response_headers_count_truncated":false,"successful":true,"url":"https://example.com/webhooks"}} + "body": {"webhooks":{"created_at":"2014-01-01T12:00:00.000Z","id":"WB123","is_test":true,"request_body":"example request_body 7801","request_headers":{},"response_body":"example response_body 2971","response_body_truncated":true,"response_code":8158,"response_headers":{},"response_headers_content_truncated":true,"response_headers_count_truncated":false,"successful":false,"url":"https://example.com/webhooks"}} } } diff --git a/tests/integration/balances_integration_test.py b/tests/integration/balances_integration_test.py index 94070124..79d99606 100644 --- a/tests/integration/balances_integration_test.py +++ b/tests/integration/balances_integration_test.py @@ -74,10 +74,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.balances.all()) + all_records = list(helpers.client.balances.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['balances']) * 2 for record in all_records: assert isinstance(record, resources.Balance) diff --git a/tests/integration/billing_request_templates_integration_test.py b/tests/integration/billing_request_templates_integration_test.py index dfc76ef9..e2aad811 100644 --- a/tests/integration/billing_request_templates_integration_test.py +++ b/tests/integration/billing_request_templates_integration_test.py @@ -87,10 +87,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.billing_request_templates.all()) + all_records = list(helpers.client.billing_request_templates.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['billing_request_templates']) * 2 for record in all_records: assert isinstance(record, resources.BillingRequestTemplate) diff --git a/tests/integration/billing_requests_integration_test.py b/tests/integration/billing_requests_integration_test.py index 07d08417..bd6d50ef 100644 --- a/tests/integration/billing_requests_integration_test.py +++ b/tests/integration/billing_requests_integration_test.py @@ -63,6 +63,7 @@ def test_billing_requests_create(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -182,6 +183,7 @@ def test_billing_requests_collect_customer_details(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -277,6 +279,7 @@ def test_billing_requests_collect_bank_account(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -372,6 +375,7 @@ def test_billing_requests_confirm_payer_details(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -467,6 +471,7 @@ def test_billing_requests_fulfil(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -562,6 +567,7 @@ def test_billing_requests_cancel(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -672,10 +678,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.billing_requests.all()) + all_records = list(helpers.client.billing_requests.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['billing_requests']) * 2 for record in all_records: assert isinstance(record, resources.BillingRequest) @@ -729,6 +735,7 @@ def test_billing_requests_get(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -831,6 +838,7 @@ def test_billing_requests_notify(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -926,6 +934,7 @@ def test_billing_requests_fallback(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -1021,6 +1030,7 @@ def test_billing_requests_choose_currency(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] @@ -1116,6 +1126,7 @@ def test_billing_requests_select_institution(): assert response.mandate_request.constraints == body.get('mandate_request')['constraints'] assert response.mandate_request.currency == body.get('mandate_request')['currency'] assert response.mandate_request.description == body.get('mandate_request')['description'] + assert response.mandate_request.funds_settlement == body.get('mandate_request')['funds_settlement'] assert response.mandate_request.links == body.get('mandate_request')['links'] assert response.mandate_request.metadata == body.get('mandate_request')['metadata'] assert response.mandate_request.payer_requested_dual_signature == body.get('mandate_request')['payer_requested_dual_signature'] diff --git a/tests/integration/blocks_integration_test.py b/tests/integration/blocks_integration_test.py index cf92d7a7..d062499e 100644 --- a/tests/integration/blocks_integration_test.py +++ b/tests/integration/blocks_integration_test.py @@ -175,10 +175,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.blocks.all()) + all_records = list(helpers.client.blocks.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['blocks']) * 2 for record in all_records: assert isinstance(record, resources.Block) diff --git a/tests/integration/creditor_bank_accounts_integration_test.py b/tests/integration/creditor_bank_accounts_integration_test.py index 2394d068..dbdc3640 100644 --- a/tests/integration/creditor_bank_accounts_integration_test.py +++ b/tests/integration/creditor_bank_accounts_integration_test.py @@ -142,10 +142,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.creditor_bank_accounts.all()) + all_records = list(helpers.client.creditor_bank_accounts.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['creditor_bank_accounts']) * 2 for record in all_records: assert isinstance(record, resources.CreditorBankAccount) diff --git a/tests/integration/creditors_integration_test.py b/tests/integration/creditors_integration_test.py index 8db879a3..0fd3cf56 100644 --- a/tests/integration/creditors_integration_test.py +++ b/tests/integration/creditors_integration_test.py @@ -167,10 +167,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.creditors.all()) + all_records = list(helpers.client.creditors.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['creditors']) * 2 for record in all_records: assert isinstance(record, resources.Creditor) diff --git a/tests/integration/currency_exchange_rates_integration_test.py b/tests/integration/currency_exchange_rates_integration_test.py index 22df66d6..34e7633d 100644 --- a/tests/integration/currency_exchange_rates_integration_test.py +++ b/tests/integration/currency_exchange_rates_integration_test.py @@ -74,10 +74,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.currency_exchange_rates.all()) + all_records = list(helpers.client.currency_exchange_rates.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['currency_exchange_rates']) * 2 for record in all_records: assert isinstance(record, resources.CurrencyExchangeRate) diff --git a/tests/integration/customer_bank_accounts_integration_test.py b/tests/integration/customer_bank_accounts_integration_test.py index a5db7724..0f3b2b41 100644 --- a/tests/integration/customer_bank_accounts_integration_test.py +++ b/tests/integration/customer_bank_accounts_integration_test.py @@ -142,10 +142,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.customer_bank_accounts.all()) + all_records = list(helpers.client.customer_bank_accounts.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['customer_bank_accounts']) * 2 for record in all_records: assert isinstance(record, resources.CustomerBankAccount) diff --git a/tests/integration/customers_integration_test.py b/tests/integration/customers_integration_test.py index f7ed9209..e200c7c3 100644 --- a/tests/integration/customers_integration_test.py +++ b/tests/integration/customers_integration_test.py @@ -155,10 +155,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.customers.all()) + all_records = list(helpers.client.customers.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['customers']) * 2 for record in all_records: assert isinstance(record, resources.Customer) diff --git a/tests/integration/events_integration_test.py b/tests/integration/events_integration_test.py index 8a62e52a..4acd6c35 100644 --- a/tests/integration/events_integration_test.py +++ b/tests/integration/events_integration_test.py @@ -77,10 +77,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.events.all()) + all_records = list(helpers.client.events.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['events']) * 2 for record in all_records: assert isinstance(record, resources.Event) @@ -122,6 +122,7 @@ def test_events_get(): assert response.links.customer_bank_account == body.get('links')['customer_bank_account'] assert response.links.instalment_schedule == body.get('links')['instalment_schedule'] assert response.links.mandate == body.get('links')['mandate'] + assert response.links.mandate_request == body.get('links')['mandate_request'] assert response.links.mandate_request_mandate == body.get('links')['mandate_request_mandate'] assert response.links.new_customer_bank_account == body.get('links')['new_customer_bank_account'] assert response.links.new_mandate == body.get('links')['new_mandate'] @@ -135,6 +136,8 @@ def test_events_get(): assert response.links.refund == body.get('links')['refund'] assert response.links.scheme_identifier == body.get('links')['scheme_identifier'] assert response.links.subscription == body.get('links')['subscription'] + assert response.source.name == body.get('source')['name'] + assert response.source.type == body.get('source')['type'] @responses.activate def test_timeout_events_get_retries(): diff --git a/tests/integration/exports_integration_test.py b/tests/integration/exports_integration_test.py index 39abef36..2e6e47cf 100644 --- a/tests/integration/exports_integration_test.py +++ b/tests/integration/exports_integration_test.py @@ -112,10 +112,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.exports.all()) + all_records = list(helpers.client.exports.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['exports']) * 2 for record in all_records: assert isinstance(record, resources.Export) diff --git a/tests/integration/instalment_schedules_integration_test.py b/tests/integration/instalment_schedules_integration_test.py index 485c786a..6bdd1a09 100644 --- a/tests/integration/instalment_schedules_integration_test.py +++ b/tests/integration/instalment_schedules_integration_test.py @@ -198,10 +198,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.instalment_schedules.all()) + all_records = list(helpers.client.instalment_schedules.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['instalment_schedules']) * 2 for record in all_records: assert isinstance(record, resources.InstalmentSchedule) diff --git a/tests/integration/institutions_integration_test.py b/tests/integration/institutions_integration_test.py index 6e2061aa..83ea46cc 100644 --- a/tests/integration/institutions_integration_test.py +++ b/tests/integration/institutions_integration_test.py @@ -77,10 +77,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.institutions.all()) + all_records = list(helpers.client.institutions.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['institutions']) * 2 for record in all_records: assert isinstance(record, resources.Institution) diff --git a/tests/integration/mandate_import_entries_integration_test.py b/tests/integration/mandate_import_entries_integration_test.py index c6d105d7..391bc28b 100644 --- a/tests/integration/mandate_import_entries_integration_test.py +++ b/tests/integration/mandate_import_entries_integration_test.py @@ -112,10 +112,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.mandate_import_entries.all()) + all_records = list(helpers.client.mandate_import_entries.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['mandate_import_entries']) * 2 for record in all_records: assert isinstance(record, resources.MandateImportEntry) diff --git a/tests/integration/mandates_integration_test.py b/tests/integration/mandates_integration_test.py index d5f8ae7e..5f02bdb6 100644 --- a/tests/integration/mandates_integration_test.py +++ b/tests/integration/mandates_integration_test.py @@ -40,7 +40,9 @@ def test_mandates_create(): assert response.verified_at == body.get('verified_at') assert response.consent_parameters.end_date == body.get('consent_parameters')['end_date'] assert response.consent_parameters.max_amount_per_payment == body.get('consent_parameters')['max_amount_per_payment'] - assert response.consent_parameters.periods == body.get('consent_parameters')['periods'] + assert response.consent_parameters.max_amount_per_period == body.get('consent_parameters')['max_amount_per_period'] + assert response.consent_parameters.max_payments_per_period == body.get('consent_parameters')['max_payments_per_period'] + assert response.consent_parameters.period == body.get('consent_parameters')['period'] assert response.consent_parameters.start_date == body.get('consent_parameters')['start_date'] assert response.links.creditor == body.get('links')['creditor'] assert response.links.customer == body.get('links')['customer'] @@ -153,10 +155,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.mandates.all()) + all_records = list(helpers.client.mandates.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['mandates']) * 2 for record in all_records: assert isinstance(record, resources.Mandate) @@ -187,7 +189,9 @@ def test_mandates_get(): assert response.verified_at == body.get('verified_at') assert response.consent_parameters.end_date == body.get('consent_parameters')['end_date'] assert response.consent_parameters.max_amount_per_payment == body.get('consent_parameters')['max_amount_per_payment'] - assert response.consent_parameters.periods == body.get('consent_parameters')['periods'] + assert response.consent_parameters.max_amount_per_period == body.get('consent_parameters')['max_amount_per_period'] + assert response.consent_parameters.max_payments_per_period == body.get('consent_parameters')['max_payments_per_period'] + assert response.consent_parameters.period == body.get('consent_parameters')['period'] assert response.consent_parameters.start_date == body.get('consent_parameters')['start_date'] assert response.links.creditor == body.get('links')['creditor'] assert response.links.customer == body.get('links')['customer'] @@ -240,7 +244,9 @@ def test_mandates_update(): assert response.verified_at == body.get('verified_at') assert response.consent_parameters.end_date == body.get('consent_parameters')['end_date'] assert response.consent_parameters.max_amount_per_payment == body.get('consent_parameters')['max_amount_per_payment'] - assert response.consent_parameters.periods == body.get('consent_parameters')['periods'] + assert response.consent_parameters.max_amount_per_period == body.get('consent_parameters')['max_amount_per_period'] + assert response.consent_parameters.max_payments_per_period == body.get('consent_parameters')['max_payments_per_period'] + assert response.consent_parameters.period == body.get('consent_parameters')['period'] assert response.consent_parameters.start_date == body.get('consent_parameters')['start_date'] assert response.links.creditor == body.get('links')['creditor'] assert response.links.customer == body.get('links')['customer'] @@ -293,7 +299,9 @@ def test_mandates_cancel(): assert response.verified_at == body.get('verified_at') assert response.consent_parameters.end_date == body.get('consent_parameters')['end_date'] assert response.consent_parameters.max_amount_per_payment == body.get('consent_parameters')['max_amount_per_payment'] - assert response.consent_parameters.periods == body.get('consent_parameters')['periods'] + assert response.consent_parameters.max_amount_per_period == body.get('consent_parameters')['max_amount_per_period'] + assert response.consent_parameters.max_payments_per_period == body.get('consent_parameters')['max_payments_per_period'] + assert response.consent_parameters.period == body.get('consent_parameters')['period'] assert response.consent_parameters.start_date == body.get('consent_parameters')['start_date'] assert response.links.creditor == body.get('links')['creditor'] assert response.links.customer == body.get('links')['customer'] @@ -339,7 +347,9 @@ def test_mandates_reinstate(): assert response.verified_at == body.get('verified_at') assert response.consent_parameters.end_date == body.get('consent_parameters')['end_date'] assert response.consent_parameters.max_amount_per_payment == body.get('consent_parameters')['max_amount_per_payment'] - assert response.consent_parameters.periods == body.get('consent_parameters')['periods'] + assert response.consent_parameters.max_amount_per_period == body.get('consent_parameters')['max_amount_per_period'] + assert response.consent_parameters.max_payments_per_period == body.get('consent_parameters')['max_payments_per_period'] + assert response.consent_parameters.period == body.get('consent_parameters')['period'] assert response.consent_parameters.start_date == body.get('consent_parameters')['start_date'] assert response.links.creditor == body.get('links')['creditor'] assert response.links.customer == body.get('links')['customer'] diff --git a/tests/integration/negative_balance_limits_integration_test.py b/tests/integration/negative_balance_limits_integration_test.py index 98aeccf9..88eb61eb 100644 --- a/tests/integration/negative_balance_limits_integration_test.py +++ b/tests/integration/negative_balance_limits_integration_test.py @@ -74,10 +74,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.negative_balance_limits.all()) + all_records = list(helpers.client.negative_balance_limits.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['negative_balance_limits']) * 2 for record in all_records: assert isinstance(record, resources.NegativeBalanceLimit) diff --git a/tests/integration/outbound_payments_integration_test.py b/tests/integration/outbound_payments_integration_test.py index c6a6474c..637086f0 100644 --- a/tests/integration/outbound_payments_integration_test.py +++ b/tests/integration/outbound_payments_integration_test.py @@ -312,10 +312,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.outbound_payments.all()) + all_records = list(helpers.client.outbound_payments.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['outbound_payments']) * 2 for record in all_records: assert isinstance(record, resources.OutboundPayment) diff --git a/tests/integration/payment_account_transactions_integration_test.py b/tests/integration/payment_account_transactions_integration_test.py new file mode 100644 index 00000000..6b2a1597 --- /dev/null +++ b/tests/integration/payment_account_transactions_integration_test.py @@ -0,0 +1,90 @@ +# WARNING: Do not edit by hand, this file was generated by Crank: +# +# https://github.com/gocardless/crank +# + +import json + +import pytest +import requests +import responses + +from gocardless_pro.errors import MalformedResponseError +from gocardless_pro import resources +from gocardless_pro import list_response + +from .. import helpers + + +@responses.activate +def test_payment_account_transactions_list(): + fixture = helpers.load_fixture('payment_account_transactions')['list'] + helpers.stub_response(fixture) + response = helpers.client.payment_account_transactions.list(*fixture['url_params']) + body = fixture['body']['payment_account_transactions'] + + assert isinstance(response, list_response.ListResponse) + assert isinstance(response.records[0], resources.PaymentAccountTransaction) + + assert response.before == fixture['body']['meta']['cursors']['before'] + assert response.after == fixture['body']['meta']['cursors']['after'] + assert responses.calls[-1].request.headers.get('Idempotency-Key') is None + assert [r.amount for r in response.records] == [b.get('amount') for b in body] + assert [r.balance_after_transaction for r in response.records] == [b.get('balance_after_transaction') for b in body] + assert [r.counterparty_name for r in response.records] == [b.get('counterparty_name') for b in body] + assert [r.currency for r in response.records] == [b.get('currency') for b in body] + assert [r.description for r in response.records] == [b.get('description') for b in body] + assert [r.direction for r in response.records] == [b.get('direction') for b in body] + assert [r.id for r in response.records] == [b.get('id') for b in body] + assert [r.reference for r in response.records] == [b.get('reference') for b in body] + assert [r.value_date for r in response.records] == [b.get('value_date') for b in body] + +@responses.activate +def test_timeout_payment_account_transactions_list_retries(): + fixture = helpers.load_fixture('payment_account_transactions')['list'] + with helpers.stub_timeout_then_response(fixture) as rsps: + response = helpers.client.payment_account_transactions.list(*fixture['url_params']) + assert len(rsps.calls) == 2 + assert rsps.calls[0].request.headers.get('Idempotency-Key') == rsps.calls[1].request.headers.get('Idempotency-Key') + body = fixture['body']['payment_account_transactions'] + + assert isinstance(response, list_response.ListResponse) + assert isinstance(response.records[0], resources.PaymentAccountTransaction) + + assert response.before == fixture['body']['meta']['cursors']['before'] + assert response.after == fixture['body']['meta']['cursors']['after'] + +def test_502_payment_account_transactions_list_retries(): + fixture = helpers.load_fixture('payment_account_transactions')['list'] + with helpers.stub_502_then_response(fixture) as rsps: + response = helpers.client.payment_account_transactions.list(*fixture['url_params']) + assert len(rsps.calls) == 2 + assert rsps.calls[0].request.headers.get('Idempotency-Key') == rsps.calls[1].request.headers.get('Idempotency-Key') + body = fixture['body']['payment_account_transactions'] + + assert isinstance(response, list_response.ListResponse) + assert isinstance(response.records[0], resources.PaymentAccountTransaction) + + assert response.before == fixture['body']['meta']['cursors']['before'] + assert response.after == fixture['body']['meta']['cursors']['after'] + +@responses.activate +def test_payment_account_transactions_all(): + fixture = helpers.load_fixture('payment_account_transactions')['list'] + + def callback(request): + if 'after=123' in request.url: + fixture['body']['meta']['cursors']['after'] = None + else: + fixture['body']['meta']['cursors']['after'] = '123' + return [200, {}, json.dumps(fixture['body'])] + + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) + + all_records = list(helpers.client.payment_account_transactions.all(*fixture['url_params'])) + assert len(all_records) == len(fixture['body']['payment_account_transactions']) * 2 + for record in all_records: + assert isinstance(record, resources.PaymentAccountTransaction) + + diff --git a/tests/integration/payments_integration_test.py b/tests/integration/payments_integration_test.py index f38ffcdd..7c586f46 100644 --- a/tests/integration/payments_integration_test.py +++ b/tests/integration/payments_integration_test.py @@ -36,6 +36,7 @@ def test_payments_create(): assert response.metadata == body.get('metadata') assert response.reference == body.get('reference') assert response.retry_if_possible == body.get('retry_if_possible') + assert response.scheme == body.get('scheme') assert response.status == body.get('status') assert response.fx.estimated_exchange_rate == body.get('fx')['estimated_exchange_rate'] assert response.fx.exchange_rate == body.get('fx')['exchange_rate'] @@ -110,6 +111,7 @@ def test_payments_list(): assert [r.metadata for r in response.records] == [b.get('metadata') for b in body] assert [r.reference for r in response.records] == [b.get('reference') for b in body] assert [r.retry_if_possible for r in response.records] == [b.get('retry_if_possible') for b in body] + assert [r.scheme for r in response.records] == [b.get('scheme') for b in body] assert [r.status for r in response.records] == [b.get('status') for b in body] @responses.activate @@ -152,10 +154,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.payments.all()) + all_records = list(helpers.client.payments.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['payments']) * 2 for record in all_records: assert isinstance(record, resources.Payment) @@ -182,6 +184,7 @@ def test_payments_get(): assert response.metadata == body.get('metadata') assert response.reference == body.get('reference') assert response.retry_if_possible == body.get('retry_if_possible') + assert response.scheme == body.get('scheme') assert response.status == body.get('status') assert response.fx.estimated_exchange_rate == body.get('fx')['estimated_exchange_rate'] assert response.fx.exchange_rate == body.get('fx')['exchange_rate'] @@ -235,6 +238,7 @@ def test_payments_update(): assert response.metadata == body.get('metadata') assert response.reference == body.get('reference') assert response.retry_if_possible == body.get('retry_if_possible') + assert response.scheme == body.get('scheme') assert response.status == body.get('status') assert response.fx.estimated_exchange_rate == body.get('fx')['estimated_exchange_rate'] assert response.fx.exchange_rate == body.get('fx')['exchange_rate'] @@ -288,6 +292,7 @@ def test_payments_cancel(): assert response.metadata == body.get('metadata') assert response.reference == body.get('reference') assert response.retry_if_possible == body.get('retry_if_possible') + assert response.scheme == body.get('scheme') assert response.status == body.get('status') assert response.fx.estimated_exchange_rate == body.get('fx')['estimated_exchange_rate'] assert response.fx.exchange_rate == body.get('fx')['exchange_rate'] @@ -334,6 +339,7 @@ def test_payments_retry(): assert response.metadata == body.get('metadata') assert response.reference == body.get('reference') assert response.retry_if_possible == body.get('retry_if_possible') + assert response.scheme == body.get('scheme') assert response.status == body.get('status') assert response.fx.estimated_exchange_rate == body.get('fx')['estimated_exchange_rate'] assert response.fx.exchange_rate == body.get('fx')['exchange_rate'] diff --git a/tests/integration/payout_items_integration_test.py b/tests/integration/payout_items_integration_test.py index c3f13af9..e64c8565 100644 --- a/tests/integration/payout_items_integration_test.py +++ b/tests/integration/payout_items_integration_test.py @@ -73,10 +73,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.payout_items.all()) + all_records = list(helpers.client.payout_items.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['payout_items']) * 2 for record in all_records: assert isinstance(record, resources.PayoutItem) diff --git a/tests/integration/payouts_integration_test.py b/tests/integration/payouts_integration_test.py index 51e27c9b..082e3ae9 100644 --- a/tests/integration/payouts_integration_test.py +++ b/tests/integration/payouts_integration_test.py @@ -81,10 +81,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.payouts.all()) + all_records = list(helpers.client.payouts.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['payouts']) * 2 for record in all_records: assert isinstance(record, resources.Payout) diff --git a/tests/integration/refunds_integration_test.py b/tests/integration/refunds_integration_test.py index 8f45c958..ec939a17 100644 --- a/tests/integration/refunds_integration_test.py +++ b/tests/integration/refunds_integration_test.py @@ -139,10 +139,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.refunds.all()) + all_records = list(helpers.client.refunds.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['refunds']) * 2 for record in all_records: assert isinstance(record, resources.Refund) diff --git a/tests/integration/scheme_identifiers_integration_test.py b/tests/integration/scheme_identifiers_integration_test.py index 81d1d63b..8bfb356c 100644 --- a/tests/integration/scheme_identifiers_integration_test.py +++ b/tests/integration/scheme_identifiers_integration_test.py @@ -155,10 +155,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.scheme_identifiers.all()) + all_records = list(helpers.client.scheme_identifiers.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['scheme_identifiers']) * 2 for record in all_records: assert isinstance(record, resources.SchemeIdentifier) diff --git a/tests/integration/subscriptions_integration_test.py b/tests/integration/subscriptions_integration_test.py index 0f0024b5..7327a4f2 100644 --- a/tests/integration/subscriptions_integration_test.py +++ b/tests/integration/subscriptions_integration_test.py @@ -160,10 +160,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.subscriptions.all()) + all_records = list(helpers.client.subscriptions.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['subscriptions']) * 2 for record in all_records: assert isinstance(record, resources.Subscription) diff --git a/tests/integration/tax_rates_integration_test.py b/tests/integration/tax_rates_integration_test.py index 99f0c195..6fb5102e 100644 --- a/tests/integration/tax_rates_integration_test.py +++ b/tests/integration/tax_rates_integration_test.py @@ -76,10 +76,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.tax_rates.all()) + all_records = list(helpers.client.tax_rates.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['tax_rates']) * 2 for record in all_records: assert isinstance(record, resources.TaxRate) diff --git a/tests/integration/verification_details_integration_test.py b/tests/integration/verification_details_integration_test.py index 00368a6f..a24fffa7 100644 --- a/tests/integration/verification_details_integration_test.py +++ b/tests/integration/verification_details_integration_test.py @@ -121,10 +121,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.verification_details.all()) + all_records = list(helpers.client.verification_details.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['verification_details']) * 2 for record in all_records: assert isinstance(record, resources.VerificationDetail) diff --git a/tests/integration/webhooks_integration_test.py b/tests/integration/webhooks_integration_test.py index 5f7ea24c..7593bab6 100644 --- a/tests/integration/webhooks_integration_test.py +++ b/tests/integration/webhooks_integration_test.py @@ -83,10 +83,10 @@ def callback(request): fixture['body']['meta']['cursors']['after'] = '123' return [200, {}, json.dumps(fixture['body'])] - url = 'http://example.com' + fixture['path_template'] - responses.add_callback(fixture['method'], url, callback) + url_pattern = helpers.url_pattern_for(fixture) + responses.add_callback(fixture['method'], url_pattern, callback) - all_records = list(helpers.client.webhooks.all()) + all_records = list(helpers.client.webhooks.all(*fixture['url_params'])) assert len(all_records) == len(fixture['body']['webhooks']) * 2 for record in all_records: assert isinstance(record, resources.Webhook) diff --git a/tests/payment_account_transactions_nested_url_test.py b/tests/payment_account_transactions_nested_url_test.py new file mode 100644 index 00000000..cc699b3f --- /dev/null +++ b/tests/payment_account_transactions_nested_url_test.py @@ -0,0 +1,46 @@ +import os +import json + +import pytest +import responses + +from gocardless_pro import Client +from gocardless_pro import resources + +fixture_path = os.path.join( + os.path.dirname(__file__), + 'fixtures', + 'payment_account_transactions.json' +) +with open(fixture_path) as f: + fixtures = json.load(f) + +list_fixture = fixtures['list'] + +@responses.activate +def test_payment_account_transactions_list(): + url = 'https://api-sandbox.gocardless.com' + '/payment_accounts/BA0000107EBP2S/transactions' + responses.add( + responses.GET, + url, + json=list_fixture['body'], + status=200 + ) + + client = Client(access_token='test_token', environment='sandbox') + response = client.payment_account_transactions.list('BA0000107EBP2S') + + assert len(response.records) == 2 + assert isinstance(response.records[0], resources.PaymentAccountTransaction) + assert isinstance(response.records[1], resources.PaymentAccountTransaction) + + fixture_transactions = list_fixture['body']['payment_account_transactions'] + assert response.records[0].id == fixture_transactions[0]['id'] + assert response.records[0].amount == fixture_transactions[0]['amount'] + assert response.records[0].direction == fixture_transactions[0]['direction'] + assert response.records[0].counterparty_name == fixture_transactions[0]['counterparty_name'] + + assert response.records[1].id == fixture_transactions[1]['id'] + assert response.records[1].amount == fixture_transactions[1]['amount'] + assert response.records[1].direction == fixture_transactions[1]['direction'] + assert response.records[1].counterparty_name == fixture_transactions[1]['counterparty_name'] diff --git a/tests/webhooks_tests.py b/tests/webhooks_tests.py deleted file mode 100644 index 8b50b5f5..00000000 --- a/tests/webhooks_tests.py +++ /dev/null @@ -1,36 +0,0 @@ -from nose.tools import assert_equals, raises - -from gocardless_pro.webhooks import parse -from gocardless_pro.errors import InvalidSignatureError - -import os - -fixture = open( - os.path.join( - os.path.dirname(__file__), - 'fixtures', - 'webhook_body.json' - ) -).read().strip() - -fixture_signature = "2693754819d3e32d7e8fcb13c729631f316c6de8dc1cf634d6527f1c07276e7e" -key = "ED7D658C-D8EB-4941-948B-3973214F2D49" - -def test_it_parses_the_body(): - result = parse(fixture, key, fixture_signature) - assert_equals(len(result), 2) - - first_event = result[0] - assert_equals(first_event.id, "EV00BD05S5VM2T") - -def test_it_parses_the_body_from_bytes(): - result = parse(bytearray(fixture, 'utf-8'), key, fixture_signature) - assert_equals(len(result), 2) - - first_event = result[0] - assert_equals(first_event.id, "EV00BD05S5VM2T") - -@raises(InvalidSignatureError) -def test_it_raises_with_invalid_signature(): - wrong_key = "anotherkey" - parse(fixture, wrong_key, fixture_signature)