strapi-plugin-payone-provider 1.1.3 → 1.3.0

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 (38) hide show
  1. package/README.md +1156 -380
  2. package/admin/src/index.js +4 -1
  3. package/admin/src/pages/App/components/AppHeader.js +37 -0
  4. package/admin/src/pages/App/components/AppTabs.js +134 -0
  5. package/admin/src/pages/App/components/ConfigurationPanel.js +34 -35
  6. package/admin/src/pages/App/components/GooglePaybutton.js +300 -0
  7. package/admin/src/pages/App/components/HistoryPanel.js +25 -38
  8. package/admin/src/pages/App/components/PaymentActionsPanel.js +119 -280
  9. package/admin/src/pages/App/components/StatusBadge.js +3 -1
  10. package/admin/src/pages/App/components/TransactionHistoryItem.js +4 -1
  11. package/admin/src/pages/App/components/paymentActions/AuthorizationForm.js +122 -0
  12. package/admin/src/pages/App/components/paymentActions/CaptureForm.js +64 -0
  13. package/admin/src/pages/App/components/paymentActions/CardDetailsInput.js +189 -0
  14. package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.js +52 -0
  15. package/admin/src/pages/App/components/paymentActions/PaymentResult.js +148 -0
  16. package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.js +122 -0
  17. package/admin/src/pages/App/components/paymentActions/RefundForm.js +89 -0
  18. package/admin/src/pages/App/index.js +41 -465
  19. package/admin/src/pages/App/styles.css +294 -0
  20. package/admin/src/pages/constants/paymentConstants.js +37 -0
  21. package/admin/src/pages/hooks/usePaymentActions.js +456 -0
  22. package/admin/src/pages/hooks/useSettings.js +111 -0
  23. package/admin/src/pages/hooks/useTransactionHistory.js +87 -0
  24. package/admin/src/pages/utils/api.js +10 -0
  25. package/admin/src/pages/utils/injectGooglePayScript.js +31 -0
  26. package/admin/src/pages/utils/paymentUtils.js +119 -15
  27. package/package.json +1 -1
  28. package/server/controllers/payone.js +71 -64
  29. package/server/routes/index.js +17 -0
  30. package/server/services/paymentService.js +271 -0
  31. package/server/services/payone.js +25 -648
  32. package/server/services/settingsService.js +59 -0
  33. package/server/services/testConnectionService.js +190 -0
  34. package/server/services/transactionService.js +114 -0
  35. package/server/utils/normalize.js +51 -0
  36. package/server/utils/paymentMethodParams.js +126 -0
  37. package/server/utils/requestBuilder.js +121 -0
  38. package/server/utils/responseParser.js +134 -0
