Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Funds Transfers Page #825

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/components/Error.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

---
import Badge from '../components/Badge.astro';

const { code, message } = Astro.props;
---

<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
<dt class="sr-only">
Error Code
</dt>
<dd>
{code}
</dd>
<dt class="sr-only">
Error Message
</dt>
<dd>
<Badge text={message}>
</dd>
<dt class="sr-only">
Description
</dt>
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
<slot />
</dd>
</dl>
</li>
2 changes: 1 addition & 1 deletion src/components/Properties.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="my-6">
<ul
role="list"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5"
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0"
>
<slot />
</ul>
Expand Down
9 changes: 6 additions & 3 deletions src/content/api/account-memberships.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nav:
---
import Properties from '../../components/Properties.astro';
import Property from '../../components/Property.astro';
import Error from '../../components/Error.astro';
import Endpoint from '../../components/Endpoint.astro';
import Badge from '../../components/Badge.astro';
import CodePanel from '../../components/CodePanel.astro';
Expand Down Expand Up @@ -193,9 +194,11 @@ A Member contains extended information about a user's access to an account.
No attributes.

### Errors
| Status | Code | Description |
| :----- | :----------------------- | :------------------------------------------------------------- |
| 403 | LAST_OWNER_NOT_REVOKABLE | The last remaining membership to an account cannot be revoked. |
<Properties>
<Error code="403" message="LAST_OWNER_NOT_REVOKABLE">
The last remaining membership to an account cannot be revoked.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="DELETE" path="/api/accounts/{accountId}/members/{userId}">
```bash
Expand Down
14 changes: 10 additions & 4 deletions src/content/api/accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nav:
---
import Properties from '../../components/Properties.astro';
import Property from '../../components/Property.astro';
import Error from '../../components/Error.astro';
import Endpoint from '../../components/Endpoint.astro';
import CodePanel from '../../components/CodePanel.astro';

Expand Down Expand Up @@ -263,9 +264,14 @@ individual account.
</CodePanel>

### Errors
| Status | Code | Description |
| :----- | :------------------- | :------------------------------------------------- |
| 403 | INVALID_ACCOUNT_ID | The account does not exist. |
| 403 | INVALID_SUBSCRIPTION | One of the subscriptions in the list is not valid. |
<Properties>
<Error code="403" message="INVALID_ACCOUNT_ID">
The account does not exist.
</Error>

<Error code="403" message="INVALID_SUBSCRIPTION">
One of the subscriptions in the list is not valid.
</Error>
</Properties>

</Endpoint>
5 changes: 3 additions & 2 deletions src/content/api/bank-account-connection-intents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nav:
---
import Properties from '../../components/Properties.astro';
import Property from '../../components/Property.astro';
import Error from '../../components/Error.astro';
import Endpoint from '../../components/Endpoint.astro';
import CodePanel from '../../components/CodePanel.astro';
import Badge from '../../components/Badge.astro';
Expand Down Expand Up @@ -98,9 +99,9 @@ A Bank Account Connection Intent facilitates user authorization of access to Ban

### Errors
<Properties>
<Property name="403" type="LIVENESS_MISMATCH" error>
<Error code="403" message="LIVENESS_MISMATCH">
Only Bank Account Connection Intents with the `test` flag can be associated with test [Bank Accounts](/api/bank-accounts/), and vice versa.
</Property>
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="POST" path="/api/bank-account-connection-intents">
Expand Down
119 changes: 85 additions & 34 deletions src/content/api/bank-accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nav:
---
import Properties from '../../components/Properties.astro';
import Property from '../../components/Property.astro';
import Error from '../../components/Error.astro';
import Endpoint from '../../components/Endpoint.astro';
import Badge from '../../components/Badge.astro';
import CodePanel from '../../components/CodePanel.astro';
Expand Down Expand Up @@ -158,7 +159,7 @@ The Bank Account balance, retrieved using Open Banking flows. The supported Bank
`directDebitAuthority`, the user accepts our [Direct Debit terms](https://centrapay.com/directdebit-termsandconditions/)
and has authority to operate this account.

`phone`,`fullName` and `emailAddress` are all required to create a direct-debit authority. This is required to be able to Top Up a Bank Account.
`phone`, `fullName` and `emailAddress` are all required to create a direct-debit authority. This is required to be able to Top Up a Bank Account.

### Attributes
<Properties>
Expand Down Expand Up @@ -196,11 +197,19 @@ The Bank Account balance, retrieved using Open Banking flows. The supported Bank
</Properties>

### Errors
| Status | Code | Description |
| :----- | :--------------------------------- | :----------------------------------------------------------------------------------------------- |
| 403 | BANK_ACCOUNT_LIMIT_EXCEEDED | The Centrapay account already has the max amount of directDebitAuthorized enabled Bank Accounts. |
| 403 | BANK_ACCOUNT_HOLDER_LIMIT_EXCEEDED | The global maximum Bank Accounts for the provided Bank Account number has been reached. |
| 403 | DUPLICATE_BANK_ACCOUNT | The Centrapay account already holds this Bank Account. |
<Properties>
<Error code="403" message="BANK_ACCOUNT_LIMIT_EXCEEDED">
The Centrapay account already has the max amount of directDebitAuthorized enabled Bank Accounts.
</Error>

<Error code="403" message="BANK_ACCOUNT_HOLDER_LIMIT_EXCEEDED">
The global maximum Bank Accounts for the provided Bank Account number has been reached.
</Error>

<Error code="403" message="DUPLICATE_BANK_ACCOUNT">
The Centrapay account already holds this Bank Account.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="POST" path="/api/bank-accounts">
```bash
Expand Down Expand Up @@ -268,10 +277,15 @@ The Bank Account balance, retrieved using Open Banking flows. The supported Bank
</Properties>

