@reeboot/strapi-payment-plugin 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -9
- package/dist/_chunks/{App-DoUUpjp-.mjs → App-DD7GyuRr.mjs} +572 -297
- package/dist/_chunks/{App-BGle38NN.js → App-KZVBFRwo.js} +569 -294
- package/dist/admin/index.js +2 -2
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/pluginId.d.ts +1 -1
- package/dist/server/index.js +952 -6988
- package/dist/server/index.mjs +951 -6987
- package/dist/server/src/bootstrap.d.ts +11 -5
- package/dist/server/src/config/index.d.ts +2 -0
- package/dist/server/src/content-types/index.d.ts +123 -1
- package/dist/server/src/content-types/product.d.ts +63 -0
- package/dist/server/src/content-types/subscription.d.ts +60 -0
- package/dist/server/src/controllers/controller.d.ts +5 -1
- package/dist/server/src/controllers/index.d.ts +29 -29
- package/dist/server/src/controllers/product.d.ts +18 -0
- package/dist/server/src/controllers/subscription.d.ts +16 -0
- package/dist/server/src/controllers/webhook.d.ts +10 -0
- package/dist/server/src/index.d.ts +177 -65
- package/dist/server/src/routes/index.d.ts +4 -15
- package/dist/server/src/routes/product.d.ts +2 -0
- package/dist/server/src/routes/subscription.d.ts +5 -0
- package/dist/server/src/routes/{product-routes.d.ts → webhook.d.ts} +3 -1
- package/dist/server/src/services/index.d.ts +17 -16
- package/dist/server/src/services/paypalDriver.d.ts +44 -4
- package/dist/server/src/services/product.d.ts +7 -0
- package/dist/server/src/services/service.d.ts +7 -14
- package/dist/server/src/services/stripeDriver.d.ts +31 -0
- package/dist/server/src/services/subscription.d.ts +9 -0
- package/dist/server/src/services/sync.d.ts +13 -0
- package/package.json +4 -3
- package/dist/server/controllers/product.d.ts +0 -12
- package/dist/server/controllers/subscription.d.ts +0 -12
- package/dist/server/services/product.d.ts +0 -7
- package/dist/server/services/subscription.d.ts +0 -7
- package/dist/server/src/controllers/productController.d.ts +0 -9
- package/dist/server/src/controllers/subscriptionController.d.ts +0 -9
- package/dist/server/src/routes/subscription-routes.d.ts +0 -13
package/README.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Strapi v5 Payment Plugin (Stripe & PayPal)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
⚠️ Work in progress ⚠️
|
|
4
|
+
|
|
5
|
+
This plugin provides a unified interface for processing payments through Stripe and PayPal in
|
|
6
|
+
Strapi v5.
|
|
7
|
+
|
|
8
|
+
⚠️ Paypal SDK is currently not implemented ⚠️
|
|
9
|
+
|
|
10
|
+
⚠️ Stripe SDK is partially implemented ⚠️
|
|
4
11
|
|
|
5
12
|
## Features
|
|
6
13
|
|
|
@@ -9,6 +16,9 @@ This plugin provides a unified interface for processing payments through Stripe
|
|
|
9
16
|
- Refund processing
|
|
10
17
|
- Payment details retrieval
|
|
11
18
|
- Admin panel configuration interface
|
|
19
|
+
- Product management with Stripe synchronization
|
|
20
|
+
- Payment link generation for products
|
|
21
|
+
- Import products from Stripe
|
|
12
22
|
|
|
13
23
|
## Installation
|
|
14
24
|
|
|
@@ -49,8 +59,8 @@ This plugin provides a unified interface for processing payments through Stripe
|
|
|
49
59
|
### Initiate Payment
|
|
50
60
|
|
|
51
61
|
```javascript
|
|
52
|
-
// POST /payment-plugin/initiate-payment
|
|
53
|
-
const response = await fetch('/payment-plugin/initiate-payment', {
|
|
62
|
+
// POST /strapi-payment-plugin/initiate-payment
|
|
63
|
+
const response = await fetch('/strapi-payment-plugin/initiate-payment', {
|
|
54
64
|
method: 'POST',
|
|
55
65
|
headers: {
|
|
56
66
|
'Content-Type': 'application/json',
|
|
@@ -71,15 +81,15 @@ const payment = await response.json();
|
|
|
71
81
|
### Process Webhook
|
|
72
82
|
|
|
73
83
|
```javascript
|
|
74
|
-
// POST /payment-plugin/webhook/:gateway
|
|
84
|
+
// POST /strapi-payment-plugin/webhook/:gateway
|
|
75
85
|
// The webhook URL should be configured in your Stripe/PayPal dashboard
|
|
76
86
|
```
|
|
77
87
|
|
|
78
88
|
### Refund Payment
|
|
79
89
|
|
|
80
90
|
```javascript
|
|
81
|
-
// POST /payment-plugin/refund
|
|
82
|
-
const response = await fetch('/payment-plugin/refund', {
|
|
91
|
+
// POST /strapi-payment-plugin/refund
|
|
92
|
+
const response = await fetch('/strapi-payment-plugin/refund', {
|
|
83
93
|
method: 'POST',
|
|
84
94
|
headers: {
|
|
85
95
|
'Content-Type': 'application/json',
|
|
@@ -99,14 +109,77 @@ const refund = await response.json();
|
|
|
99
109
|
### Get Payment Details
|
|
100
110
|
|
|
101
111
|
```javascript
|
|
102
|
-
// GET /payment-plugin/payments/:id
|
|
103
|
-
const response = await fetch('/payment-plugin/payments/pi_123');
|
|
112
|
+
// GET /strapi-payment-plugin/payments/:id
|
|
113
|
+
const response = await fetch('/strapi-payment-plugin/payments/pi_123');
|
|
104
114
|
const paymentDetails = await response.json();
|
|
105
115
|
```
|
|
106
116
|
|
|
107
|
-
|
|
117
|
+
### Product Management
|
|
118
|
+
|
|
119
|
+
#### Create Product
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
// POST /strapi-payment-plugin/products
|
|
123
|
+
const response = await fetch('/strapi-payment-plugin/products', {
|
|
124
|
+
method: 'POST',
|
|
125
|
+
headers: {
|
|
126
|
+
'Content-Type': 'application/json',
|
|
127
|
+
},
|
|
128
|
+
body: JSON.stringify({
|
|
129
|
+
data: {
|
|
130
|
+
name: 'Product Name',
|
|
131
|
+
description: 'Product Description',
|
|
132
|
+
price: 100, // in dollars
|
|
133
|
+
currency: 'USD',
|
|
134
|
+
isSubscription: false,
|
|
135
|
+
},
|
|
136
|
+
}),
|
|
137
|
+
});
|
|
138
|
+
const product = await response.json();
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### Sync Product with Stripe
|
|
142
|
+
|
|
143
|
+
```javascript
|
|
144
|
+
// POST /strapi-payment-plugin/products/:id/sync
|
|
145
|
+
const response = await fetch('/strapi-payment-plugin/products/1/sync', {
|
|
146
|
+
method: 'POST',
|
|
147
|
+
});
|
|
148
|
+
const result = await response.json();
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Create Payment Link
|
|
152
|
+
|
|
153
|
+
```javascript
|
|
154
|
+
// POST /strapi-payment-plugin/products/:id/payment-link
|
|
155
|
+
const response = await fetch('/strapi-payment-plugin/products/1/payment-link', {
|
|
156
|
+
method: 'POST',
|
|
157
|
+
});
|
|
158
|
+
const result = await response.json();
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### Import Product from Stripe
|
|
162
|
+
|
|
163
|
+
```javascript
|
|
164
|
+
// POST /strapi-payment-plugin/products/import
|
|
165
|
+
const response = await fetch('/strapi-payment-plugin/products/import', {
|
|
166
|
+
method: 'POST',
|
|
167
|
+
headers: {
|
|
168
|
+
'Content-Type': 'application/json',
|
|
169
|
+
},
|
|
170
|
+
body: JSON.stringify({
|
|
171
|
+
stripeProductId: 'prod_123',
|
|
172
|
+
}),
|
|
173
|
+
});
|
|
174
|
+
const result = await response.json();
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Development (coming soon)
|
|
108
178
|
|
|
109
179
|
1. Clone the repository
|
|
110
180
|
2. Install dependencies: `npm install`
|
|
111
181
|
3. Build the plugin: `npm run build`
|
|
112
182
|
4. Link the plugin to your Strapi project: `npm link`
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
Author : Reeboot <contact@reeboot.fr>
|