package/README.md CHANGED
@@ -10,13 +10,9 @@ A comprehensive Strapi plugin that integrates the Payone payment gateway into yo
10
10
  - [Configuration](#configuration)
11
11
  - [Getting Started](#getting-started)
12
12
  - [Usage](#usage)
13
- - [Admin Panel](#admin-panel)
14
- - [API Endpoints](#api-endpoints)
13
+ - [3D Secure (3DS) Authentication](#-3d-secure-3ds-authentication)
14
+ - [Payment Methods & Operations](#-payment-methods--operations)
15
15
  - [Supported Payment Methods](#supported-payment-methods)
16
- - [Payment Operations](#payment-operations)
17
- - [Transaction History](#transaction-history)
18
- - [Troubleshooting](#troubleshooting)
19
- - [License](#license)
20
16
 
21
17
  ## ✨ Features
22
18
 
@@ -24,8 +20,8 @@ A comprehensive Strapi plugin that integrates the Payone payment gateway into yo
24
20
  - **Payment Operations**:
25
21
  - Preauthorization (reserve funds)
26
22
  - Authorization (immediate charge)
27
- - Capture (complete preauthorized transactions) — currently Credit Card only
28
- - Refund (return funds to customers) — currently Credit Card only
23
+ - Capture (complete preauthorized transactions)
24
+ - Refund (return funds to customers)
29
25
  - **Admin Panel**:
30
26
  - Easy configuration interface
31
27
  - Transaction history viewer with filtering
@@ -57,7 +53,7 @@ You will need the following credentials from your Payone account:
57
53
 
58
54
  ## 📦 Installation
59
55
 
60
- ### Option 1: Install from npm
56
+ ### Install from npm
61
57
 
62
58
  ```bash
63
59
  # Using npm
@@ -70,80 +66,6 @@ yarn add strapi-plugin-payone-provider
70
66
  pnpm add strapi-plugin-payone-provider
71
67
  ```
72
68
 
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
84
- ```
85
-
86
- ### Option 3: Manual Installation (Local Development)
87
-
88
- 1. Clone or copy the plugin folder to your Strapi project's `src/plugins/` directory:
89
-
90
- ```bash
91
- # From your Strapi project root
92
- mkdir -p src/plugins
93
- cp -r /path/to/strapi-plugin-payone src/plugins/
94
- ```
95
-
96
- 2. Install the plugin dependencies:
97
-
98
- ```bash
99
- # Using npm
100
- npm install
101
-
102
- # Using yarn
103
- yarn install
104
-
105
- # Using pnpm
106
- pnpm install
107
- ```
108
-
109
- 3. Enable the plugin by adding it to your `config/plugins.js` (or `config/plugins.ts`):
110
-
111
- ```javascript
112
- module.exports = {
113
- // ... other plugins
114
- 'strapi-plugin-payone-provider': {
115
- enabled: true,
116
- resolve: './src/plugins/strapi-plugin-payone',
117
- },
118
- };
119
- ```
120
-
121
- 4. Rebuild your Strapi admin panel:
122
-
123
- ```bash
124
- # Using npm
125
- npm run build
126
-
127
- # Using yarn
128
- yarn build
129
-
130
- # Using pnpm
131
- pnpm build
132
- ```
133
-
134
- 5. Restart your Strapi application:
135
-
136
- ```bash
137
- # Using npm
138
- npm run develop
139
-
140
- # Using yarn
141
- yarn develop
142
-
143
- # Using pnpm
144
- pnpm develop
145
- ```
146
-
147
69
  ## ⚙️ Configuration
148
70
 
149
71
  After installation, you need to configure your Payone credentials:
@@ -163,50 +85,6 @@ After installation, you need to configure your Payone credentials:
163
85
  5. Click **"Test Connection"** to verify your credentials
164
86
  6. Click **"Save Configuration"** to store your settings
165
87
 
166
- ### Manual Configuration (Alternative)
167
-
168
- You can also configure the plugin programmatically by adding settings to your `config/plugins.js`:
169
-
170
- ```javascript
171
- module.exports = {
172
- 'strapi-plugin-payone-provider': {
173
- enabled: true,
174
- resolve: './src/plugins/strapi-plugin-payone',
175
- config: {
176
- settings: {
177
- aid: 'YOUR_ACCOUNT_ID',
178
- portalid: 'YOUR_PORTAL_ID',
179
- mid: 'YOUR_MERCHANT_ID',
180
- key: 'YOUR_PORTAL_KEY',
181
- mode: 'test', // or 'live'
182
- api_version: '3.10',
183
- },
184
- },
185
- },
186
- };
187
- ```
188
-
189
- > ⚠️ **Security Warning**: Never commit your production credentials to version control. Use environment variables instead:
190
-
191
- ```javascript
192
- module.exports = {
193
- 'strapi-plugin-payone-provider': {
194
- enabled: true,
195
- resolve: './src/plugins/strapi-plugin-payone',
196
- config: {
197
- settings: {
198
- aid: process.env.PAYONE_AID,
199
- portalid: process.env.PAYONE_PORTAL_ID,
200
- mid: process.env.PAYONE_MID,
201
- key: process.env.PAYONE_KEY,
202
- mode: process.env.PAYONE_MODE || 'test',
203
- api_version: '3.10',
204
- },
205
- },
206
- },
207
- };
208
- ```
209
-
210
88
  ## 🚀 Getting Started
211
89
 
212
90
  ### 1. Test Your Connection
@@ -221,65 +99,91 @@ After configuring your credentials:
221
99
  ### 2. Try a Test Payment
222
100
 
223
101
  1. Go to the **Payment Actions** tab
224
- 2. Try a **Preauthorization** operation (currently test UI supports Credit Card only):
102
+ 2. Try a **Preauthorization** operation:
225
103
  - Amount: 1000 (equals 10.00 EUR in cents)
226
104
  - Reference: Leave empty for auto-generation
227
105
  - Click **"Execute Preauthorization"**
228
106
  3. Check the **Transaction History** tab to see the logged transaction
229
107
 
230
- ### 3. Review Transaction History
108
+ ## 📖 Usage
231
109
 
232
- 1. Navigate to the **Transaction History** tab
233
- 2. View all payment operations
234
- 3. Use filters to search for specific transactions
235
- 4. Click on any transaction to view full details
110
+ ### Base URL
236
111
 
237
- ## 📖 Usage
112
+ All API endpoints are available at:
113
+
114
+ **Content API (Frontend)**: `/api/strapi-plugin-payone-provider`
115
+
116
+ **Admin API**: `/strapi-plugin-payone-provider`
238
117
 
239
- ### Admin Panel
118
+ > ⚠️ **Authentication Required**: All endpoints require authentication. Include your Bearer token in the Authorization header.
240
119
 
241
- The plugin adds a new menu item **"Payone Provider"** to your Strapi admin panel with three tabs:
120
+ ### Common Request Headers
242
121
 
243
- #### 1. Configuration Tab
122
+ ```javascript
123
+ {
124
+ "Content-Type": "application/json",
125
+ "Authorization": "Bearer YOUR_AUTH_TOKEN"
126
+ }
127
+ ```
128
+
129
+ ### Common Response Fields
130
+
131
+ All responses include:
132
+
133
+ - `status`: Transaction status (APPROVED, ERROR, REDIRECT, etc.)
134
+ - `txid`: Transaction ID (for successful transactions)
135
+ - `errorcode`: Error code (if status is ERROR)
136
+ - `errormessage`: Error message (if status is ERROR)
137
+
138
+ ---
139
+
140
+ ## 🔐 3D Secure (3DS) Authentication
244
141
 
245
- - Configure Payone API credentials
246
- - Test connection to Payone servers
247
- - Switch between test and live modes
142
+ 3D Secure (3DS) is a security protocol that adds an extra layer of authentication for credit card payments, ensuring compliance with Strong Customer Authentication (SCA) requirements.
248
143
 
249
- #### 2. Transaction History Tab
144
+ ### Enabling 3D Secure
250
145
 
251
- - View all payment transactions
252
- - Filter by status, type, transaction ID, reference, or date range
253
- - View detailed request/response data for each transaction
254
- - Pagination support for large transaction lists
146
+ 1. Navigate to **Payone Provider** in the Strapi admin panel
147
+ 2. Go to the **Configuration** tab
148
+ 3. Find the **"Enable 3D Secure"** dropdown
149
+ 4. Select **"Enabled"** to activate 3DS for credit card payments
150
+ 5. Click **"Save Configuration"**
255
151
 
256
- #### 3. Payment Actions Tab
152
+ > ⚠️ **Note**: When 3DS is enabled, it only applies to **credit card** payments (`clearingtype: "cc"`). Other payment methods are not affected.
257
153
 
258
- - Test payment operations without writing code
259
- - Execute preauthorizations, authorizations, captures, and refunds
260
- - View real-time results and error messages
154
+ ### Supported Operations
261
155
 
262
- ### API Endpoints
156
+ 3D Secure works with the following operations:
263
157
 
264
- The plugin provides REST API endpoints for programmatic access:
158
+ - **Preauthorization** (`POST /api/strapi-plugin-payone-provider/preauthorization`)
159
+ - ✅ **Authorization** (`POST /api/strapi-plugin-payone-provider/authorization`)
160
+ - ❌ **Capture** - Not applicable (uses preauthorized transaction)
161
+ - ❌ **Refund** - Not applicable (uses existing transaction)
265
162
 
266
- #### Content API Endpoints (Public with Auth Policy)
163
+ ### Required Parameters for Preauthorization/Authorization with 3DS
267
164
 
268
- All content API endpoints require authentication via the `isAuth` policy. These are meant for your frontend application.
165
+ When 3DS is enabled and you're making a credit card payment, the following parameters are required:
269
166
 
270
- Base URL: `/api/strapi-plugin-payone-provider`
167
+ **Credit Card Details** (required when 3DS is enabled):
271
168
 
272
- ##### POST `/api/strapi-plugin-payone-provider/preauthorization`
169
+ - `cardtype`: Card type (`"V"` for VISA, `"M"` for Mastercard, `"A"` for AMEX, etc.)
170
+ - `cardpan`: Card number (PAN)
171
+ - `cardexpiredate`: Expiry date in format `YYMM` (e.g., `"2512"` for December 2025)
172
+ - `cardcvc2`: CVC/CVV code (3 digits for most cards, 4 digits for AMEX)
273
173
 
274
- Reserve funds on a customer's card without immediate charge.
174
+ **Redirect URLs** (required for 3DS authentication flow):
275
175
 
276
- **Request Body:**
176
+ - `successurl`: URL to redirect after successful 3DS authentication
177
+ - `errorurl`: URL to redirect after 3DS authentication error
178
+ - `backurl`: URL to redirect if user cancels 3DS authentication
179
+
180
+ **Example Request**:
277
181
 
278
182
  ```json
279
183
  {
280
184
  "amount": 1000,
281
185
  "currency": "EUR",
282
- "reference": "ORDER-12345",
186
+ "reference": "PAY1234567890ABCDEF",
283
187
  "clearingtype": "cc",
284
188
  "cardtype": "V",
285
189
  "cardpan": "4111111111111111",
@@ -287,336 +191,1208 @@ Reserve funds on a customer's card without immediate charge.
287
191
  "cardcvc2": "123",
288
192
  "firstname": "John",
289
193
  "lastname": "Doe",
194
+ "email": "john.doe@example.com",
290
195
  "street": "Main Street 123",
291
196
  "zip": "12345",
292
197
  "city": "Berlin",
293
198
  "country": "DE",
294
- "email": "john.doe@example.com"
199
+ "successurl": "https://www.example.com/success",
200
+ "errorurl": "https://www.example.com/error",
201
+ "backurl": "https://www.example.com/back"
295
202
  }
296
203
  ```
297
204
 
298
- **Response:**
205
+ ### 3DS Response Handling
206
+
207
+ When 3DS is required, the API response will include:
299
208
 
300
209
  ```json
301
210
  {
302
211
  "data": {
303
- "status": "APPROVED",
304
- "txid": "123456789",
305
- "userid": "987654321"
212
+ "status": "REDIRECT",
213
+ "redirecturl": "https://secure.pay1.de/3ds/...",
214
+ "requires3DSRedirect": true,
215
+ "txid": "123456789"
306
216
  }
307
217
  }
308
218
  ```
309
219
 
310
- ##### POST `/api/strapi-plugin-payone-provider/authorization`
220
+ **Response Fields**:
221
+
222
+ - `status`: `"REDIRECT"` when 3DS authentication is required
223
+ - `redirecturl`: URL to redirect the customer for 3DS authentication
224
+ - `requires3DSRedirect`: Boolean indicating if redirect is needed
225
+ - `txid`: Transaction ID (if available)
311
226
 
312
- Immediately charge a customer's card.
227
+ ### 3DS Callback Endpoint
313
228
 
314
- **Request Body:** (Same as preauthorization)
229
+ After the customer completes 3DS authentication, Payone will send a callback to:
315
230
 
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`.
231
+ **URL**: `POST /api/strapi-plugin-payone-provider/3ds-callback`
317
232
 
318
- ##### POST `/api/strapi-plugin-payone-provider/capture`
233
+ This endpoint processes the 3DS authentication result and updates the transaction status.
319
234
 
320
- Complete a preauthorized transaction and capture the funds.
235
+ > ℹ️ **Note**: The callback endpoint is automatically handled by the plugin. You don't need to manually process it unless you're implementing custom callback handling.
321
236
 
322
- **Request Body:**
237
+ ### How It Works
238
+
239
+ 1. **Request**: Send a preauthorization or authorization request with credit card details and redirect URLs
240
+ 2. **Response**: If 3DS is required, you'll receive a `REDIRECT` status with a `redirecturl`
241
+ 3. **Redirect**: Redirect the customer to the `redirecturl` for 3DS authentication
242
+ 4. **Callback**: After authentication, Payone redirects back to your `successurl`, `errorurl`, or `backurl` with transaction data
243
+ 5. **Completion**: The transaction is completed based on the authentication result
244
+
245
+ ### Testing 3DS
246
+
247
+ For testing 3DS authentication, use test cards that trigger 3DS challenges. Refer to the [Payone 3D Secure Documentation](https://docs.payone.com/security-risk-management/3d-secure#/) for test card numbers and scenarios.
248
+
249
+ ---
250
+
251
+ ## 💳 Payment Methods & Operations
252
+
253
+ ### Credit Card
254
+
255
+ <details>
256
+ <summary><strong>Credit Card Payment Method</strong></summary>
257
+
258
+ #### Preauthorization
259
+
260
+ **URL**: `POST /api/strapi-plugin-payone-provider/preauthorization`
261
+
262
+ **Request Body**:
323
263
 
324
264
  ```json
325
265
  {
326
- "txid": "123456789",
327
266
  "amount": 1000,
328
- "currency": "EUR"
267
+ "currency": "EUR",
268
+ "reference": "PAY1234567890ABCDEF",
269
+ "clearingtype": "cc",
270
+ "cardtype": "V",
271
+ "cardpan": "4111111111111111",
272
+ "cardexpiredate": "2512",
273
+ "cardcvc2": "123",
274
+ "firstname": "John",
275
+ "lastname": "Doe",
276
+ "email": "john.doe@example.com",
277
+ "telephonenumber": "+4917512345678",
278
+ "street": "Main Street 123",
279
+ "zip": "12345",
280
+ "city": "Berlin",
281
+ "country": "DE",
282
+ "successurl": "https://www.example.com/success",
283
+ "errorurl": "https://www.example.com/error",
284
+ "backurl": "https://www.example.com/back",
285
+ "salutation": "Herr",
286
+ "gender": "m",
287
+ "ip": "127.0.0.1",
288
+ "language": "de",
289
+ "customer_is_present": "yes"
329
290
  }
330
291
  ```
331
292
 
332
- ##### POST `/api/strapi-plugin-payone-provider/refund`
333
-
334
- Refund a captured transaction.
335
-
336
- **Request Body:**
293
+ **Response**:
337
294
 
338
295
  ```json
339
296
  {
340
- "txid": "123456789",
341
- "amount": -1000,
342
- "currency": "EUR",
343
- "reference": "REFUND-12345",
344
- "sequencenumber": 2
297
+ "data": {
298
+ "status": "APPROVED",
299
+ "txid": "123456789",
300
+ "userid": "987654321"
301
+ }
345
302
  }
346
303
  ```
347
304
 
348
- #### Admin API Endpoints
305
+ #### Authorization
306
+
307
+ **URL**: `POST /api/strapi-plugin-payone-provider/authorization`
349
308
 
350
- These endpoints require admin authentication and are available at `/strapi-plugin-payone-provider/`.
309
+ **Request Body**: (Same as Preauthorization)
351
310
 
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
356
- - All payment operation endpoints (same as content API)
311
+ ```json
312
+ {
313
+ "amount": 1000,
314
+ "currency": "EUR",
315
+ "reference": "PAY1234567890ABCDEF",
316
+ "clearingtype": "cc",
317
+ "cardtype": "V",
318
+ "cardpan": "4111111111111111",
319
+ "cardexpiredate": "2512",
320
+ "cardcvc2": "123",
321
+ "firstname": "John",
322
+ "lastname": "Doe",
323
+ "email": "john.doe@example.com",
324
+ "telephonenumber": "+4917512345678",
325
+ "street": "Main Street 123",
326
+ "zip": "12345",
327
+ "city": "Berlin",
328
+ "country": "DE",
329
+ "successurl": "https://www.example.com/success",
330
+ "errorurl": "https://www.example.com/error",
331
+ "backurl": "https://www.example.com/back",
332
+ "salutation": "Herr",
333
+ "gender": "m",
334
+ "ip": "127.0.0.1",
335
+ "language": "de",
336
+ "customer_is_present": "yes"
337
+ }
338
+ ```
357
339
 
358
- ### JavaScript/TypeScript Usage Example
340
+ **Response**:
359
341
 
360
- ```javascript
361
- // In your frontend application
362
- import axios from 'axios';
363
-
364
- const processPayment = async (orderData) => {
365
- try {
366
- // Step 1: Preauthorize the payment
367
- const preauth = await axios.post(
368
- 'http://localhost:1337/api/strapi-plugin-payone-provider/preauthorization',
369
- {
370
- amount: orderData.amount, // in cents, e.g., 1000 = 10.00 EUR
371
- currency: 'EUR',
372
- reference: orderData.orderId,
373
- clearingtype: 'cc',
374
- cardtype: 'V', // Visa
375
- cardpan: orderData.cardNumber,
376
- cardexpiredate: orderData.cardExpiry, // YYMM format
377
- cardcvc2: orderData.cardCvc,
378
- firstname: orderData.firstName,
379
- lastname: orderData.lastName,
380
- street: orderData.street,
381
- zip: orderData.zip,
382
- city: orderData.city,
383
- country: orderData.country,
384
- email: orderData.email,
385
- },
386
- {
387
- headers: {
388
- Authorization: `Bearer ${yourAuthToken}`,
389
- },
390
- }
391
- );
392
-
393
- if (preauth.data.data.status === 'APPROVED') {
394
- const txid = preauth.data.data.txid;
395
-
396
- // Step 2: Capture the preauthorized amount
397
- const capture = await axios.post(
398
- 'http://localhost:1337/api/strapi-plugin-payone-provider/capture',
399
- {
400
- txid: txid,
401
- amount: orderData.amount,
402
- currency: 'EUR',
403
- },
404
- {
405
- headers: {
406
- Authorization: `Bearer ${yourAuthToken}`,
407
- },
408
- }
409
- );
410
-
411
- return {
412
- success: true,
413
- transactionId: txid,
414
- };
415
- }
416
- } catch (error) {
417
- console.error('Payment failed:', error);
418
- return {
419
- success: false,
420
- error: error.message,
421
- };
342
+ ```json
343
+ {
344
+ "data": {
345
+ "status": "APPROVED",
346
+ "txid": "123456789",
347
+ "userid": "987654321"
422
348
  }
423
- };
349
+ }
424
350
  ```
425
351
 
426
- ## 💳 Payment Operations
352
+ #### Capture
427
353
 
428
- ## Supported Payment Methods
354
+ **URL**: `POST /api/strapi-plugin-payone-provider/capture`
429
355
 
430
- 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.
356
+ **Request Body**:
431
357
 
432
- Common required fields (all methods):
358
+ ```json
359
+ {
360
+ "txid": "123456789",
361
+ "amount": 1000,
362
+ "currency": "EUR",
363
+ "sequencenumber": 1
364
+ }
365
+ ```
433
366
 
434
- - `amount` (in cents), `currency`, `reference` (max 20 chars; auto-normalized)
435
- - `firstname`, `lastname`, `email`, `telephonenumber`
436
- - `street`, `zip`, `city`, `country`
367
+ **Response**:
437
368
 
438
- Credit Card (`clearingtype = cc`):
369
+ ```json
370
+ {
371
+ "data": {
372
+ "status": "APPROVED",
373
+ "txid": "123456789"
374
+ }
375
+ }
376
+ ```
439
377
 
440
- - Required: `cardtype` (V/M/A...), `cardpan`, `cardexpiredate` (MMyy), `cardcvc2`
441
- - Operations: preauthorization, authorization, capture, refund
442
- - Test payment in Admin currently supported for Credit Card only
378
+ #### Refund
443
379
 
444
- PayPal Wallet (`clearingtype = wlt`, `wallettype = PPE`):
380
+ **URL**: `POST /api/strapi-plugin-payone-provider/refund`
445
381
 
446
- - Required: `successurl`, `errorurl`, `backurl` (redirect URLs)
447
- - Recommended shipping fields: `shipping_firstname`, `shipping_lastname`, `shipping_street`, `shipping_zip`, `shipping_city`, `shipping_country`
448
- - Operations: preauthorization, authorization (capture/refund roadmap)
382
+ **Request Body**:
449
383
 
450
- SEPA Direct Debit (`clearingtype = elv`):
384
+ ```json
385
+ {
386
+ "txid": "123456789",
387
+ "amount": -1000,
388
+ "currency": "EUR",
389
+ "reference": "REF1234567890ABCDEF",
390
+ "sequencenumber": 2
391
+ }
392
+ ```
451
393
 
452
- - Required: `iban`, `bic`, `bankaccountholder`, `bankcountry`
453
- - Operations: preauthorization, authorization (capture/refund roadmap)
394
+ **Response**:
454
395
 
455
- Online Banking/PNT (`clearingtype = sb`):
396
+ ```json
397
+ {
398
+ "data": {
399
+ "status": "APPROVED",
400
+ "txid": "123456789"
401
+ }
402
+ }
403
+ ```
456
404
 
457
- - Required: `onlinebanktransfertype` (e.g. `PNT`), `bankcountry`, redirect URLs (`successurl`, `errorurl`, `backurl`)
458
- - Operations: authorization (capture/refund roadmap)
405
+ </details>
459
406
 
460
- Notes:
407
+ ---
461
408
 
462
- - The plugin normalizes `reference` server-side to comply with Payone (alphanumeric only, max 20 chars, auto-generated fallback).
463
- - For redirect flows, the plugin auto-fills redirect URLs when missing using a base URL from settings or environment.
409
+ ### PayPal
464
410
 
465
- ### Preauthorization vs Authorization
411
+ <details>
412
+ <summary><strong>PayPal Payment Method</strong></summary>
466
413
 
467
- - **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.
414
+ #### Preauthorization
468
415
 
469
- - **Authorization**: Immediately charges the customer's card. Use this for instant payments (e.g., e-commerce purchases).
416
+ **URL**: `POST /api/strapi-plugin-payone-provider/preauthorization`
470
417
 
471
- ### Capture
418
+ **Request Body**:
472
419
 
473
- After a successful preauthorization, you must capture the transaction to receive the funds. Captures can be:
420
+ ```json
421
+ {
422
+ "amount": 1000,
423
+ "currency": "EUR",
424
+ "reference": "PAY1234567890ABCDEF",
425
+ "clearingtype": "wlt",
426
+ "wallettype": "PPE",
427
+ "firstname": "John",
428
+ "lastname": "Doe",
429
+ "email": "john.doe@example.com",
430
+ "telephonenumber": "+4917512345678",
431
+ "street": "Main Street 123",
432
+ "zip": "12345",
433
+ "city": "Berlin",
434
+ "country": "DE",
435
+ "shipping_firstname": "John",
436
+ "shipping_lastname": "Doe",
437
+ "shipping_street": "Main Street 123",
438
+ "shipping_zip": "12345",
439
+ "shipping_city": "Berlin",
440
+ "shipping_country": "DE",
441
+ "successurl": "https://www.example.com/success",
442
+ "errorurl": "https://www.example.com/error",
443
+ "backurl": "https://www.example.com/back",
444
+ "salutation": "Herr",
445
+ "gender": "m",
446
+ "ip": "127.0.0.1",
447
+ "language": "de",
448
+ "customer_is_present": "yes"
449
+ }
450
+ ```
474
451
 
475
- - **Full capture**: Capture the entire preauthorized amount
476
- - **Partial capture**: Capture less than the preauthorized amount
452
+ **Response**:
477
453
 
478
- ### Refund
454
+ ```json
455
+ {
456
+ "data": {
457
+ "status": "REDIRECT",
458
+ "txid": "123456789",
459
+ "redirecturl": "https://secure.pay1.de/redirect/..."
460
+ }
461
+ }
462
+ ```
479
463
 
480
- Refunds return money to the customer. Important notes:
464
+ #### Authorization
481
465
 
482
- - Amount must be negative (e.g., -1000 for 10.00 EUR)
483
- - Requires a valid transaction ID (txid)
484
- - Requires a sequence number (start with 2, increment for each additional refund on same transaction)
466
+ **URL**: `POST /api/strapi-plugin-payone-provider/authorization`
485
467
 
486
- > Current limitation: Capture and Refund are implemented for Credit Card only. Support for PayPal/SEPA/Online Banking will be added in future updates.
468
+ **Request Body**: (Same as Preauthorization)
487
469
 
488
- ## 📊 Transaction History
470
+ ```json
471
+ {
472
+ "amount": 1000,
473
+ "currency": "EUR",
474
+ "reference": "PAY1234567890ABCDEF",
475
+ "clearingtype": "wlt",
476
+ "wallettype": "PPE",
477
+ "firstname": "John",
478
+ "lastname": "Doe",
479
+ "email": "john.doe@example.com",
480
+ "telephonenumber": "+4917512345678",
481
+ "street": "Main Street 123",
482
+ "zip": "12345",
483
+ "city": "Berlin",
484
+ "country": "DE",
485
+ "shipping_firstname": "John",
486
+ "shipping_lastname": "Doe",
487
+ "shipping_street": "Main Street 123",
488
+ "shipping_zip": "12345",
489
+ "shipping_city": "Berlin",
490
+ "shipping_country": "DE",
491
+ "successurl": "https://www.example.com/success",
492
+ "errorurl": "https://www.example.com/error",
493
+ "backurl": "https://www.example.com/back",
494
+ "salutation": "Herr",
495
+ "gender": "m",
496
+ "ip": "127.0.0.1",
497
+ "language": "de",
498
+ "customer_is_present": "yes"
499
+ }
500
+ ```
489
501
 
490
- All payment operations are automatically logged to the transaction history. Each entry includes:
502
+ **Response**:
491
503
 
492
- - **Transaction ID (txid)**: Payone's unique transaction identifier
493
- - **Reference**: Your custom order/payment reference
494
- - **Type**: Operation type (authorization, preauthorization, capture, refund)
495
- - **Amount**: Transaction amount in cents
496
- - **Currency**: Currency code (EUR, USD, etc.)
497
- - **Status**: APPROVED, ERROR, REDIRECT, etc.
498
- - **Timestamp**: When the transaction occurred
499
- - **Raw Request/Response**: Complete API request and response data for debugging
504
+ ```json
505
+ {
506
+ "data": {
507
+ "status": "REDIRECT",
508
+ "txid": "123456789",
509
+ "redirecturl": "https://secure.pay1.de/redirect/..."
510
+ }
511
+ }
512
+ ```
500
513
 
501
- ### Filtering Transactions
514
+ #### Capture
502
515
 
503
- Use the filters in the Transaction History tab to find specific transactions:
516
+ **URL**: `POST /api/strapi-plugin-payone-provider/capture`
504
517
 
505
- - **Status**: Filter by APPROVED, ERROR, etc.
506
- - **Type**: Filter by operation type
507
- - **Transaction ID**: Search by specific txid
508
- - **Reference**: Search by your order reference
509
- - **Date Range**: Filter by date
518
+ **Request Body**:
510
519
 
511
- ## 🔍 Troubleshooting
520
+ ```json
521
+ {
522
+ "txid": "123456789",
523
+ "amount": 1000,
524
+ "currency": "EUR",
525
+ "sequencenumber": 1,
526
+ "capturemode": "full"
527
+ }
528
+ ```
512
529
 
513
- ### Connection Test Fails
530
+ **Response**:
514
531
 
515
- **Problem**: "Authentication failed" or "Invalid credentials"
532
+ ```json
533
+ {
534
+ "data": {
535
+ "status": "APPROVED",
536
+ "txid": "123456789"
537
+ }
538
+ }
539
+ ```
516
540
 
517
- **Solutions**:
541
+ #### Refund
518
542
 
519
- 1. Verify your AID, Portal ID, Merchant ID, and Portal Key are correct
520
- 2. Ensure you're using the correct mode (test/live)
521
- 3. Check that your Payone account is active and not suspended
522
- 4. Verify the Portal Key is the MD5 hash key from your Payone PMI
543
+ **URL**: `POST /api/strapi-plugin-payone-provider/refund`
523
544
 
524
- ### Payment Gets Rejected
545
+ **Request Body**:
525
546
 
526
- **Problem**: Transactions return ERROR status
547
+ ```json
548
+ {
549
+ "txid": "123456789",
550
+ "amount": -1000,
551
+ "currency": "EUR",
552
+ "reference": "REF1234567890ABCDEF",
553
+ "sequencenumber": 2
554
+ }
555
+ ```
527
556
 
528
- **Common Causes**:
557
+ **Response**:
529
558
 
530
- 1. **Invalid card data**: Check card number, expiry date, and CVC
531
- 2. **Insufficient funds**: Test cards may have limits
532
- 3. **Duplicate reference**: Each transaction needs a unique reference
533
- 4. **Missing required fields**: Ensure all required customer data is provided
534
- 5. **Test mode restrictions**: Some features may be limited in test mode
559
+ ```json
560
+ {
561
+ "data": {
562
+ "status": "APPROVED",
563
+ "txid": "123456789"
564
+ }
565
+ }
566
+ ```
535
567
 
536
- **Debug Steps**:
568
+ </details>
537
569
 
538
- 1. Check the Transaction History for error codes and messages
539
- 2. Review the raw response data for detailed error information
540
- 3. Consult the Payone API documentation for error code meanings
541
- 4. Check your Strapi server logs for detailed error traces
570
+ ---
542
571
 
543
- ### Plugin Not Appearing in Admin
572
+ ### Google Pay
544
573
 
545
- **Problem**: Payone Provider menu item doesn't appear
574
+ <details>
575
+ <summary><strong>Google Pay Payment Method</strong></summary>
546
576
 
547
- **Solutions**:
577
+ #### Overview
548
578
 
549
- 1. Ensure the plugin is enabled in `config/plugins.js`
550
- 2. Run `npm run build` to rebuild the admin panel
551
- 3. Clear your browser cache and refresh
552
- 4. Restart your Strapi server
553
- 5. Check browser console for JavaScript errors
579
+ Google Pay integration requires obtaining an encrypted payment token from Google Pay API and sending it to Payone. The token must be Base64 encoded before sending to Payone.
554
580
 
555
- ### API Requests Return 403 Forbidden
581
+ #### Getting Google Pay Token
556
582
 
557
- **Problem**: Content API endpoints return authorization errors
583
+ **1. Include Google Pay Script**
558
584
 
559
- **Solutions**:
585
+ ```html
586
+ <script async src="https://pay.google.com/gp/p/js/pay.js"></script>
587
+ ```
560
588
 
561
- 1. Ensure you're sending a valid authentication token
562
- 2. Check that the `isAuth` policy is properly configured
563
- 3. Verify your user has the necessary permissions
564
- 4. Review Strapi's role and permissions settings
589
+ **2. Initialize Google Pay**
565
590
 
566
- ### Transactions Not Logging
591
+ ```javascript
592
+ const paymentsClient = new google.payments.api.PaymentsClient({
593
+ environment: 'TEST', // or "PRODUCTION" for live
594
+ });
567
595
 
568
- **Problem**: Transaction history is empty
596
+ const baseRequest = {
597
+ apiVersion: 2,
598
+ apiVersionMinor: 0,
599
+ };
569
600
 
570
- **Solutions**:
601
+ const allowedCardNetworks = ['MASTERCARD', 'VISA'];
602
+ const allowedAuthMethods = ['PAN_ONLY', 'CRYPTOGRAM_3DS'];
571
603
 
572
- 1. Check that requests are actually reaching Payone (check server logs)
573
- 2. Verify database write permissions
574
- 3. Check for JavaScript errors in the browser console
575
- 4. Ensure the plugin store is accessible
604
+ const tokenizationSpecification = {
605
+ type: 'PAYMENT_GATEWAY',
606
+ parameters: {
607
+ gateway: 'payonegmbh',
608
+ gatewayMerchantId: 'YOUR_PAYONE_MERCHANT_ID', // Use your Payone MID or Portal ID
609
+ },
610
+ };
576
611
 
577
- ## 🔐 Security Best Practices
612
+ const cardPaymentMethod = {
613
+ type: 'CARD',
614
+ parameters: {
615
+ allowedCardNetworks,
616
+ allowedAuthMethods,
617
+ },
618
+ tokenizationSpecification,
619
+ };
578
620
 
579
- 1. **Never expose your Portal Key**: Keep it secure and never commit it to version control
580
- 2. **Use environment variables**: Store credentials in `.env` files (excluded from git)
581
- 3. **Enable HTTPS**: Always use HTTPS in production for API requests
582
- 4. **Validate user input**: Always validate and sanitize payment data on the server side
583
- 5. **Use test mode**: Test thoroughly in test mode before going live
584
- 6. **Monitor transactions**: Regularly review transaction history for suspicious activity
585
- 7. **PCI Compliance**: If handling card data directly, ensure PCI DSS compliance
621
+ const isReadyToPayRequest = Object.assign({}, baseRequest);
622
+ isReadyToPayRequest.allowedPaymentMethods = [cardPaymentMethod];
586
623
 
587
- ## 📝 License
624
+ paymentsClient.isReadyToPay(isReadyToPayRequest).then(function (response) {
625
+ if (response.result) {
626
+ // Google Pay is available, show button
627
+ }
628
+ });
629
+ ```
588
630
 
589
- MIT
631
+ **3. Create Payment Button and Get Token**
590
632
 
591
- ## 🤝 Support
633
+ ```javascript
634
+ const paymentDataRequest = Object.assign({}, baseRequest);
635
+ paymentDataRequest.allowedPaymentMethods = [cardPaymentMethod];
636
+ paymentDataRequest.transactionInfo = {
637
+ totalPriceStatus: 'FINAL',
638
+ totalPrice: '10.00',
639
+ currencyCode: 'EUR',
640
+ };
641
+ paymentDataRequest.merchantInfo = {
642
+ merchantId: 'YOUR_GOOGLE_MERCHANT_ID', // Optional: from Google Console
643
+ merchantName: 'Your Merchant Name',
644
+ };
592
645
 
593
- If you encounter issues or need help:
646
+ const button = paymentsClient.createButton({
647
+ onClick: async () => {
648
+ try {
649
+ const paymentData = await paymentsClient.loadPaymentData(paymentDataRequest);
650
+ const token = paymentData.paymentMethodData.tokenizationData.token;
594
651
 
595
- 1. Check this README thoroughly
596
- 2. Review your Strapi server logs
597
- 3. Consult the [Payone API Documentation](https://docs.payone.com/)
598
- 4. Check the Transaction History for detailed error messages
652
+ // Token is a JSON string, encode it to Base64 for Payone
653
+ const base64Token = btoa(unescape(encodeURIComponent(token)));
599
654
 
600
- ## 🔄 Updates
655
+ // Send to your backend
656
+ await fetch('/api/strapi-plugin-payone-provider/preauthorization', {
657
+ method: 'POST',
658
+ headers: {
659
+ 'Content-Type': 'application/json',
660
+ Authorization: 'Bearer YOUR_TOKEN',
661
+ },
662
+ body: JSON.stringify({
663
+ amount: 1000,
664
+ currency: 'EUR',
665
+ reference: 'PAY1234567890ABCDEF',
666
+ googlePayToken: base64Token,
667
+ }),
668
+ });
669
+ } catch (error) {
670
+ console.error('Google Pay error:', error);
671
+ }
672
+ },
673
+ });
601
674
 
602
- To update the plugin:
675
+ document.getElementById('google-pay-button').appendChild(button);
676
+ ```
603
677
 
604
- ```bash
605
- # Using npm
606
- npm update strapi-plugin-payone-provider
607
- npm run build
678
+ **Token Format**
608
679
 
609
- # Using yarn
610
- yarn upgrade strapi-plugin-payone-provider
611
- yarn build
680
+ The token from Google Pay is a JSON string with the following structure:
612
681
 
613
- # Using pnpm
614
- pnpm update strapi-plugin-payone-provider
615
- pnpm build
682
+ ```json
683
+ {
684
+ "signature": "MEUCIFr4ETGzv0uLZX3sR+i1ScARXnRBrncyYFDX/TI/VSLCAiEAvC/Q4dqXMQhwcSdg/ZvXj8+up0wXsfHja3V/6z48/vk=",
685
+ "intermediateSigningKey": {
686
+ "signedKey": "{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7PWUi+e6WPUhNmTSQ2WN006oWlcWy0FtBWizw9sph1wvX9XcXUNRLcfcsmCBfI5IsKQkjAmYxpCSB+L5sIudLw\\u003d\\u003d\",\"keyExpiration\":\"1722393105282\"}",
687
+ "signatures": ["MEUCIQCpU30A3g2pP93IBE5NxgO9ZcJlGF9YPzCZS7H4/IR1CQIgF6+I5t8olT8YsRDUcj7w3R1bvX4ZCcyFXE2+YXa+3H0="]
688
+ },
689
+ "protocolVersion": "ECv2",
690
+ "signedMessage": "{\"encryptedMessage\":\"...\",\"ephemeralPublicKey\":\"...\",\"tag\":\"...\"}"
691
+ }
692
+ ```
693
+
694
+ **Important**: The token must be Base64 encoded before sending to Payone.
695
+
696
+ #### Preauthorization
697
+
698
+ **URL**: `POST /api/strapi-plugin-payone-provider/preauthorization`
699
+
700
+ **Request Body**:
701
+
702
+ ```json
703
+ {
704
+ "amount": 1000,
705
+ "currency": "EUR",
706
+ "reference": "PAY1234567890ABCDEF",
707
+ "clearingtype": "wlt",
708
+ "wallettype": "GGP",
709
+ "firstname": "John",
710
+ "lastname": "Doe",
711
+ "email": "john.doe@example.com",
712
+ "telephonenumber": "+4917512345678",
713
+ "street": "Main Street 123",
714
+ "zip": "12345",
715
+ "city": "Berlin",
716
+ "country": "DE",
717
+ "shipping_firstname": "John",
718
+ "shipping_lastname": "Doe",
719
+ "shipping_street": "Main Street 123",
720
+ "shipping_zip": "12345",
721
+ "shipping_city": "Berlin",
722
+ "shipping_country": "DE",
723
+ "successurl": "https://www.example.com/success",
724
+ "errorurl": "https://www.example.com/error",
725
+ "backurl": "https://www.example.com/back",
726
+ "googlePayToken": "BASE64_ENCODED_TOKEN",
727
+ "salutation": "Herr",
728
+ "gender": "m",
729
+ "ip": "127.0.0.1",
730
+ "language": "de",
731
+ "customer_is_present": "yes"
732
+ }
733
+ ```
734
+
735
+ **Payone Request Parameters** (automatically added by plugin):
736
+
737
+ ```json
738
+ {
739
+ "request": "preauthorization",
740
+ "amount": 1000,
741
+ "currency": "EUR",
742
+ "reference": "PAY1234567890ABCDEF",
743
+ "clearingtype": "wlt",
744
+ "wallettype": "GGP",
745
+ "add_paydata[paymentmethod_token_data]": "BASE64_ENCODED_TOKEN",
746
+ "add_paydata[paymentmethod]": "GGP",
747
+ "add_paydata[paymentmethod_type]": "GOOGLEPAY",
748
+ "add_paydata[gatewayid]": "payonegmbh",
749
+ "add_paydata[gateway_merchantid]": "YOUR_PAYONE_MERCHANT_ID",
750
+ "firstname": "John",
751
+ "lastname": "Doe",
752
+ "email": "john.doe@example.com",
753
+ "street": "Main Street 123",
754
+ "zip": "12345",
755
+ "city": "Berlin",
756
+ "country": "DE",
757
+ "shipping_firstname": "John",
758
+ "shipping_lastname": "Doe",
759
+ "shipping_street": "Main Street 123",
760
+ "shipping_zip": "12345",
761
+ "shipping_city": "Berlin",
762
+ "shipping_country": "DE",
763
+ "successurl": "https://www.example.com/success",
764
+ "errorurl": "https://www.example.com/error",
765
+ "backurl": "https://www.example.com/back"
766
+ }
767
+ ```
768
+
769
+ **Response**:
770
+
771
+ ```json
772
+ {
773
+ "data": {
774
+ "status": "APPROVED",
775
+ "txid": "123456789"
776
+ }
777
+ }
778
+ ```
779
+
780
+ #### Authorization
781
+
782
+ **URL**: `POST /api/strapi-plugin-payone-provider/authorization`
783
+
784
+ **Request Body**: (Same as Preauthorization, include `googlePayToken`)
785
+
786
+ ```json
787
+ {
788
+ "amount": 1000,
789
+ "currency": "EUR",
790
+ "reference": "PAY1234567890ABCDEF",
791
+ "clearingtype": "wlt",
792
+ "wallettype": "GGP",
793
+ "googlePayToken": "BASE64_ENCODED_TOKEN",
794
+ "firstname": "John",
795
+ "lastname": "Doe",
796
+ "email": "john.doe@example.com",
797
+ "street": "Main Street 123",
798
+ "zip": "12345",
799
+ "city": "Berlin",
800
+ "country": "DE",
801
+ "shipping_firstname": "John",
802
+ "shipping_lastname": "Doe",
803
+ "shipping_street": "Main Street 123",
804
+ "shipping_zip": "12345",
805
+ "shipping_city": "Berlin",
806
+ "shipping_country": "DE",
807
+ "successurl": "https://www.example.com/success",
808
+ "errorurl": "https://www.example.com/error",
809
+ "backurl": "https://www.example.com/back"
810
+ }
811
+ ```
812
+
813
+ **Response**:
814
+
815
+ ```json
816
+ {
817
+ "data": {
818
+ "status": "APPROVED",
819
+ "txid": "123456789"
820
+ }
821
+ }
822
+ ```
823
+
824
+ #### Capture
825
+
826
+ **URL**: `POST /api/strapi-plugin-payone-provider/capture`
827
+
828
+ **Request Body**:
829
+
830
+ ```json
831
+ {
832
+ "txid": "123456789",
833
+ "amount": 1000,
834
+ "currency": "EUR",
835
+ "sequencenumber": 1
836
+ }
837
+ ```
838
+
839
+ **Response**:
840
+
841
+ ```json
842
+ {
843
+ "data": {
844
+ "status": "APPROVED",
845
+ "txid": "123456789"
846
+ }
847
+ }
848
+ ```
849
+
850
+ #### Refund
851
+
852
+ **URL**: `POST /api/strapi-plugin-payone-provider/refund`
853
+
854
+ **Request Body**:
855
+
856
+ ```json
857
+ {
858
+ "txid": "123456789",
859
+ "amount": -1000,
860
+ "currency": "EUR",
861
+ "reference": "REF1234567890ABCDEF",
862
+ "sequencenumber": 2
863
+ }
864
+ ```
865
+
866
+ **Response**:
867
+
868
+ ```json
869
+ {
870
+ "data": {
871
+ "status": "APPROVED",
872
+ "txid": "123456789"
873
+ }
874
+ }
875
+ ```
876
+
877
+ #### Required Parameters for Google Pay
878
+
879
+ - `clearingtype`: Must be `"wlt"` (wallet)
880
+ - `wallettype`: Must be `"GGP"` (Google Pay)
881
+ - `add_paydata[paymentmethod_token_data]`: Base64 encoded Google Pay token (automatically added by plugin)
882
+ - `add_paydata[paymentmethod]`: `"GGP"` (automatically added by plugin)
883
+ - `add_paydata[paymentmethod_type]`: `"GOOGLEPAY"` (automatically added by plugin)
884
+ - `add_paydata[gatewayid]`: `"payonegmbh"` (automatically added by plugin)
885
+ - `add_paydata[gateway_merchantid]`: Your Payone Merchant ID (automatically added by plugin)
886
+ - Shipping address parameters (required for wallet payments)
887
+
888
+ </details>
889
+
890
+ ---
891
+
892
+ ### Apple Pay
893
+
894
+ <details>
895
+ <summary><strong>Apple Pay Payment Method</strong></summary>
896
+
897
+ #### Preauthorization
898
+
899
+ **URL**: `POST /api/strapi-plugin-payone-provider/preauthorization`
900
+
901
+ **Request Body**:
902
+
903
+ ```json
904
+ {
905
+ "amount": 1000,
906
+ "currency": "EUR",
907
+ "reference": "PAY1234567890ABCDEF",
908
+ "clearingtype": "wlt",
909
+ "wallettype": "APL",
910
+ "firstname": "John",
911
+ "lastname": "Doe",
912
+ "email": "john.doe@example.com",
913
+ "telephonenumber": "+4917512345678",
914
+ "street": "Main Street 123",
915
+ "zip": "12345",
916
+ "city": "Berlin",
917
+ "country": "DE",
918
+ "shipping_firstname": "John",
919
+ "shipping_lastname": "Doe",
920
+ "shipping_street": "Main Street 123",
921
+ "shipping_zip": "12345",
922
+ "shipping_city": "Berlin",
923
+ "shipping_country": "DE",
924
+ "successurl": "https://www.example.com/success",
925
+ "errorurl": "https://www.example.com/error",
926
+ "backurl": "https://www.example.com/back",
927
+ "salutation": "Herr",
928
+ "gender": "m",
929
+ "ip": "127.0.0.1",
930
+ "language": "de",
931
+ "customer_is_present": "yes"
932
+ }
933
+ ```
934
+
935
+ **Response**:
936
+
937
+ ```json
938
+ {
939
+ "data": {
940
+ "status": "REDIRECT",
941
+ "txid": "123456789",
942
+ "redirecturl": "https://secure.pay1.de/redirect/..."
943
+ }
944
+ }
945
+ ```
946
+
947
+ #### Authorization
948
+
949
+ **URL**: `POST /api/strapi-plugin-payone-provider/authorization`
950
+
951
+ **Request Body**: (Same as Preauthorization)
952
+
953
+ ```json
954
+ {
955
+ "amount": 1000,
956
+ "currency": "EUR",
957
+ "reference": "PAY1234567890ABCDEF",
958
+ "clearingtype": "wlt",
959
+ "wallettype": "APL",
960
+ "firstname": "John",
961
+ "lastname": "Doe",
962
+ "email": "john.doe@example.com",
963
+ "telephonenumber": "+4917512345678",
964
+ "street": "Main Street 123",
965
+ "zip": "12345",
966
+ "city": "Berlin",
967
+ "country": "DE",
968
+ "shipping_firstname": "John",
969
+ "shipping_lastname": "Doe",
970
+ "shipping_street": "Main Street 123",
971
+ "shipping_zip": "12345",
972
+ "shipping_city": "Berlin",
973
+ "shipping_country": "DE",
974
+ "successurl": "https://www.example.com/success",
975
+ "errorurl": "https://www.example.com/error",
976
+ "backurl": "https://www.example.com/back",
977
+ "salutation": "Herr",
978
+ "gender": "m",
979
+ "ip": "127.0.0.1",
980
+ "language": "de",
981
+ "customer_is_present": "yes"
982
+ }
983
+ ```
984
+
985
+ **Response**:
986
+
987
+ ```json
988
+ {
989
+ "data": {
990
+ "status": "REDIRECT",
991
+ "txid": "123456789",
992
+ "redirecturl": "https://secure.pay1.de/redirect/..."
993
+ }
994
+ }
995
+ ```
996
+
997
+ #### Capture
998
+
999
+ **URL**: `POST /api/strapi-plugin-payone-provider/capture`
1000
+
1001
+ **Request Body**:
1002
+
1003
+ ```json
1004
+ {
1005
+ "txid": "123456789",
1006
+ "amount": 1000,
1007
+ "currency": "EUR",
1008
+ "sequencenumber": 1,
1009
+ "capturemode": "full"
1010
+ }
1011
+ ```
1012
+
1013
+ **Response**:
1014
+
1015
+ ```json
1016
+ {
1017
+ "data": {
1018
+ "status": "APPROVED",
1019
+ "txid": "123456789"
1020
+ }
1021
+ }
1022
+ ```
1023
+
1024
+ #### Refund
1025
+
1026
+ **URL**: `POST /api/strapi-plugin-payone-provider/refund`
1027
+
1028
+ **Request Body**:
1029
+
1030
+ ```json
1031
+ {
1032
+ "txid": "123456789",
1033
+ "amount": -1000,
1034
+ "currency": "EUR",
1035
+ "reference": "REF1234567890ABCDEF",
1036
+ "sequencenumber": 2
1037
+ }
1038
+ ```
1039
+
1040
+ **Response**:
1041
+
1042
+ ```json
1043
+ {
1044
+ "data": {
1045
+ "status": "APPROVED",
1046
+ "txid": "123456789"
1047
+ }
1048
+ }
616
1049
  ```
617
1050
 
618
- Then restart your Strapi application.
1051
+ </details>
619
1052
 
620
1053
  ---
621
1054
 
622
- **Made with ❤️ for Strapi**
1055
+ ### SEPA Direct Debit
1056
+
1057
+ <details>
1058
+ <summary><strong>SEPA Direct Debit Payment Method</strong></summary>
1059
+
1060
+ #### Preauthorization
1061
+
1062
+ **URL**: `POST /api/strapi-plugin-payone-provider/preauthorization`
1063
+
1064
+ **Request Body**:
1065
+
1066
+ ```json
1067
+ {
1068
+ "amount": 1000,
1069
+ "currency": "EUR",
1070
+ "reference": "PAY1234567890ABCDEF",
1071
+ "clearingtype": "elv",
1072
+ "iban": "DE89370400440532013000",
1073
+ "bic": "COBADEFFXXX",
1074
+ "bankaccountholder": "John Doe",
1075
+ "bankcountry": "DE",
1076
+ "firstname": "John",
1077
+ "lastname": "Doe",
1078
+ "email": "john.doe@example.com",
1079
+ "telephonenumber": "+4917512345678",
1080
+ "street": "Main Street 123",
1081
+ "zip": "12345",
1082
+ "city": "Berlin",
1083
+ "country": "DE",
1084
+ "salutation": "Herr",
1085
+ "gender": "m",
1086
+ "ip": "127.0.0.1",
1087
+ "language": "de",
1088
+ "customer_is_present": "yes"
1089
+ }
1090
+ ```
1091
+
1092
+ **Response**:
1093
+
1094
+ ```json
1095
+ {
1096
+ "data": {
1097
+ "status": "APPROVED",
1098
+ "txid": "123456789",
1099
+ "userid": "987654321"
1100
+ }
1101
+ }
1102
+ ```
1103
+
1104
+ #### Authorization
1105
+
1106
+ **URL**: `POST /api/strapi-plugin-payone-provider/authorization`
1107
+
1108
+ **Request Body**: (Same as Preauthorization)
1109
+
1110
+ ```json
1111
+ {
1112
+ "amount": 1000,
1113
+ "currency": "EUR",
1114
+ "reference": "PAY1234567890ABCDEF",
1115
+ "clearingtype": "elv",
1116
+ "iban": "DE89370400440532013000",
1117
+ "bic": "COBADEFFXXX",
1118
+ "bankaccountholder": "John Doe",
1119
+ "bankcountry": "DE",
1120
+ "firstname": "John",
1121
+ "lastname": "Doe",
1122
+ "email": "john.doe@example.com",
1123
+ "telephonenumber": "+4917512345678",
1124
+ "street": "Main Street 123",
1125
+ "zip": "12345",
1126
+ "city": "Berlin",
1127
+ "country": "DE",
1128
+ "salutation": "Herr",
1129
+ "gender": "m",
1130
+ "ip": "127.0.0.1",
1131
+ "language": "de",
1132
+ "customer_is_present": "yes"
1133
+ }
1134
+ ```
1135
+
1136
+ **Response**:
1137
+
1138
+ ```json
1139
+ {
1140
+ "data": {
1141
+ "status": "APPROVED",
1142
+ "txid": "123456789",
1143
+ "userid": "987654321"
1144
+ }
1145
+ }
1146
+ ```
1147
+
1148
+ #### Capture
1149
+
1150
+ **URL**: `POST /api/strapi-plugin-payone-provider/capture`
1151
+
1152
+ **Request Body**:
1153
+
1154
+ ```json
1155
+ {
1156
+ "txid": "123456789",
1157
+ "amount": 1000,
1158
+ "currency": "EUR",
1159
+ "sequencenumber": 1
1160
+ }
1161
+ ```
1162
+
1163
+ **Response**:
1164
+
1165
+ ```json
1166
+ {
1167
+ "data": {
1168
+ "status": "APPROVED",
1169
+ "txid": "123456789"
1170
+ }
1171
+ }
1172
+ ```
1173
+
1174
+ #### Refund
1175
+
1176
+ **URL**: `POST /api/strapi-plugin-payone-provider/refund`
1177
+
1178
+ **Request Body**:
1179
+
1180
+ ```json
1181
+ {
1182
+ "txid": "123456789",
1183
+ "amount": -1000,
1184
+ "currency": "EUR",
1185
+ "reference": "REF1234567890ABCDEF",
1186
+ "sequencenumber": 2
1187
+ }
1188
+ ```
1189
+
1190
+ **Response**:
1191
+
1192
+ ```json
1193
+ {
1194
+ "data": {
1195
+ "status": "APPROVED",
1196
+ "txid": "123456789"
1197
+ }
1198
+ }
1199
+ ```
1200
+
1201
+ </details>
1202
+
1203
+ ---
1204
+
1205
+ ### Sofort Banking
1206
+
1207
+ <details>
1208
+ <summary><strong>Sofort Banking Payment Method</strong></summary>
1209
+
1210
+ #### Preauthorization
1211
+
1212
+ **URL**: `POST /api/strapi-plugin-payone-provider/preauthorization`
1213
+
1214
+ **Request Body**:
1215
+
1216
+ ```json
1217
+ {
1218
+ "amount": 1000,
1219
+ "currency": "EUR",
1220
+ "reference": "PAY1234567890ABCDEF",
1221
+ "clearingtype": "sb",
1222
+ "onlinebanktransfertype": "PNT",
1223
+ "bankcountry": "DE",
1224
+ "firstname": "John",
1225
+ "lastname": "Doe",
1226
+ "email": "john.doe@example.com",
1227
+ "telephonenumber": "+4917512345678",
1228
+ "street": "Main Street 123",
1229
+ "zip": "12345",
1230
+ "city": "Berlin",
1231
+ "country": "DE",
1232
+ "successurl": "https://www.example.com/success",
1233
+ "errorurl": "https://www.example.com/error",
1234
+ "backurl": "https://www.example.com/back",
1235
+ "salutation": "Herr",
1236
+ "gender": "m",
1237
+ "ip": "127.0.0.1",
1238
+ "language": "de",
1239
+ "customer_is_present": "yes"
1240
+ }
1241
+ ```
1242
+
1243
+ **Response**:
1244
+
1245
+ ```json
1246
+ {
1247
+ "data": {
1248
+ "status": "REDIRECT",
1249
+ "txid": "123456789",
1250
+ "redirecturl": "https://secure.pay1.de/redirect/..."
1251
+ }
1252
+ }
1253
+ ```
1254
+
1255
+ #### Authorization
1256
+
1257
+ **URL**: `POST /api/strapi-plugin-payone-provider/authorization`
1258
+
1259
+ **Request Body**: (Same as Preauthorization)
1260
+
1261
+ ```json
1262
+ {
1263
+ "amount": 1000,
1264
+ "currency": "EUR",
1265
+ "reference": "PAY1234567890ABCDEF",
1266
+ "clearingtype": "sb",
1267
+ "onlinebanktransfertype": "PNT",
1268
+ "bankcountry": "DE",
1269
+ "firstname": "John",
1270
+ "lastname": "Doe",
1271
+ "email": "john.doe@example.com",
1272
+ "telephonenumber": "+4917512345678",
1273
+ "street": "Main Street 123",
1274
+ "zip": "12345",
1275
+ "city": "Berlin",
1276
+ "country": "DE",
1277
+ "successurl": "https://www.example.com/success",
1278
+ "errorurl": "https://www.example.com/error",
1279
+ "backurl": "https://www.example.com/back",
1280
+ "salutation": "Herr",
1281
+ "gender": "m",
1282
+ "ip": "127.0.0.1",
1283
+ "language": "de",
1284
+ "customer_is_present": "yes"
1285
+ }
1286
+ ```
1287
+
1288
+ **Response**:
1289
+
1290
+ ```json
1291
+ {
1292
+ "data": {
1293
+ "status": "REDIRECT",
1294
+ "txid": "123456789",
1295
+ "redirecturl": "https://secure.pay1.de/redirect/..."
1296
+ }
1297
+ }
1298
+ ```
1299
+
1300
+ #### Capture
1301
+
1302
+ **URL**: `POST /api/strapi-plugin-payone-provider/capture`
1303
+
1304
+ **Request Body**:
1305
+
1306
+ ```json
1307
+ {
1308
+ "txid": "123456789",
1309
+ "amount": 1000,
1310
+ "currency": "EUR",
1311
+ "sequencenumber": 1
1312
+ }
1313
+ ```
1314
+
1315
+ **Response**:
1316
+
1317
+ ```json
1318
+ {
1319
+ "data": {
1320
+ "status": "APPROVED",
1321
+ "txid": "123456789"
1322
+ }
1323
+ }
1324
+ ```
1325
+
1326
+ #### Refund
1327
+
1328
+ **URL**: `POST /api/strapi-plugin-payone-provider/refund`
1329
+
1330
+ **Request Body**:
1331
+
1332
+ ```json
1333
+ {
1334
+ "txid": "123456789",
1335
+ "amount": -1000,
1336
+ "currency": "EUR",
1337
+ "reference": "REF1234567890ABCDEF",
1338
+ "sequencenumber": 2
1339
+ }
1340
+ ```
1341
+
1342
+ **Response**:
1343
+
1344
+ ```json
1345
+ {
1346
+ "data": {
1347
+ "status": "APPROVED",
1348
+ "txid": "123456789"
1349
+ }
1350
+ }
1351
+ ```
1352
+
1353
+ </details>
1354
+
1355
+ ---
1356
+
1357
+ ## ✅ Supported Payment Methods
1358
+
1359
+ Click on any payment method to see detailed API documentation:
1360
+
1361
+ - [Credit Card](#credit-card)
1362
+ - [PayPal](#paypal)
1363
+ - [Google Pay](#google-pay)
1364
+ - [Apple Pay](#apple-pay)
1365
+ - [SEPA Direct Debit](#sepa-direct-debit)
1366
+ - [Sofort Banking](#sofort-banking)
1367
+
1368
+ ---
1369
+
1370
+ ## 📝 Notes
1371
+
1372
+ ### Important Parameters
1373
+
1374
+ - **amount**: Always in cents (e.g., 1000 = 10.00 EUR)
1375
+ - **reference**: Max 20 characters, alphanumeric only. Auto-normalized by the plugin.
1376
+ - **cardexpiredate**: Format is YYMM (e.g., "2512" = December 2025)
1377
+ - **sequencenumber**: Start with 1 for capture, 2 for first refund, increment for subsequent refunds
1378
+ - **Refund amount**: Must be negative (e.g., -1000 for 10.00 EUR refund)
1379
+
1380
+ ### Redirect URLs
1381
+
1382
+ For redirect-based payment methods (PayPal, Google Pay, Apple Pay, Sofort), you must provide:
1383
+
1384
+ - `successurl`: URL to redirect after successful payment
1385
+ - `errorurl`: URL to redirect after payment error
1386
+ - `backurl`: URL to redirect if user cancels payment
1387
+
1388
+ ### Preauthorization vs Authorization
1389
+
1390
+ - **Preauthorization**: Reserves funds but doesn't charge immediately. Requires a Capture call later.
1391
+ - **Authorization**: Immediately charges the customer's payment method.
1392
+
1393
+ ### Capture Mode
1394
+
1395
+ For wallet payments (PayPal, Google Pay, Apple Pay), you can specify:
1396
+
1397
+ - `capturemode: "full"`: Capture the entire preauthorized amount
1398
+ - `capturemode: "partial"`: Capture less than the preauthorized amount