### Errors
| Status | Code | Description |
| :----- | :------------------------------ | :----------------------------------------------------------------------------------------------- |
| 403 | DIRECT_DEBIT_ALREADY_AUTHORIZED | This bank authority cannot be changed as all fields have been set. |
| 403 | DIRECT_DEBIT_LIMIT_EXCEEDED | The Centrapay account already has the max amount of directDebitAuthorized enabled Bank Accounts. |
<Properties>
<Error code="403" message="DIRECT_DEBIT_ALREADY_AUTHORIZED">
This bank authority cannot be changed as all fields have been set.
</Error>

<Error code="403" message="DIRECT_DEBIT_LIMIT_EXCEEDED">
The Centrapay account already has the max amount of directDebitAuthorized enabled Bank Accounts.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="POST" path="/api/bank-accounts/{bankAccountId}/direct-debit-authorities">
```bash
Expand Down Expand Up @@ -372,10 +386,15 @@ The Bank Account balance, retrieved using Open Banking flows. The supported Bank
No attributes.

### Errors
| Status | Code | Description |
| :----- | :------------------------- | :------------------------------------------------------------------------------------------ |
| 403 | BANK_BALANCE_NOT_SUPPORTED | The [Bank Account Type][] does not support retrieval of a balance using Open Banking flows. |
| 403 | BANK_AUTHORIZATION_INVALID | The access token to retrieve the [Bank Account Balance][] is no longer valid. |
<Properties>
<Error code="403" message="BANK_BALANCE_NOT_SUPPORTED">
The [Bank Account Type](#bank-account-type) does not support retrieval of a balance using Open Banking flows.
</Error>

<Error code="403" message="BANK_AUTHORIZATION_INVALID">
The access token to retrieve the [Bank Account Balance](#bank-account-balance-model) is no longer valid.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="GET" path="/api/bank-accounts/{bankAccountId}/balance">
```bash
Expand Down Expand Up @@ -414,12 +433,23 @@ The Bank Account balance, retrieved using Open Banking flows. The supported Bank
</Properties>

### Errors
| Status | Code | Description |
| :----- | :------------------------------------------ | :------------------------------------------------------------------------------ |
| 403 | BANK_ACCOUNT_ALREADY_VERIFIED | The bank account is already verified. |
| 403 | VERIFICATION_CODE_INVALID | The verification code is incorrect. |
| 403 | BANK_ACCOUNT_VERIFICATION_ATTEMPTS_EXCEEDED | The bank account's maximum failed verification attempts has been reached. |
| 403 | ACCOUNT_MISMATCH | The top up / withdrawal and the bank account do not belong to the same account. |
<Properties>
<Error code="403" message="BANK_ACCOUNT_ALREADY_VERIFIED">
The bank account is already verified.
</Error>

<Error code="403" message="VERIFICATION_CODE_INVALID">
The verification code is incorrect.
</Error>

<Error code="403" message="BANK_ACCOUNT_VERIFICATION_ATTEMPTS_EXCEEDED">
The bank account's maximum failed verification attempts has been reached.
</Error>

