strapi-plugin-payone-provider 1.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.
Files changed (42) hide show
  1. package/README.md +571 -0
  2. package/admin/src/components/Initializer/index.js +16 -0
  3. package/admin/src/components/PluginIcon/index.js +6 -0
  4. package/admin/src/index.js +37 -0
  5. package/admin/src/pages/App/components/ConfigurationPanel.js +265 -0
  6. package/admin/src/pages/App/components/HistoryPanel.js +298 -0
  7. package/admin/src/pages/App/components/PaymentActionsPanel.js +333 -0
  8. package/admin/src/pages/App/components/StatusBadge.js +22 -0
  9. package/admin/src/pages/App/components/TransactionHistoryItem.js +374 -0
  10. package/admin/src/pages/App/components/icons/BankIcon.js +10 -0
  11. package/admin/src/pages/App/components/icons/ChevronDownIcon.js +9 -0
  12. package/admin/src/pages/App/components/icons/ChevronUpIcon.js +9 -0
  13. package/admin/src/pages/App/components/icons/CreditCardIcon.js +9 -0
  14. package/admin/src/pages/App/components/icons/ErrorIcon.js +10 -0
  15. package/admin/src/pages/App/components/icons/InfoIcon.js +9 -0
  16. package/admin/src/pages/App/components/icons/PaymentIcon.js +10 -0
  17. package/admin/src/pages/App/components/icons/PendingIcon.js +9 -0
  18. package/admin/src/pages/App/components/icons/PersonIcon.js +9 -0
  19. package/admin/src/pages/App/components/icons/SuccessIcon.js +9 -0
  20. package/admin/src/pages/App/components/icons/WalletIcon.js +9 -0
  21. package/admin/src/pages/App/components/icons/index.js +11 -0
  22. package/admin/src/pages/App/index.js +483 -0
  23. package/admin/src/pages/utils/api.js +75 -0
  24. package/admin/src/pages/utils/formatTransactionData.js +16 -0
  25. package/admin/src/pages/utils/paymentUtils.js +528 -0
  26. package/admin/src/pluginId.js +5 -0
  27. package/package.json +43 -0
  28. package/server/bootstrap.js +26 -0
  29. package/server/config/index.js +42 -0
  30. package/server/controllers/index.js +7 -0
  31. package/server/controllers/payone.js +134 -0
  32. package/server/destroy.js +5 -0
  33. package/server/index.js +21 -0
  34. package/server/policies/index.js +6 -0
  35. package/server/policies/isAuth.js +23 -0
  36. package/server/policies/isSuperAdmin.js +18 -0
  37. package/server/register.js +5 -0
  38. package/server/routes/index.js +124 -0
  39. package/server/services/index.js +7 -0
  40. package/server/services/payone.js +679 -0
  41. package/strapi-admin.js +3 -0
  42. package/strapi-server.js +3 -0
