update
This commit is contained in:
68
readme.md
68
readme.md
@@ -7,22 +7,6 @@ A full-featured TypeScript/JavaScript client for the bunq API
|
||||
* [github.com (source mirror)](https://github.com/mojoio/bunq)
|
||||
* [docs (typedoc)](https://mojoio.gitlab.io/bunq/)
|
||||
|
||||
## Status for master
|
||||
|
||||
Status Category | Status Badge
|
||||
-- | --
|
||||
GitLab Pipelines | [](https://lossless.cloud)
|
||||
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||
npm | [](https://lossless.cloud)
|
||||
Snyk | [](https://lossless.cloud)
|
||||
TypeScript Support | [](https://lossless.cloud)
|
||||
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
Code Style | [](https://lossless.cloud)
|
||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||
|
||||
## Features
|
||||
|
||||
- Complete bunq API implementation
|
||||
@@ -86,19 +70,19 @@ const payment = BunqPayment.builder(bunq, monetaryAccount)
|
||||
.create();
|
||||
|
||||
// Batch payment
|
||||
const batch = new BunqBatchPayment(bunq, monetaryAccount);
|
||||
batch
|
||||
.addPayment({
|
||||
const batch = new BunqPaymentBatch(bunq);
|
||||
const batchId = await batch.create(monetaryAccount, [
|
||||
{
|
||||
amount: { value: '5.00', currency: 'EUR' },
|
||||
counterparty_alias: { type: 'IBAN', value: 'NL91ABNA0417164300' },
|
||||
counterparty_alias: { type: 'IBAN', value: 'NL91ABNA0417164300', name: 'Recipient 1' },
|
||||
description: 'Payment 1'
|
||||
})
|
||||
.addPayment({
|
||||
},
|
||||
{
|
||||
amount: { value: '15.00', currency: 'EUR' },
|
||||
counterparty_alias: { type: 'EMAIL', value: 'friend@example.com' },
|
||||
counterparty_alias: { type: 'EMAIL', value: 'friend@example.com', name: 'Friend' },
|
||||
description: 'Payment 2'
|
||||
});
|
||||
await batch.create();
|
||||
}
|
||||
]);
|
||||
```
|
||||
|
||||
### Managing Cards
|
||||
@@ -129,10 +113,10 @@ const newCard = await BunqCard.order(bunq, {
|
||||
### Scheduled Payments
|
||||
|
||||
```typescript
|
||||
import { BunqScheduledPayment } from '@apiclient.xyz/bunq';
|
||||
import { BunqSchedulePayment } from '@apiclient.xyz/bunq';
|
||||
|
||||
// Create a recurring payment
|
||||
const scheduled = BunqScheduledPayment.builder(bunq, monetaryAccount)
|
||||
const scheduled = await BunqSchedulePayment.builder(bunq, monetaryAccount)
|
||||
.amount('50.00', 'EUR')
|
||||
.toIban('NL91ABNA0417164300', 'Landlord')
|
||||
.description('Monthly rent')
|
||||
@@ -140,7 +124,8 @@ const scheduled = BunqScheduledPayment.builder(bunq, monetaryAccount)
|
||||
.create();
|
||||
|
||||
// List scheduled payments
|
||||
const schedules = await BunqScheduledPayment.list(bunq, monetaryAccount.id);
|
||||
const scheduler = new BunqSchedulePayment(bunq);
|
||||
const schedules = await scheduler.list(monetaryAccount);
|
||||
```
|
||||
|
||||
### Request Money
|
||||
@@ -292,6 +277,33 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Run the test suite:
|
||||
|
||||
```bash
|
||||
npm test # Run all tests
|
||||
npm run test:basic # Run basic functionality tests
|
||||
npm run test:payments # Run payment-related tests
|
||||
npm run test:webhooks # Run webhook tests
|
||||
npm run test:session # Run session management tests
|
||||
npm run test:errors # Run error handling tests
|
||||
npm run test:advanced # Run advanced feature tests
|
||||
```
|
||||
|
||||
### Test Coverage
|
||||
|
||||
The test suite includes comprehensive coverage for:
|
||||
|
||||
- **Basic functionality**: Account creation, initialization, transactions
|
||||
- **Payments**: Payment builders, draft payments, payment requests
|
||||
- **Webhooks**: Creation, management, signature verification
|
||||
- **Session management**: Persistence, expiry, concurrent usage
|
||||
- **Error handling**: Network errors, invalid inputs, rate limiting
|
||||
- **Advanced features**: Joint accounts, cards, notifications, exports
|
||||
|
||||
All tests use the bunq sandbox environment and create fresh API keys for each test run.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 10.x or higher
|
||||
|
Reference in New Issue
Block a user