<Error code="403" message="ACCOUNT_MISMATCH">
The top up / withdrawal and the bank account do not belong to the same account.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="POST" path="/api/bank-accounts/{bankAccountId}/verify">
```bash
Expand Down Expand Up @@ -460,12 +490,23 @@ The Bank Account balance, retrieved using Open Banking flows. The supported Bank
</Properties>

### Errors
| Status | Code | Description |
| :----- | :------------------------------------------ | :------------------------------------------------------------------------------ |
| 403 | BANK_ACCOUNT_ALREADY_VERIFIED | The bank account is already verified. |
| 403 | VERIFICATION_CODE_INVALID | The verification code is incorrect. |
| 403 | BANK_ACCOUNT_VERIFICATION_ATTEMPTS_EXCEEDED | The bank account's maximum failed verification attempts has been reached. |
| 403 | ACCOUNT_MISMATCH | The top up / withdrawal and the bank account do not belong to the same account. |
<Properties>
<Error code="403" message="BANK_ACCOUNT_ALREADY_VERIFIED">
The bank account is already verified.
</Error>

<Error code="403" message="VERIFICATION_CODE_INVALID">
The verification code is incorrect.
</Error>

<Error code="403" message="BANK_ACCOUNT_VERIFICATION_ATTEMPTS_EXCEEDED">
The bank account's maximum failed verification attempts has been reached.
</Error>

<Error code="403" message="ACCOUNT_MISMATCH">
The top up / withdrawal and the bank account do not belong to the same account.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="POST" path="/api/bank-authorities/{bankAccountId}/verify">
```bash
Expand Down Expand Up @@ -657,10 +698,15 @@ The Bank Account balance, retrieved using Open Banking flows. The supported Bank
</Properties>

### Errors
| Status | Code | Description |
| :----- | :----------------------------------------- | :------------------------------------------------------------------------------------------------------ |
| 403 | BANK_AUTHORITY_LIMIT_EXCEEDED | The account already has the max amount of bank accounts. |
| 403 | BANK_AUTHORITIES_FOR_BANK_ACCOUNT_EXCEEDED | There are already two bank accounts for the provided bank account number, which is the maximum allowed. |
<Properties>
<Error code="403" message="BANK_AUTHORITY_LIMIT_EXCEEDED">
The account already has the max amount of bank accounts.
</Error>

<Error code="403" message="BANK_AUTHORITIES_FOR_BANK_ACCOUNT_EXCEEDED">
There are already two bank accounts for the provided bank account number, which is the maximum allowed.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="POST" path="/api/bank-authorities">
```bash
Expand Down Expand Up @@ -713,10 +759,15 @@ The Bank Account balance, retrieved using Open Banking flows. The supported Bank
No attributes.

### Errors
| Status | Code | Description |
| :----- | :----------------------------------------- | :------------------------------------------------------------------------------------------------------ |
| 403 | BANK_AUTHORITY_LIMIT_EXCEEDED | The account already has the max amount of bank accounts. |
| 403 | BANK_AUTHORITIES_FOR_BANK_ACCOUNT_EXCEEDED | There are already two bank accounts for the provided bank account number, which is the maximum allowed. |
<Properties>
<Error code="403" message="BANK_AUTHORITY_LIMIT_EXCEEDED">
The account already has the max amount of bank accounts.
</Error>

<Error code="403" message="BANK_AUTHORITIES_FOR_BANK_ACCOUNT_EXCEEDED">
There are already two bank accounts for the provided bank account number, which is the maximum allowed.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="GET" path="/api/bank-authorities/{bankAccountId}">
```bash
Expand Down
27 changes: 19 additions & 8 deletions src/content/api/businesses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nav:
---
import Properties from '../../components/Properties.astro';
import Property from '../../components/Property.astro';
import Error from '../../components/Error.astro';
import Endpoint from '../../components/Endpoint.astro';
import Badge from '../../components/Badge.astro';
import CodePanel from '../../components/CodePanel.astro';
Expand Down Expand Up @@ -143,10 +144,15 @@ A Business represents a company registered with the New Zealand Companies Office
</Properties>

### Errors
| Status | Code | Description |
| :----- | :-------------- | :------------------------------------------------------------------------------------------- |
| 403 | INVALID_ACCOUNT | Account does not exist, is not authorized, is of the wrong type, or is not in the NZ region. |
| 403 | INVALID_NZBN | The NZBN provided does not match any NZ business. |
<Properties>
<Error code="403" message="INVALID_ACCOUNT">
Account does not exist, is not authorized, is of the wrong type, or is not in the NZ region.
</Error>

<Error code="403" message="INVALID_NZBN">
The NZBN provided does not match any NZ business.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="POST" path="/api/businesses">
```bash
Expand Down Expand Up @@ -210,10 +216,15 @@ A Business represents a company registered with the New Zealand Companies Office
</Properties>

### Errors
| Status | Code | Description |
| :----- | :-------------- | :------------------------------------------------------------------------------------------- |
| 403 | INVALID_ACCOUNT | Account does not exist, is not authorized, is of the wrong type, or is not in the NZ region. |
| 403 | INVALID_NZBN | The NZBN provided does not match any NZ business. |
<Properties>
<Error code="403" message="INVALID_ACCOUNT">
Account does not exist, is not authorized, is of the wrong type, or is not in the NZ region.
</Error>

<Error code="403" message="INVALID_NZBN">
The NZBN provided does not match any NZ business.
</Error>
</Properties>

<CodePanel slot="code-examples" title="Request" method="PUT" path="/api/businesses/{businessId}">
```bash
Expand Down
Loading
Loading