strapi-plugin-payone-provider 1.1.1 → 1.1.3
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 +74 -23
- package/admin/src/pages/App/components/TransactionHistoryItem.js +374 -374
- package/admin/src/pages/App/components/icons/BankIcon.js +10 -10
- package/admin/src/pages/App/components/icons/ChevronDownIcon.js +9 -9
- package/admin/src/pages/App/components/icons/ChevronUpIcon.js +9 -9
- package/admin/src/pages/App/components/icons/CreditCardIcon.js +9 -9
- package/admin/src/pages/App/components/icons/ErrorIcon.js +10 -10
- package/admin/src/pages/App/components/icons/InfoIcon.js +9 -9
- package/admin/src/pages/App/components/icons/PaymentIcon.js +10 -10
- package/admin/src/pages/App/components/icons/PendingIcon.js +9 -9
- package/admin/src/pages/App/components/icons/PersonIcon.js +9 -9
- package/admin/src/pages/App/components/icons/SuccessIcon.js +9 -9
- package/admin/src/pages/App/components/icons/WalletIcon.js +9 -9
- package/admin/src/pages/App/components/icons/index.js +11 -11
- package/admin/src/pages/utils/formatTransactionData.js +15 -15
- package/admin/src/pluginId.js +5 -1
- package/package.json +1 -1
- package/server/bootstrap.js +1 -1
- package/server/controllers/payone.js +9 -9
- package/server/policies/is-auth.js +1 -1
- package/server/routes/index.js +5 -5
- package/server/services/payone.js +4 -4
package/README.md
CHANGED
|
@@ -57,26 +57,53 @@ You will need the following credentials from your Payone account:
|
|
|
57
57
|
|
|
58
58
|
## 📦 Installation
|
|
59
59
|
|
|
60
|
-
### Option 1: Install from npm
|
|
60
|
+
### Option 1: Install from npm
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
|
|
63
|
+
# Using npm
|
|
64
|
+
npm install strapi-plugin-payone-provider
|
|
65
|
+
|
|
66
|
+
# Using yarn
|
|
67
|
+
yarn add strapi-plugin-payone-provider
|
|
68
|
+
|
|
69
|
+
# Using pnpm
|
|
70
|
+
pnpm add strapi-plugin-payone-provider
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Option 2: Install from Git
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Using npm
|
|
77
|
+
npm install git+https://github.com/your-repo/strapi-plugin-payone-provider.git
|
|
78
|
+
|
|
79
|
+
# Using yarn
|
|
80
|
+
yarn add git+https://github.com/your-repo/strapi-plugin-payone-provider.git
|
|
81
|
+
|
|
82
|
+
# Using pnpm
|
|
83
|
+
pnpm add git+https://github.com/your-repo/strapi-plugin-payone-provider.git
|
|
64
84
|
```
|
|
65
85
|
|
|
66
|
-
### Option
|
|
86
|
+
### Option 3: Manual Installation (Local Development)
|
|
67
87
|
|
|
68
|
-
1.
|
|
88
|
+
1. Clone or copy the plugin folder to your Strapi project's `src/plugins/` directory:
|
|
69
89
|
|
|
70
90
|
```bash
|
|
71
91
|
# From your Strapi project root
|
|
72
92
|
mkdir -p src/plugins
|
|
73
|
-
cp -r /path/to/payone
|
|
93
|
+
cp -r /path/to/strapi-plugin-payone src/plugins/
|
|
74
94
|
```
|
|
75
95
|
|
|
76
96
|
2. Install the plugin dependencies:
|
|
77
97
|
|
|
78
98
|
```bash
|
|
99
|
+
# Using npm
|
|
79
100
|
npm install
|
|
101
|
+
|
|
102
|
+
# Using yarn
|
|
103
|
+
yarn install
|
|
104
|
+
|
|
105
|
+
# Using pnpm
|
|
106
|
+
pnpm install
|
|
80
107
|
```
|
|
81
108
|
|
|
82
109
|
3. Enable the plugin by adding it to your `config/plugins.js` (or `config/plugins.ts`):
|
|
@@ -84,9 +111,9 @@ npm install
|
|
|
84
111
|
```javascript
|
|
85
112
|
module.exports = {
|
|
86
113
|
// ... other plugins
|
|
87
|
-
'payone-provider': {
|
|
114
|
+
'strapi-plugin-payone-provider': {
|
|
88
115
|
enabled: true,
|
|
89
|
-
resolve: './src/plugins/payone
|
|
116
|
+
resolve: './src/plugins/strapi-plugin-payone',
|
|
90
117
|
},
|
|
91
118
|
};
|
|
92
119
|
```
|
|
@@ -94,13 +121,27 @@ module.exports = {
|
|
|
94
121
|
4. Rebuild your Strapi admin panel:
|
|
95
122
|
|
|
96
123
|
```bash
|
|
124
|
+
# Using npm
|
|
97
125
|
npm run build
|
|
126
|
+
|
|
127
|
+
# Using yarn
|
|
128
|
+
yarn build
|
|
129
|
+
|
|
130
|
+
# Using pnpm
|
|
131
|
+
pnpm build
|
|
98
132
|
```
|
|
99
133
|
|
|
100
134
|
5. Restart your Strapi application:
|
|
101
135
|
|
|
102
136
|
```bash
|
|
137
|
+
# Using npm
|
|
103
138
|
npm run develop
|
|
139
|
+
|
|
140
|
+
# Using yarn
|
|
141
|
+
yarn develop
|
|
142
|
+
|
|
143
|
+
# Using pnpm
|
|
144
|
+
pnpm develop
|
|
104
145
|
```
|
|
105
146
|
|
|
106
147
|
## ⚙️ Configuration
|
|
@@ -128,9 +169,9 @@ You can also configure the plugin programmatically by adding settings to your `c
|
|
|
128
169
|
|
|
129
170
|
```javascript
|
|
130
171
|
module.exports = {
|
|
131
|
-
'payone-provider': {
|
|
172
|
+
'strapi-plugin-payone-provider': {
|
|
132
173
|
enabled: true,
|
|
133
|
-
resolve: './src/plugins/payone
|
|
174
|
+
resolve: './src/plugins/strapi-plugin-payone',
|
|
134
175
|
config: {
|
|
135
176
|
settings: {
|
|
136
177
|
aid: 'YOUR_ACCOUNT_ID',
|
|
@@ -149,8 +190,9 @@ module.exports = {
|
|
|
149
190
|
|
|
150
191
|
```javascript
|
|
151
192
|
module.exports = {
|
|
152
|
-
'payone-provider': {
|
|
193
|
+
'strapi-plugin-payone-provider': {
|
|
153
194
|
enabled: true,
|
|
195
|
+
resolve: './src/plugins/strapi-plugin-payone',
|
|
154
196
|
config: {
|
|
155
197
|
settings: {
|
|
156
198
|
aid: process.env.PAYONE_AID,
|
|
@@ -225,9 +267,9 @@ The plugin provides REST API endpoints for programmatic access:
|
|
|
225
267
|
|
|
226
268
|
All content API endpoints require authentication via the `isAuth` policy. These are meant for your frontend application.
|
|
227
269
|
|
|
228
|
-
Base URL: `/api/payone-provider`
|
|
270
|
+
Base URL: `/api/strapi-plugin-payone-provider`
|
|
229
271
|
|
|
230
|
-
##### POST `/api/payone-provider/preauthorization`
|
|
272
|
+
##### POST `/api/strapi-plugin-payone-provider/preauthorization`
|
|
231
273
|
|
|
232
274
|
Reserve funds on a customer's card without immediate charge.
|
|
233
275
|
|
|
@@ -265,7 +307,7 @@ Reserve funds on a customer's card without immediate charge.
|
|
|
265
307
|
}
|
|
266
308
|
```
|
|
267
309
|
|
|
268
|
-
##### POST `/api/payone-provider/authorization`
|
|
310
|
+
##### POST `/api/strapi-plugin-payone-provider/authorization`
|
|
269
311
|
|
|
270
312
|
Immediately charge a customer's card.
|
|
271
313
|
|
|
@@ -273,7 +315,7 @@ Immediately charge a customer's card.
|
|
|
273
315
|
|
|
274
316
|
> Note: For redirect-based methods (PayPal, Online Banking) you must provide `successurl`, `errorurl`, and `backurl`. The plugin will auto-fill safe defaults when missing, using `settings.return_base` or `PAYONE_RETURN_BASE`/`FRONTEND_URL`/`NEXT_PUBLIC_SITE_URL`.
|
|
275
317
|
|
|
276
|
-
##### POST `/api/payone-provider/capture`
|
|
318
|
+
##### POST `/api/strapi-plugin-payone-provider/capture`
|
|
277
319
|
|
|
278
320
|
Complete a preauthorized transaction and capture the funds.
|
|
279
321
|
|
|
@@ -287,7 +329,7 @@ Complete a preauthorized transaction and capture the funds.
|
|
|
287
329
|
}
|
|
288
330
|
```
|
|
289
331
|
|
|
290
|
-
##### POST `/api/payone-provider/refund`
|
|
332
|
+
##### POST `/api/strapi-plugin-payone-provider/refund`
|
|
291
333
|
|
|
292
334
|
Refund a captured transaction.
|
|
293
335
|
|
|
@@ -305,12 +347,12 @@ Refund a captured transaction.
|
|
|
305
347
|
|
|
306
348
|
#### Admin API Endpoints
|
|
307
349
|
|
|
308
|
-
These endpoints require admin authentication and are available at `/payone-provider/`.
|
|
350
|
+
These endpoints require admin authentication and are available at `/strapi-plugin-payone-provider/`.
|
|
309
351
|
|
|
310
|
-
- `GET /payone-provider/settings` - Get current settings
|
|
311
|
-
- `PUT /payone-provider/settings` - Update settings
|
|
312
|
-
- `GET /payone-provider/transaction-history` - Get transaction history
|
|
313
|
-
- `POST /payone-provider/test-connection` - Test Payone connection
|
|
352
|
+
- `GET /strapi-plugin-payone-provider/settings` - Get current settings
|
|
353
|
+
- `PUT /strapi-plugin-payone-provider/settings` - Update settings
|
|
354
|
+
- `GET /strapi-plugin-payone-provider/transaction-history` - Get transaction history
|
|
355
|
+
- `POST /strapi-plugin-payone-provider/test-connection` - Test Payone connection
|
|
314
356
|
- All payment operation endpoints (same as content API)
|
|
315
357
|
|
|
316
358
|
### JavaScript/TypeScript Usage Example
|
|
@@ -323,7 +365,7 @@ const processPayment = async (orderData) => {
|
|
|
323
365
|
try {
|
|
324
366
|
// Step 1: Preauthorize the payment
|
|
325
367
|
const preauth = await axios.post(
|
|
326
|
-
'http://localhost:1337/api/payone-provider/preauthorization',
|
|
368
|
+
'http://localhost:1337/api/strapi-plugin-payone-provider/preauthorization',
|
|
327
369
|
{
|
|
328
370
|
amount: orderData.amount, // in cents, e.g., 1000 = 10.00 EUR
|
|
329
371
|
currency: 'EUR',
|
|
@@ -353,7 +395,7 @@ const processPayment = async (orderData) => {
|
|
|
353
395
|
|
|
354
396
|
// Step 2: Capture the preauthorized amount
|
|
355
397
|
const capture = await axios.post(
|
|
356
|
-
'http://localhost:1337/api/payone-provider/capture',
|
|
398
|
+
'http://localhost:1337/api/strapi-plugin-payone-provider/capture',
|
|
357
399
|
{
|
|
358
400
|
txid: txid,
|
|
359
401
|
amount: orderData.amount,
|
|
@@ -560,8 +602,17 @@ If you encounter issues or need help:
|
|
|
560
602
|
To update the plugin:
|
|
561
603
|
|
|
562
604
|
```bash
|
|
563
|
-
|
|
605
|
+
# Using npm
|
|
606
|
+
npm update strapi-plugin-payone-provider
|
|
564
607
|
npm run build
|
|
608
|
+
|
|
609
|
+
# Using yarn
|
|
610
|
+
yarn upgrade strapi-plugin-payone-provider
|
|
611
|
+
yarn build
|
|
612
|
+
|
|
613
|
+
# Using pnpm
|
|
614
|
+
pnpm update strapi-plugin-payone-provider
|
|
615
|
+
pnpm build
|
|
565
616
|
```
|
|
566
617
|
|
|
567
618
|
Then restart your Strapi application.
|