-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial stripe subscription payment integration
- Loading branch information
Showing
10 changed files
with
289 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,9 @@ | |
- [🏦 Plans](#-plans) | ||
- [🛒 Get Available Plans](#-get-plans) | ||
- [🛍️ Get Plan Info](#-get-plan-info) | ||
- [Subscriptions](#-subscriptions) | ||
- [] | ||
- [] | ||
|
||
</details> | ||
|
||
|
@@ -324,8 +327,7 @@ This endpoint only returns the addresses of the organizations where the current | |
"subscription":{ | ||
"PlanID":3, | ||
"StartDate":"2024-11-07T15:25:49.218Z", | ||
"EndDate":"0001-01-01T00:00:00Z", | ||
"RenewalDate":"0001-01-01T00:00:00Z", | ||
"RenewalDate":"2025-11-07T15:25:49.218Z", | ||
"Active":true, | ||
"MaxCensusSize":10 | ||
}, | ||
|
@@ -911,8 +913,62 @@ This request can be made only by organization admins. | |
|
||
* **Errors** | ||
|
||
| HTTP Status | Error code | Message | | ||
|:---:|:---:|:---| | ||
| `400` | `40004` | `malformed JSON body` | | ||
| `404` | `40009` | `plan not found` | | ||
| `500` | `50001` | `internal server error` | | ||
|
||
|
||
## Subscriptions | ||
|
||
### 🛒 Create Checkout session | ||
|
||
* **Path** `/subscriptions/checkout/` | ||
* **Method** `POST` | ||
* **Request Body** | ||
```json | ||
{ | ||
"lookupKey": 1, // PLan's corresponging DB ID | ||
"returnURL": "https://example.com/return", | ||
"address": "[email protected]", | ||
"amount": 1000, // The desired maxCensusSize | ||
} | ||
``` | ||
|
||
* **Response** | ||
```json | ||
{ | ||
"id": "cs_test_a1b2c3d4e5f6g7h8i9j0", | ||
// ... rest of stripe session attributes | ||
} | ||
``` | ||
|
||
* **Errors** | ||
|
||
| HTTP Status | Error code | Message | | ||
|:---:|:---:|:---| | ||
| `400` | `40010` | `malformed URL parameter` | | ||
| `400` | `40023` | `plan not found` | | ||
| `500` | `50002` | `internal server error` | | ||
|
||
### 🛍️ Get Checkout session info | ||
|
||
* **Path** `/subscriptions/checkout/{sessionID}` | ||
* **Method** `GET` | ||
* **Response** | ||
```json | ||
{ | ||
"status": "complete", // session status | ||
"customer_email": "[email protected]", | ||
"subscription_status": "active" | ||
} | ||
``` | ||
|
||
* **Errors** | ||
|
||
| HTTP Status | Error code | Message | | ||
|:---:|:---:|:---| | ||
| `400` | `40010` | `malformed URL parameter` | | ||
| `400` | `40023` | `session not found` | | ||
| `500` | `50002` | `internal server error` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.