package/README.md ADDED
@@ -0,0 +1,571 @@
1
+ # Payone Provider Plugin for Strapi
2
+
3
+ A comprehensive Strapi plugin that integrates the Payone payment gateway into your Strapi application. This plugin provides both backend API integration and an admin panel interface for managing payment transactions.
4
+
5
+ ## 📋 Table of Contents
6
+
7
+ - [Features](#features)
8
+ - [Requirements](#requirements)
9
+ - [Installation](#installation)
10
+ - [Configuration](#configuration)
11
+ - [Getting Started](#getting-started)
12
+ - [Usage](#usage)
13
+ - [Admin Panel](#admin-panel)
14
+ - [API Endpoints](#api-endpoints)
15
+ - [Supported Payment Methods](#supported-payment-methods)
16
+ - [Payment Operations](#payment-operations)
17
+ - [Transaction History](#transaction-history)
18
+ - [Troubleshooting](#troubleshooting)
19
+ - [License](#license)
20
+
21
+ ## ✨ Features
22
+
23
+ - **Payone API Integration**: Full integration with Payone's Server API (v3.10)
24
+ - **Payment Operations**:
25
+ - Preauthorization (reserve funds)
26
+ - Authorization (immediate charge)
27
+ - Capture (complete preauthorized transactions) — currently Credit Card only
28
+ - Refund (return funds to customers) — currently Credit Card only
29
+ - **Admin Panel**:
30
+ - Easy configuration interface
31
+ - Transaction history viewer with filtering
32
+ - Payment testing tools
33
+ - Connection testing
34
+ - **Transaction Logging**: Automatic logging of all payment operations
35
+ - **Security**: Secure credential storage with masked API keys
36
+ - **Test & Live Modes**: Support for both test and production environments
37
+
38
+ ## 🔧 Requirements
39
+
40
+ Before installing this plugin, ensure you have:
41
+
42
+ - **Strapi**: Version 4.6.0 or higher
43
+ - **Node.js**: Version 18.0.0 to 20.x.x
44
+ - **npm**: Version 6.0.0 or higher
45
+ - **Payone Account**: Active Payone merchant account with API credentials
46
+
47
+ ### Payone Credentials
48
+
49
+ You will need the following credentials from your Payone account:
50
+
51
+ 1. **AID (Account ID)**: Your Payone sub-account identifier
52
+ 2. **Portal ID**: Your Payone portal identifier
53
+ 3. **Merchant ID (MID)**: Your merchant identifier
54
+ 4. **Portal Key**: Your API authentication key (also called "Portal Key" or "Security Key")
55
+
56
+ > â„šī¸ **How to get Payone credentials**: Log into your Payone Merchant Interface (PMI) and navigate to Configuration → Payment Portals → [Your Portal] → Advanced Tab to find these credentials.
57
+
58
+ ## đŸ“Ļ Installation
59
+
60
+ ### Option 1: Install from npm (if published)
61
+
62
+ ```bash
63
+ npm install payone-provider
64
+ ```
65
+
66
+ ### Option 2: Manual Installation
67
+
68
+ 1. Copy the `payone-provider` folder to your Strapi project's `src/plugins/` directory:
69
+
70
+ ```bash
71
+ # From your Strapi project root
72
+ mkdir -p src/plugins
73
+ cp -r /path/to/payone-provider src/plugins/
74
+ ```
75
+
76
+ 2. Install the plugin dependencies:
77
+
78
+ ```bash
79
+ npm install
80
+ ```
81
+
82
+ 3. Enable the plugin by adding it to your `config/plugins.js` (or `config/plugins.ts`):
83
+
84
+ ```javascript
85
+ module.exports = {
86
+ // ... other plugins
87
+ 'payone-provider': {
88
+ enabled: true,
89
+ resolve: './src/plugins/payone-provider',
90
+ },
91
+ };
92
+ ```
93
+
94
+ 4. Rebuild your Strapi admin panel:
95
+
96
+ ```bash
97
+ npm run build
98
+ ```
99
+
100
+ 5. Restart your Strapi application:
101
+
102
+ ```bash
103
+ npm run develop
104
+ ```
105
+
106
+ ## âš™ī¸ Configuration
107
+
108
+ After installation, you need to configure your Payone credentials:
109
+
110
+ ### Using the Admin Panel (Recommended)
111
+
112
+ 1. Log into your Strapi admin panel
113
+ 2. Navigate to **Payone Provider** in the sidebar menu
114
+ 3. Go to the **Configuration** tab
115
+ 4. Fill in your Payone credentials:
116
+ - **Account ID (AID)**: Your Payone account ID
117
+ - **Portal ID**: Your Payone portal ID
118
+ - **Merchant ID (MID)**: Your merchant ID
119
+ - **Portal Key**: Your API security key
120
+ - **Mode**: Select `test` for testing or `live` for production
121
+ - **API Version**: Leave as `3.10` (default)
122
+ 5. Click **"Test Connection"** to verify your credentials
123
+ 6. Click **"Save Configuration"** to store your settings
124
+
125
+ ### Manual Configuration (Alternative)
126
+
127
+ You can also configure the plugin programmatically by adding settings to your `config/plugins.js`:
128
+
129
+ ```javascript
130
+ module.exports = {
131
+ 'payone-provider': {
132
+ enabled: true,
133
+ resolve: './src/plugins/payone-provider',
134
+ config: {
135
+ settings: {
136
+ aid: 'YOUR_ACCOUNT_ID',
137
+ portalid: 'YOUR_PORTAL_ID',
138
+ mid: 'YOUR_MERCHANT_ID',
139
+ key: 'YOUR_PORTAL_KEY',
140
+ mode: 'test', // or 'live'
141
+ api_version: '3.10',
142
+ },
143
+ },
144
+ },
145
+ };
146
+ ```
147
+
148
+ > âš ī¸ **Security Warning**: Never commit your production credentials to version control. Use environment variables instead:
149
+
150
+ ```javascript
151
+ module.exports = {
152
+ 'payone-provider': {
153
+ enabled: true,
154
+ config: {
155
+ settings: {
156
+ aid: process.env.PAYONE_AID,
157
+ portalid: process.env.PAYONE_PORTAL_ID,
158
+ mid: process.env.PAYONE_MID,
159
+ key: process.env.PAYONE_KEY,
160
+ mode: process.env.PAYONE_MODE || 'test',
161
+ api_version: '3.10',
162
+ },
163
+ },
164
+ },
165
+ };
166
+ ```
167
+
168
+ ## 🚀 Getting Started
169
+
170
+ ### 1. Test Your Connection
171
+
172
+ After configuring your credentials:
173
+
174
+ 1. Open the **Configuration** tab in the Payone Provider admin panel
175
+ 2. Click the **"Test Connection"** button
176
+ 3. If successful, you'll see a green success message
177
+ 4. If it fails, check your credentials and try again
178
+
179
+ ### 2. Try a Test Payment
180
+
181
+ 1. Go to the **Payment Actions** tab
182
+ 2. Try a **Preauthorization** operation (currently test UI supports Credit Card only):
183
+ - Amount: 1000 (equals 10.00 EUR in cents)
184
+ - Reference: Leave empty for auto-generation
185
+ - Click **"Execute Preauthorization"**
186
+ 3. Check the **Transaction History** tab to see the logged transaction
187
+
188
+ ### 3. Review Transaction History
189
+
190
+ 1. Navigate to the **Transaction History** tab
191
+ 2. View all payment operations
192
+ 3. Use filters to search for specific transactions
193
+ 4. Click on any transaction to view full details
194
+
195
+ ## 📖 Usage
196
+
197
+ ### Admin Panel
198
+
199
+ The plugin adds a new menu item **"Payone Provider"** to your Strapi admin panel with three tabs:
200
+
201
+ #### 1. Configuration Tab
202
+
203
+ - Configure Payone API credentials
204
+ - Test connection to Payone servers
205
+ - Switch between test and live modes
206
+
207
+ #### 2. Transaction History Tab
208
+
209
+ - View all payment transactions
210
+ - Filter by status, type, transaction ID, reference, or date range
211
+ - View detailed request/response data for each transaction
212
+ - Pagination support for large transaction lists
213
+
214
+ #### 3. Payment Actions Tab
215
+
216
+ - Test payment operations without writing code
217
+ - Execute preauthorizations, authorizations, captures, and refunds
218
+ - View real-time results and error messages
219
+
220
+ ### API Endpoints
221
+
222
+ The plugin provides REST API endpoints for programmatic access:
223
+
224
+ #### Content API Endpoints (Public with Auth Policy)
225
+
226
+ All content API endpoints require authentication via the `isAuth` policy. These are meant for your frontend application.
227
+
228
+ Base URL: `/api/payone-provider`
229
+
230
+ ##### POST `/api/payone-provider/preauthorization`
231
+
232
+ Reserve funds on a customer's card without immediate charge.
233
+
234
+ **Request Body:**
235
+
236
+ ```json
237
+ {
238
+ "amount": 1000,
239
+ "currency": "EUR",
240
+ "reference": "ORDER-12345",
241
+ "clearingtype": "cc",
242
+ "cardtype": "V",
243
+ "cardpan": "4111111111111111",
244
+ "cardexpiredate": "2512",
245
+ "cardcvc2": "123",
246
+ "firstname": "John",
247
+ "lastname": "Doe",
248
+ "street": "Main Street 123",
249
+ "zip": "12345",
250
+ "city": "Berlin",
251
+ "country": "DE",
252
+ "email": "john.doe@example.com"
253
+ }
254
+ ```
255
+
256
+ **Response:**
257
+
258
+ ```json
259
+ {
260
+ "data": {
261
+ "status": "APPROVED",
262
+ "txid": "123456789",
263
+ "userid": "987654321"
264
+ }
265
+ }
266
+ ```
267
+
268
+ ##### POST `/api/payone-provider/authorization`
269
+
270
+ Immediately charge a customer's card.
271
+
272
+ **Request Body:** (Same as preauthorization)
273
+
274
+ > 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
+
276
+ ##### POST `/api/payone-provider/capture`
277
+
278
+ Complete a preauthorized transaction and capture the funds.
279
+
280
+ **Request Body:**
281
+
282
+ ```json
283
+ {
284
+ "txid": "123456789",
285
+ "amount": 1000,
286
+ "currency": "EUR"
287
+ }
288
+ ```
289
+
290
+ ##### POST `/api/payone-provider/refund`
291
+
292
+ Refund a captured transaction.
293
+
294
+ **Request Body:**
295
+
296
+ ```json
297
+ {
298
+ "txid": "123456789",
299
+ "amount": -1000,
300
+ "currency": "EUR",
301
+ "reference": "REFUND-12345",
302
+ "sequencenumber": 2
303
+ }
304
+ ```
305
+
306
+ #### Admin API Endpoints
307
+
308
+ These endpoints require admin authentication and are available at `/payone-provider/`.
309
+
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
314
+ - All payment operation endpoints (same as content API)
315
+
316
+ ### JavaScript/TypeScript Usage Example
317
+
318
+ ```javascript
319
+ // In your frontend application
320
+ import axios from 'axios';
321
+
322
+ const processPayment = async (orderData) => {
323
+ try {
324
+ // Step 1: Preauthorize the payment
325
+ const preauth = await axios.post(
326
+ 'http://localhost:1337/api/payone-provider/preauthorization',
327
+ {
328
+ amount: orderData.amount, // in cents, e.g., 1000 = 10.00 EUR
329
+ currency: 'EUR',
330
+ reference: orderData.orderId,
331
+ clearingtype: 'cc',
332
+ cardtype: 'V', // Visa
333
+ cardpan: orderData.cardNumber,
334
+ cardexpiredate: orderData.cardExpiry, // YYMM format
335
+ cardcvc2: orderData.cardCvc,
336
+ firstname: orderData.firstName,
337
+ lastname: orderData.lastName,
338
+ street: orderData.street,
339
+ zip: orderData.zip,
340
+ city: orderData.city,
341
+ country: orderData.country,
342
+ email: orderData.email,
343
+ },
344
+ {
345
+ headers: {
346
+ Authorization: `Bearer ${yourAuthToken}`,
347
+ },
348
+ }
349
+ );
350
+
351
+ if (preauth.data.data.status === 'APPROVED') {
352
+ const txid = preauth.data.data.txid;
353
+
354
+ // Step 2: Capture the preauthorized amount
355
+ const capture = await axios.post(
356
+ 'http://localhost:1337/api/payone-provider/capture',
357
+ {
358
+ txid: txid,
359
+ amount: orderData.amount,
360
+ currency: 'EUR',
361
+ },
362
+ {
363
+ headers: {
364
+ Authorization: `Bearer ${yourAuthToken}`,
365
+ },
366
+ }
367
+ );
368
+
369
+ return {
370
+ success: true,
371
+ transactionId: txid,
372
+ };
373
+ }
374
+ } catch (error) {
375
+ console.error('Payment failed:', error);
376
+ return {
377
+ success: false,
378
+ error: error.message,
379
+ };
380
+ }
381
+ };
382
+ ```
383
+
384
+ ## đŸ’ŗ Payment Operations
385
+
386
+ ## ✅ Supported Payment Methods
387
+
388
+ The plugin supports the following Payone clearing types. Required fields are listed per method. All methods also require the common customer and address fields shown below.
389
+
390
+ Common required fields (all methods):
391
+
392
+ - `amount` (in cents), `currency`, `reference` (max 20 chars; auto-normalized)
393
+ - `firstname`, `lastname`, `email`, `telephonenumber`
394
+ - `street`, `zip`, `city`, `country`
395
+
396
+ Credit Card (`clearingtype = cc`):
397
+
398
+ - Required: `cardtype` (V/M/A...), `cardpan`, `cardexpiredate` (MMyy), `cardcvc2`
399
+ - Operations: preauthorization, authorization, capture, refund
400
+ - Test payment in Admin currently supported for Credit Card only
401
+
402
+ PayPal Wallet (`clearingtype = wlt`, `wallettype = PPE`):
403
+
404
+ - Required: `successurl`, `errorurl`, `backurl` (redirect URLs)
405
+ - Recommended shipping fields: `shipping_firstname`, `shipping_lastname`, `shipping_street`, `shipping_zip`, `shipping_city`, `shipping_country`
406
+ - Operations: preauthorization, authorization (capture/refund roadmap)
407
+
408
+ SEPA Direct Debit (`clearingtype = elv`):
409
+
410
+ - Required: `iban`, `bic`, `bankaccountholder`, `bankcountry`
411
+ - Operations: preauthorization, authorization (capture/refund roadmap)
412
+
413
+ Online Banking/PNT (`clearingtype = sb`):
414
+
415
+ - Required: `onlinebanktransfertype` (e.g. `PNT`), `bankcountry`, redirect URLs (`successurl`, `errorurl`, `backurl`)
416
+ - Operations: authorization (capture/refund roadmap)
417
+
418
+ Notes:
419
+
420
+ - The plugin normalizes `reference` server-side to comply with Payone (alphanumeric only, max 20 chars, auto-generated fallback).
421
+ - For redirect flows, the plugin auto-fills redirect URLs when missing using a base URL from settings or environment.
422
+
423
+ ### Preauthorization vs Authorization
424
+
425
+ - **Preauthorization**: Reserves funds on the customer's card but doesn't charge it immediately. Use this when you need to verify funds availability before fulfilling an order (e.g., hotel bookings, rentals). You must later call "Capture" to actually charge the card.
426
+
427
+ - **Authorization**: Immediately charges the customer's card. Use this for instant payments (e.g., e-commerce purchases).
428
+
429
+ ### Capture
430
+
431
+ After a successful preauthorization, you must capture the transaction to receive the funds. Captures can be:
432
+
433
+ - **Full capture**: Capture the entire preauthorized amount
434
+ - **Partial capture**: Capture less than the preauthorized amount
435
+
436
+ ### Refund
437
+
438
+ Refunds return money to the customer. Important notes:
439
+
440
+ - Amount must be negative (e.g., -1000 for 10.00 EUR)
441
+ - Requires a valid transaction ID (txid)
442
+ - Requires a sequence number (start with 2, increment for each additional refund on same transaction)
443
+
444
+ > Current limitation: Capture and Refund are implemented for Credit Card only. Support for PayPal/SEPA/Online Banking will be added in future updates.
445
+
446
+ ## 📊 Transaction History
447
+
448
+ All payment operations are automatically logged to the transaction history. Each entry includes:
449
+
450
+ - **Transaction ID (txid)**: Payone's unique transaction identifier
451
+ - **Reference**: Your custom order/payment reference
452
+ - **Type**: Operation type (authorization, preauthorization, capture, refund)
453
+ - **Amount**: Transaction amount in cents
454
+ - **Currency**: Currency code (EUR, USD, etc.)
455
+ - **Status**: APPROVED, ERROR, REDIRECT, etc.
456
+ - **Timestamp**: When the transaction occurred
457
+ - **Raw Request/Response**: Complete API request and response data for debugging
458
+
459
+ ### Filtering Transactions
460
+
461
+ Use the filters in the Transaction History tab to find specific transactions:
462
+
463
+ - **Status**: Filter by APPROVED, ERROR, etc.
464
+ - **Type**: Filter by operation type
465
+ - **Transaction ID**: Search by specific txid
466
+ - **Reference**: Search by your order reference
467
+ - **Date Range**: Filter by date
468
+
469
+ ## 🔍 Troubleshooting
470
+
471
+ ### Connection Test Fails
472
+
473
+ **Problem**: "Authentication failed" or "Invalid credentials"
474
+
475
+ **Solutions**:
476
+
477
+ 1. Verify your AID, Portal ID, Merchant ID, and Portal Key are correct
478
+ 2. Ensure you're using the correct mode (test/live)
479
+ 3. Check that your Payone account is active and not suspended
480
+ 4. Verify the Portal Key is the MD5 hash key from your Payone PMI
481
+
482
+ ### Payment Gets Rejected
483
+
484
+ **Problem**: Transactions return ERROR status
485
+
486
+ **Common Causes**:
487
+
488
+ 1. **Invalid card data**: Check card number, expiry date, and CVC
489
+ 2. **Insufficient funds**: Test cards may have limits
490
+ 3. **Duplicate reference**: Each transaction needs a unique reference
491
+ 4. **Missing required fields**: Ensure all required customer data is provided
492
+ 5. **Test mode restrictions**: Some features may be limited in test mode
493
+
494
+ **Debug Steps**:
495
+
496
+ 1. Check the Transaction History for error codes and messages
497
+ 2. Review the raw response data for detailed error information
498
+ 3. Consult the Payone API documentation for error code meanings
499
+ 4. Check your Strapi server logs for detailed error traces
500
+
501
+ ### Plugin Not Appearing in Admin
502
+
503
+ **Problem**: Payone Provider menu item doesn't appear
504
+
505
+ **Solutions**:
506
+
507
+ 1. Ensure the plugin is enabled in `config/plugins.js`
508
+ 2. Run `npm run build` to rebuild the admin panel
509
+ 3. Clear your browser cache and refresh
510
+ 4. Restart your Strapi server
511
+ 5. Check browser console for JavaScript errors
512
+
513
+ ### API Requests Return 403 Forbidden
514
+
515
+ **Problem**: Content API endpoints return authorization errors
516
+
517
+ **Solutions**:
518
+
519
+ 1. Ensure you're sending a valid authentication token
520
+ 2. Check that the `isAuth` policy is properly configured
521
+ 3. Verify your user has the necessary permissions
522
+ 4. Review Strapi's role and permissions settings
523
+
524
+ ### Transactions Not Logging
525
+
526
+ **Problem**: Transaction history is empty
527
+
528
+ **Solutions**:
529
+
530
+ 1. Check that requests are actually reaching Payone (check server logs)
531
+ 2. Verify database write permissions
532
+ 3. Check for JavaScript errors in the browser console
533
+ 4. Ensure the plugin store is accessible
534
+
535
+ ## 🔐 Security Best Practices
536
+
537
+ 1. **Never expose your Portal Key**: Keep it secure and never commit it to version control
538
+ 2. **Use environment variables**: Store credentials in `.env` files (excluded from git)
539
+ 3. **Enable HTTPS**: Always use HTTPS in production for API requests
540
+ 4. **Validate user input**: Always validate and sanitize payment data on the server side
541
+ 5. **Use test mode**: Test thoroughly in test mode before going live
542
+ 6. **Monitor transactions**: Regularly review transaction history for suspicious activity
543
+ 7. **PCI Compliance**: If handling card data directly, ensure PCI DSS compliance
544
+
545
+ ## 📝 License
546
+
547
+ MIT
548
+
549
+ ## 🤝 Support
550
+
551
+ If you encounter issues or need help:
552
+
553
+ 1. Check this README thoroughly
554
+ 2. Review your Strapi server logs
555
+ 3. Consult the [Payone API Documentation](https://docs.payone.com/)
556
+ 4. Check the Transaction History for detailed error messages
557
+
558
+ ## 🔄 Updates
559
+
560
+ To update the plugin:
561
+
562
+ ```bash
563
+ npm update payone-provider
564
+ npm run build
565
+ ```
566
+
567
+ Then restart your Strapi application.
568
+
569
+ ---
570
+
571
+ **Made with â¤ī¸ for Strapi**
@@ -0,0 +1,16 @@
1
+ import { useEffect, useRef } from "react";
2
+ import pluginId from "../../pluginId";
3
+
4
+ const Initializer = ({ setPlugin }) => {
5
+ const ref = useRef(setPlugin);
6
+
7
+ useEffect(() => {
8
+ if (ref.current) {
9
+ ref.current(pluginId);
10
+ }
11
+ }, []);
12
+
13
+ return null;
14
+ };
15
+
16
+ export default Initializer;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { Puzzle } from "@strapi/icons";
3
+
4
+ const PluginIcon = () => <Puzzle />;
5
+
6
+ export default PluginIcon;
@@ -0,0 +1,37 @@
1
+ import pluginPkg from "../../package.json";
2
+ import pluginId from "./pluginId";
3
+ import Initializer from "./components/Initializer";
4
+ import PluginIcon from "./components/PluginIcon";
5
+
6
+ const name = pluginPkg.strapi.name;
7
+
8
+ export default {
9
+ register(app) {
10
+ app.addMenuLink({
11
+ to: `/plugins/${pluginId}`,
12
+ icon: PluginIcon,
13
+ intlLabel: {
14
+ id: `${pluginId}.plugin.name`,
15
+ defaultMessage: "Payone Provider"
16
+ },
17
+ Component: async () => {
18
+ const component = await import("./pages/App");
19
+ return component;
20
+ },
21
+ permissions: []
22
+ });
23
+
24
+ app.registerPlugin({
25
+ id: pluginId,
26
+ initializer: Initializer,
27
+ isReady: false,
28
+ name
29
+ });
30
+ },
31
+
32
+ bootstrap(app) {},
33
+
34
+ async registerTrads() {
35
+ return Promise.resolve([]);
36
+ }
37
+ };