Skip to content

Commit 322bcec

Browse files
add billing module (#25)
1 parent 6903903 commit 322bcec

File tree

10 files changed

+284
-4722
lines changed

10 files changed

+284
-4722
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
.env.production
55
node_modules
66
coverage
7-
*.jpeg
7+
*.jpeg
8+
.DS_Store

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 3.8.0
2+
3+
- Added `billing` module.
4+
- Added `getUsage` function in `billing` module.
5+
16
## 3.7.0
27

38
- Added support for generating Presigned Urls for Multipart Upload. See `createSignedUrlV2` in `assets` module.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 PixelBin
3+
Copyright (c) 2024 PixelBin
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

documentation/platform/BILLING.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
##### [Back to Pixelbin API docs](./README.md)
2+
3+
## Billing Methods
4+
5+
Payment Service
6+
7+
- [getUsage](#getusage)
8+
9+
## Methods with example and description
10+
11+
### getUsage
12+
13+
**Summary**: Get current usage of organization
14+
15+
```javascript
16+
// Promise
17+
18+
const promise = billing.getUsage();
19+
20+
// Async/Await
21+
22+
const data = await billing.getUsage();
23+
```
24+
25+
Get current usage of organization
26+
27+
_Returned Response:_
28+
29+
[CompleteUsageSchema](#completeusageschema)
30+
31+
Success
32+
33+
<details>
34+
<summary><i>&nbsp; Example:</i></summary>
35+
36+
```json
37+
{
38+
"credits": {
39+
"used": 1.0357297026862702
40+
},
41+
"total": {
42+
"credits": 1000,
43+
"storage": 1
44+
},
45+
"usage": {
46+
"storage": "0"
47+
}
48+
}
49+
```
50+
51+
</details>
52+
53+
---
54+
55+
### Schemas
56+
57+
#### NotFoundSchema
58+
59+
| Properties | Type | Nullable | Description |
60+
| ---------- | ------ | -------- | ----------- |
61+
| message | string | no | |
62+
63+
---
64+
65+
#### UsageSchema
66+
67+
| Properties | Type | Nullable | Description |
68+
| ---------- | ------ | -------- | ----------- |
69+
| storage | string | no | |
70+
71+
---
72+
73+
#### ConsumedCreditsSchema
74+
75+
| Properties | Type | Nullable | Description |
76+
| ---------- | ------ | -------- | ----------- |
77+
| used | number | no | |
78+
79+
---
80+
81+
#### TotalUsageSchema
82+
83+
| Properties | Type | Nullable | Description |
84+
| ---------- | ------ | -------- | ----------- |
85+
| credits | number | no | |
86+
| storage | number | no | |
87+
88+
---
89+
90+
#### CompleteUsageSchema
91+
92+
| Properties | Type | Nullable | Description |
93+
| ---------- | ----------------------------------------------- | -------- | ----------- |
94+
| credits | [ConsumedCreditsSchema](#consumedcreditsschema) | no | |
95+
| total | [TotalUsageSchema](#totalusageschema) | no | |
96+
| usage | [UsageSchema](#usageschema) | no | |
97+
98+
---

documentation/platform/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
- [Assets](ASSETS.md) - Asset Uploader Service
66
- [Organization](ORGANIZATION.md) - Organization Service
77
- [Transformation](TRANSFORMATION.md) - Image Transformation Service
8+
- [Billing](BILLING.md) - Payment Service

0 commit comments

Comments
 (0)