strapi-plugin-payone-provider 5.7.26 → 5.8.27

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 (83) hide show
  1. package/README.md +1191 -1191
  2. package/admin/src/components/Initializer/index.jsx +16 -16
  3. package/admin/src/components/PluginIcon/index.jsx +17 -17
  4. package/admin/src/index.js +57 -57
  5. package/admin/src/pages/App/components/AppHeader.jsx +45 -45
  6. package/admin/src/pages/App/components/AppTabs.jsx +105 -105
  7. package/admin/src/pages/App/components/ApplePayBtn.jsx +355 -355
  8. package/admin/src/pages/App/components/ApplePayConfig.jsx +357 -357
  9. package/admin/src/pages/App/components/DocsPanel.jsx +53 -53
  10. package/admin/src/pages/App/components/RenderInput.jsx +78 -78
  11. package/admin/src/pages/App/components/StatusBadge.jsx +87 -87
  12. package/admin/src/pages/App/components/icons/BankIcon.jsx +10 -10
  13. package/admin/src/pages/App/components/icons/ChevronDownIcon.jsx +9 -9
  14. package/admin/src/pages/App/components/icons/ChevronUpIcon.jsx +9 -9
  15. package/admin/src/pages/App/components/icons/CreditCardIcon.jsx +9 -9
  16. package/admin/src/pages/App/components/icons/ErrorIcon.jsx +10 -10
  17. package/admin/src/pages/App/components/icons/InfoIcon.jsx +9 -9
  18. package/admin/src/pages/App/components/icons/MarkCircle.jsx +19 -19
  19. package/admin/src/pages/App/components/icons/PaymentIcon.jsx +10 -10
  20. package/admin/src/pages/App/components/icons/PendingIcon.jsx +9 -9
  21. package/admin/src/pages/App/components/icons/PersonIcon.jsx +9 -9
  22. package/admin/src/pages/App/components/icons/SuccessIcon.jsx +9 -9
  23. package/admin/src/pages/App/components/icons/WalletIcon.jsx +9 -9
  24. package/admin/src/pages/App/components/icons/index.jsx +12 -12
  25. package/admin/src/pages/App/components/payment-actions/AuthorizationForm.jsx +334 -334
  26. package/admin/src/pages/App/components/payment-actions/CaptureForm.jsx +120 -120
  27. package/admin/src/pages/App/components/payment-actions/PaymentActionsPanel.jsx +183 -183
  28. package/admin/src/pages/App/components/payment-actions/PaymentMethodSelector.jsx +315 -315
  29. package/admin/src/pages/App/components/payment-actions/PaymentResult.jsx +129 -129
  30. package/admin/src/pages/App/components/payment-actions/PreauthorizationForm.jsx +273 -273
  31. package/admin/src/pages/App/components/payment-actions/RefundForm.jsx +114 -114
  32. package/admin/src/pages/App/components/transaction-history/ImportExportBar.jsx +153 -153
  33. package/admin/src/pages/App/components/transaction-history/details/TransactionHistoryItem.jsx +526 -526
  34. package/admin/src/pages/App/index.jsx +96 -96
  35. package/admin/src/pages/App/styles.css +176 -176
  36. package/admin/src/pages/constants/paymentConstants.js +71 -71
  37. package/admin/src/pages/hooks/use-system-theme.js +27 -27
  38. package/admin/src/pages/hooks/usePaymentActions.js +498 -498
  39. package/admin/src/pages/hooks/usePluginTranslations.js +12 -12
  40. package/admin/src/pages/hooks/useSettings.js +183 -183
  41. package/admin/src/pages/hooks/useTransactionHistory.js +148 -148
  42. package/admin/src/pages/utils/api.js +97 -97
  43. package/admin/src/pages/utils/applePayConstants.js +196 -196
  44. package/admin/src/pages/utils/formatTransactionData.js +15 -15
  45. package/admin/src/pages/utils/getInputComponent.jsx +200 -200
  46. package/admin/src/pages/utils/paymentUtils.js +661 -661
  47. package/admin/src/pages/utils/tooltipHelpers.js +18 -18
  48. package/admin/src/pages/utils/transactionTableUtils.js +71 -71
  49. package/admin/src/pluginId.js +9 -9
  50. package/admin/src/translations/de.json +235 -235
  51. package/admin/src/translations/en.json +235 -235
  52. package/admin/src/translations/fr.json +235 -235
  53. package/admin/src/translations/ru.json +235 -235
  54. package/admin/src/utils/prefixPluginTranslations.js +13 -13
  55. package/package.json +45 -45
  56. package/server/bootstrap.js +107 -107
  57. package/server/config/index.js +83 -83
  58. package/server/content-types/index.js +4 -4
  59. package/server/content-types/transactions/index.js +4 -4
  60. package/server/content-types/transactions/schema.json +86 -86
  61. package/server/controllers/index.js +7 -7
  62. package/server/controllers/payone.js +503 -506
  63. package/server/destroy.js +5 -5
  64. package/server/index.js +23 -23
  65. package/server/policies/index.js +7 -7
  66. package/server/policies/is-auth.js +29 -29
  67. package/server/policies/isSuperAdmin.js +20 -20
  68. package/server/register.js +5 -5
  69. package/server/routes/index.js +218 -218
  70. package/server/services/applePayService.js +295 -295
  71. package/server/services/index.js +9 -9
  72. package/server/services/paymentService.js +266 -223
  73. package/server/services/payone.js +78 -78
  74. package/server/services/settingsService.js +59 -59
  75. package/server/services/testConnectionService.js +115 -115
  76. package/server/services/transactionService.js +262 -262
  77. package/server/utils/csvTransactions.js +82 -82
  78. package/server/utils/normalize.js +39 -39
  79. package/server/utils/paymentMethodParams.js +288 -288
  80. package/server/utils/requestBuilder.js +115 -100
  81. package/server/utils/responseParser.js +141 -141
  82. package/strapi-admin.js +4 -4
  83. package/strapi-server.js +3 -3
package/README.md CHANGED
@@ -1,1191 +1,1191 @@
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
- - [Using the Admin Panel](#using-the-admin-panel-recommended)
12
- - [Apple Pay Setup](#apple-pay-setup)
13
- - [Google Pay Configuration](#google-pay-configuration)
14
- - [Usage](#usage)
15
- - [Base URL](#base-url)
16
- - [Common Request Headers](#common-request-headers)
17
- - [Common Response Fields](#common-response-fields)
18
- - [Payment Methods & Operations](#payment-methods--operations)
19
- - [Credit Card](#credit-card)
20
- - [PayPal](#paypal)
21
- - [Google Pay](#google-pay)
22
- - [Apple Pay](#apple-pay)
23
- - [SEPA Direct Debit](#sepa-direct-debit)
24
- - [Sofort Banking](#sofort-banking)
25
- - [TransactionStatus Notifications](#transactionstatus-notifications)
26
- - [Notes](#notes)
27
-
28
- ## Features
29
-
30
- - **Payone API Integration**: Full integration with Payone's Server API (v3.10)
31
- - **Payment Operations**:
32
- - Preauthorization (reserve funds)
33
- - Authorization (immediate charge)
34
- - Capture (complete preauthorized transactions)
35
- - Refund (return funds to customers)
36
- - **Admin Panel**:
37
- - Easy configuration interface
38
- - Transaction history viewer with filtering
39
- - Payment testing tools
40
- - Connection testing
41
- - **Transaction Logging**: Automatic logging of all payment operations
42
- - **Security**: Secure credential storage with masked API keys
43
-
44
- ## Requirements
45
-
46
- Before installing this plugin, ensure you have:
47
-
48
- - **Strapi**:
49
- - Version 5.x.x for plugin version 5.x.x
50
- - Version 4.6.0 or higher for plugin version 4.x.x
51
- - **Node.js**: Version 18.0.0 to 20.x.x
52
- - **npm**: Version 6.0.0 or higher
53
- - **Payone Account**: Active Payone merchant account with API credentials
54
-
55
- ### Payone Credentials
56
-
57
- You will need the following credentials from your Payone account:
58
-
59
- 1. **AID (Account ID)**: Your Payone sub-account identifier
60
- 2. **Portal ID**: Your Payone portal identifier
61
- 3. **Merchant ID (MID)**: Your merchant identifier
62
- 4. **Portal Key**: Your API authentication key (also called "Portal Key" or "Security Key")
63
-
64
- > ℹ️ **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.
65
-
66
- ## Installation
67
-
68
-
69
- **Important**: Choose the correct version based on your Strapi version:
70
-
71
- - **For Strapi 5.x.x**: Use plugin version `^5.x.x`
72
- - **For Strapi 4.x.x**: Use plugin version `^4.x.x`
73
-
74
- ```bash
75
- # npm
76
- npm install strapi-plugin-payone-provider
77
- # yarn
78
- yarn add strapi-plugin-payone-provider
79
- # pnpm
80
- pnpm add strapi-plugin-payone-provider
81
-
82
- ```
83
-
84
- > **Version Compatibility**: Make sure to install the correct plugin version that matches your Strapi version. Using an incompatible version may cause errors or unexpected behavior.
85
-
86
-
87
-
88
- ## Configuration
89
-
90
- After installation, you need to configure your Payone credentials:
91
-
92
- ### Using the Admin Panel (Recommended)
93
-
94
- 1. Open **Payone Provider** in the sidebar menu
95
- 2. Go to the **Configuration** tab
96
- 3. Fill in your Payone credentials and save:
97
- - **Account ID (AID)**: Your Payone account ID
98
- - **Portal ID**: Your Payone portal ID
99
- - **Merchant ID (MID)**: Your merchant ID
100
- - **Portal Key**: Your API security key
101
- - **Mode**: Select `test` for testing or `live` for production
102
- - **API Version**: Leave as `3.10` (default)
103
- 4. Click **"Test Connection"** to verify your credentials
104
-
105
- ### Apple Pay setup
106
-
107
- > ⚠️ **Important**: Apple Pay requires a registered domain with HTTPS. It does NOT work on localhost. For testing, use a production domain with HTTPS or test on a device with Safari (iOS/macOS).
108
-
109
- #### Apple Pay Domain Verification File (.well-known)
110
-
111
- Apple Pay requires a domain verification file to be placed on your server. This file must be accessible at:
112
-
113
- ```
114
- https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
115
- ```
116
-
117
- **Steps to set up the domain verification file:**
118
-
119
- 1. **Download the file from Payone:**
120
-
121
- - Download the domain verification file from Payone documentation: [https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev](https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev)
122
- - Alternatively, log into your Payone Merchant Interface (PMI)
123
- - Navigate to **Configuration** → **Payment Portals** → **Apple Pay**
124
-
125
- 2. **Place the file in Strapi:**
126
-
127
- - Create the directory: `public/.well-known/` (if it doesn't exist)
128
- - Place the file at: `public/.well-known/apple-developer-merchantid-domain-association`
129
-
130
- 3. **Place the file in your Frontend (if separate):**
131
-
132
- - Create the directory: `public/.well-known/` (if it doesn't exist)
133
- - Place the file at: `public/.well-known/apple-developer-merchantid-domain-association`
134
-
135
- 4. **Verify accessibility:**
136
- - The file must be accessible via HTTPS at: `https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association`
137
- - Test by visiting the URL in your browser - you should see the file content
138
-
139
- > ⚠️ **Critical**: Without this file, Apple Pay will NOT work on your domain. The file must be accessible via HTTPS and must match exactly what Payone provides.
140
-
141
- #### Middleware Configuration for Apple Pay
142
-
143
- Apple Pay requires Content Security Policy (CSP) configuration in `config/middlewares.js` to allow Apple Pay scripts. Without this configuration, Apple Pay will NOT work on your strapi admin for make test transaction.
144
-
145
- **Required CSP directives:**
146
-
147
- ```javascript
148
- module.exports = [
149
- "strapi::logger",
150
- "strapi::errors",
151
- {
152
- name: "strapi::security",
153
- config: {
154
- contentSecurityPolicy: {
155
- useDefaults: true,
156
- directives: {
157
- "script-src": [
158
- "'self'",
159
- "'unsafe-inline'",
160
- "'unsafe-eval'",
161
- "https://applepay.cdn-apple.com", // Apple Pay SDK
162
- "https://www.apple.com", // Apple Pay manifest
163
- ],
164
- "connect-src": [
165
- "'self'",
166
- "https:",
167
- "https://applepay.cdn-apple.com", // Apple Pay API
168
- "https://www.apple.com", // Apple Pay manifest
169
- ],
170
- "frame-src": [
171
- "'self'",
172
- "https://applepay.cdn-apple.com", // Apple Pay iframe
173
- ],
174
- },
175
- },
176
- },
177
- },
178
- // ... other middlewares
179
- ];
180
- ```
181
-
182
- > ⚠️ **Important**: Without this middleware configuration, Apple Pay scripts will be blocked and Apple Pay will NOT work!
183
-
184
- ### Google Pay Configuration
185
-
186
-
187
- #### Middleware Configuration for Google Pay
188
-
189
- Google Pay requires Content Security Policy (CSP) configuration in `config/middlewares.js` to allow Google Pay scripts. Without this configuration, Google Pay will NOT work on your strapi admin for make test transactions.
190
-
191
- **Required CSP directives:**
192
-
193
- ```javascript
194
- module.exports = [
195
- "strapi::logger",
196
- "strapi::errors",
197
- {
198
- name: "strapi::security",
199
- config: {
200
- contentSecurityPolicy: {
201
- useDefaults: true,
202
- directives: {
203
- "script-src": [
204
- "'self'",
205
- "'unsafe-inline'",
206
- "'unsafe-eval'",
207
- "https://pay.google.com", // Google Pay SDK
208
- ],
209
- "connect-src": [
210
- "'self'",
211
- "https:",
212
- "https://pay.google.com", // Google Pay API
213
- ],
214
- "frame-src": [
215
- "'self'",
216
- "https://pay.google.com", // Google Pay iframe
217
- ],
218
- },
219
- },
220
- },
221
- },
222
- // ... other middlewares
223
- ];
224
- ```
225
-
226
- > ⚠️ **Important**: Without this middleware configuration, Google Pay scripts will be blocked and Google Pay will NOT work!
227
-
228
-
229
- ## Usage
230
-
231
- ### Base URL
232
-
233
- All API endpoints are available at:
234
-
235
- **Content API (Frontend)**: `/api/strapi-plugin-payone-provider`
236
-
237
- **Admin API**: `/strapi-plugin-payone-provider`
238
-
239
- > ⚠️ **Authentication Required**: All endpoints require authentication. Include your Bearer token in the Authorization header.
240
-
241
- ### Common Request Headers
242
-
243
- ```javascript
244
- {
245
- "Content-Type": "application/json",
246
- "Authorization": "Bearer YOUR_AUTH_TOKEN"
247
- }
248
- ```
249
-
250
- ### Common Response Fields
251
-
252
- All responses include:
253
-
254
- - `status`: Transaction status (APPROVED, ERROR, REDIRECT, etc.)
255
- - `txid`: Transaction ID (for successful transactions)
256
- - `errorcode`: Error code (if status is ERROR)
257
- - `errormessage`: Error message (if status is ERROR)
258
-
259
- ---
260
-
261
- ## Payment Methods & Operations
262
-
263
- This section provides detailed API documentation for each supported payment method. Click on any payment method below to see the full implementation details:
264
-
265
- ### Credit Card
266
-
267
- <details>
268
- <summary><strong>Credit Card Payment Method</strong></summary>
269
-
270
- #### Preauthorization/Authorization
271
-
272
- **Endpoints:**
273
- - `POST /api/strapi-plugin-payone-provider/preauthorization`
274
- - `POST /api/strapi-plugin-payone-provider/authorization`
275
-
276
- **Request Body**:
277
-
278
- ```json
279
- {
280
- "amount": 1000,
281
- "currency": "EUR",
282
- "reference": "PAY1234567890ABCDEF",
283
- "clearingtype": "cc",
284
- "cardtype": "V",
285
- "cardpan": "4111111111111111",
286
- "cardexpiredate": "2512",
287
- "cardcvc2": "123",
288
- "firstname": "John",
289
- "lastname": "Doe",
290
- "email": "john.doe@example.com",
291
- "telephonenumber": "+4917512345678",
292
- "street": "Main Street 123",
293
- "zip": "12345",
294
- "city": "Berlin",
295
- "country": "DE",
296
- "successurl": "https://www.example.com/success",
297
- "errorurl": "https://www.example.com/error",
298
- "backurl": "https://www.example.com/back",
299
- "salutation": "Herr",
300
- "gender": "m",
301
- "ip": "127.0.0.1",
302
- "language": "de",
303
- "customer_is_present": "yes"
304
- }
305
- ```
306
-
307
- **Response**:
308
-
309
- ```json
310
- {
311
- "data": {
312
- "status": "APPROVED",
313
- "txid": "123456789",
314
- "userid": "987654321"
315
- }
316
- }
317
- ```
318
-
319
- #### Capture
320
-
321
- **Endpoint:**
322
- - `POST /api/strapi-plugin-payone-provider/capture`
323
-
324
- **Request Body**:
325
-
326
- ```json
327
- {
328
- "txid": "123456789",
329
- "amount": 1000,
330
- "currency": "EUR",
331
- "sequencenumber": 1
332
- }
333
- ```
334
-
335
- **Response**:
336
-
337
- ```json
338
- {
339
- "data": {
340
- "status": "APPROVED",
341
- "txid": "123456789"
342
- }
343
- }
344
- ```
345
-
346
- #### Refund
347
-
348
- **Endpoint:**
349
- - `POST /api/strapi-plugin-payone-provider/refund`
350
-
351
- **Request Body**:
352
-
353
- ```json
354
- {
355
- "txid": "123456789",
356
- "amount": -1000,
357
- "currency": "EUR",
358
- "reference": "REF1234567890ABCDEF",
359
- "sequencenumber": 2
360
- }
361
- ```
362
-
363
- **Response**:
364
-
365
- ```json
366
- {
367
- "data": {
368
- "status": "APPROVED",
369
- "txid": "123456789"
370
- }
371
- }
372
- ```
373
-
374
- </details>
375
-
376
- ---
377
-
378
- ### PayPal
379
-
380
- <details>
381
- <summary><strong>PayPal Payment Method</strong></summary>
382
-
383
- #### Preauthorization/Authorization
384
-
385
- **Endpoints:**
386
- - `POST /api/strapi-plugin-payone-provider/preauthorization`
387
- - `POST /api/strapi-plugin-payone-provider/authorization`
388
-
389
- **Request Body**:
390
-
391
- ```json
392
- {
393
- "amount": 1000,
394
- "currency": "EUR",
395
- "reference": "PAY1234567890ABCDEF",
396
- "clearingtype": "wlt",
397
- "wallettype": "PPE",
398
- "firstname": "John",
399
- "lastname": "Doe",
400
- "email": "john.doe@example.com",
401
- "telephonenumber": "+4917512345678",
402
- "street": "Main Street 123",
403
- "zip": "12345",
404
- "city": "Berlin",
405
- "country": "DE",
406
- "shipping_firstname": "John",
407
- "shipping_lastname": "Doe",
408
- "shipping_street": "Main Street 123",
409
- "shipping_zip": "12345",
410
- "shipping_city": "Berlin",
411
- "shipping_country": "DE",
412
- "successurl": "https://www.example.com/success",
413
- "errorurl": "https://www.example.com/error",
414
- "backurl": "https://www.example.com/back",
415
- "salutation": "Herr",
416
- "gender": "m",
417
- "ip": "127.0.0.1",
418
- "language": "de",
419
- "customer_is_present": "yes"
420
- }
421
- ```
422
-
423
- **Response**:
424
-
425
- ```json
426
- {
427
- "data": {
428
- "status": "REDIRECT",
429
- "txid": "123456789",
430
- "redirecturl": "https://secure.pay1.de/redirect/..."
431
- }
432
- }
433
- ```
434
-
435
-
436
- #### Capture
437
-
438
- **Endpoint:**
439
- - `POST /api/strapi-plugin-payone-provider/capture`
440
-
441
- **Request Body**:
442
-
443
- ```json
444
- {
445
- "txid": "123456789",
446
- "amount": 1000,
447
- "currency": "EUR",
448
- "sequencenumber": 1,
449
- "capturemode": "full"
450
- }
451
- ```
452
-
453
- **Response**:
454
-
455
- ```json
456
- {
457
- "data": {
458
- "status": "APPROVED",
459
- "txid": "123456789"
460
- }
461
- }
462
- ```
463
-
464
- #### Refund
465
-
466
- **Endpoint:**
467
- - `POST /api/strapi-plugin-payone-provider/refund`
468
-
469
- **Request Body**:
470
-
471
- ```json
472
- {
473
- "txid": "123456789",
474
- "amount": -1000,
475
- "currency": "EUR",
476
- "reference": "REF1234567890ABCDEF",
477
- "sequencenumber": 2
478
- }
479
- ```
480
-
481
- **Response**:
482
-
483
- ```json
484
- {
485
- "data": {
486
- "status": "APPROVED",
487
- "txid": "123456789"
488
- }
489
- }
490
- ```
491
-
492
- </details>
493
-
494
- ---
495
-
496
- ### Google Pay
497
-
498
- <details>
499
- <summary><strong>Google Pay Payment Method</strong></summary>
500
-
501
- #### Overview
502
-
503
- 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.
504
-
505
- #### Getting Google Pay Token
506
-
507
- **1. Include Google Pay Script**
508
-
509
- ```html
510
- <script async src="https://pay.google.com/gp/p/js/pay.js"></script>
511
- ```
512
-
513
- **2. Initialize Google Pay**
514
-
515
- ```javascript
516
- const paymentsClient = new google.payments.api.PaymentsClient({
517
- environment: "TEST", // or "PRODUCTION" for live mode
518
- });
519
-
520
- const baseRequest = {
521
- apiVersion: 2,
522
- apiVersionMinor: 0,
523
- };
524
-
525
- const allowedCardNetworks = ["MASTERCARD", "VISA"];
526
- const allowedAuthMethods = ["PAN_ONLY", "CRYPTOGRAM_3DS"];
527
-
528
- const tokenizationSpecification = {
529
- type: "PAYMENT_GATEWAY",
530
- parameters: {
531
- gateway: "payonegmbh",
532
- gatewayMerchantId: "YOUR_PAYONE_MERCHANT_ID", // Use your Payone MID or Portal ID
533
- },
534
- };
535
-
536
- const cardPaymentMethod = {
537
- type: "CARD",
538
- parameters: {
539
- allowedCardNetworks,
540
- allowedAuthMethods,
541
- },
542
- tokenizationSpecification,
543
- };
544
-
545
- const isReadyToPayRequest = Object.assign({}, baseRequest);
546
- isReadyToPayRequest.allowedPaymentMethods = [cardPaymentMethod];
547
-
548
- paymentsClient.isReadyToPay(isReadyToPayRequest).then(function (response) {
549
- if (response.result) {
550
- // Google Pay is available, show button
551
- }
552
- });
553
- ```
554
-
555
- **3. Create Payment Button and Get Token**
556
-
557
- ```javascript
558
- const paymentDataRequest = Object.assign({}, baseRequest);
559
- paymentDataRequest.allowedPaymentMethods = [cardPaymentMethod];
560
- paymentDataRequest.transactionInfo = {
561
- totalPriceStatus: "FINAL",
562
- totalPrice: "10.00",
563
- currencyCode: "EUR",
564
- };
565
- paymentDataRequest.merchantInfo = {
566
- merchantId: "YOUR_GOOGLE_MERCHANT_ID", // Optional: from Google Console
567
- merchantName: "Your Merchant Name",
568
- };
569
-
570
- const button = paymentsClient.createButton({
571
- onClick: async () => {
572
- try {
573
- const paymentData = await paymentsClient.loadPaymentData(
574
- paymentDataRequest
575
- );
576
- const token = paymentData.paymentMethodData.tokenizationData.token;
577
-
578
- // Token is a JSON string, encode it to Base64 for Payone
579
- const base64Token = btoa(unescape(encodeURIComponent(token)));
580
-
581
- // Send to your backend
582
- await fetch("/api/strapi-plugin-payone-provider/preauthorization", {
583
- method: "POST",
584
- headers: {
585
- "Content-Type": "application/json",
586
- Authorization: "Bearer YOUR_TOKEN",
587
- },
588
- body: JSON.stringify({
589
- amount: 1000,
590
- currency: "EUR",
591
- reference: "PAY1234567890ABCDEF",
592
- googlePayToken: base64Token,
593
- }),
594
- });
595
- } catch (error) {
596
- console.error("Google Pay error:", error);
597
- }
598
- },
599
- });
600
-
601
- document.getElementById("google-pay-button").appendChild(button);
602
- ```
603
-
604
- **Token Format**
605
-
606
- The token from Google Pay is a JSON string with the following structure:
607
-
608
- ```json
609
- {
610
- "signature": "MEUCIFr4ETGzv0uLZX3sR+i1ScARXnRBrncyYFDX/TI/VSLCAiEAvC/Q4dqXMQhwcSdg/ZvXj8+up0wXsfHja3V/6z48/vk=",
611
- "intermediateSigningKey": {
612
- "signedKey": "{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7PWUi+e6WPUhNmTSQ2WN006oWlcWy0FtBWizw9sph1wvX9XcXUNRLcfcsmCBfI5IsKQkjAmYxpCSB+L5sIudLw\\u003d\\u003d\",\"keyExpiration\":\"1722393105282\"}",
613
- "signatures": [
614
- "MEUCIQCpU30A3g2pP93IBE5NxgO9ZcJlGF9YPzCZS7H4/IR1CQIgF6+I5t8olT8YsRDUcj7w3R1bvX4ZCcyFXE2+YXa+3H0="
615
- ]
616
- },
617
- "protocolVersion": "ECv2",
618
- "signedMessage": "{\"encryptedMessage\":\"...\",\"ephemeralPublicKey\":\"...\",\"tag\":\"...\"}"
619
- }
620
- ```
621
-
622
- **Important**: The token must be Base64 encoded before sending to Payone.
623
-
624
- #### Preauthorization/Authorization
625
-
626
- **Endpoints:**
627
- - `POST /api/strapi-plugin-payone-provider/preauthorization`
628
- - `POST /api/strapi-plugin-payone-provider/authorization`
629
-
630
- **Request Body**:
631
-
632
- ```json
633
- {
634
- "amount": 1000,
635
- "currency": "EUR",
636
- "reference": "PAY1234567890ABCDEF",
637
- "clearingtype": "wlt",
638
- "wallettype": "GGP",
639
- "firstname": "John",
640
- "lastname": "Doe",
641
- "email": "john.doe@example.com",
642
- "telephonenumber": "+4917512345678",
643
- "street": "Main Street 123",
644
- "zip": "12345",
645
- "city": "Berlin",
646
- "country": "DE",
647
- "shipping_firstname": "John",
648
- "shipping_lastname": "Doe",
649
- "shipping_street": "Main Street 123",
650
- "shipping_zip": "12345",
651
- "shipping_city": "Berlin",
652
- "shipping_country": "DE",
653
- "successurl": "https://www.example.com/success",
654
- "errorurl": "https://www.example.com/error",
655
- "backurl": "https://www.example.com/back",
656
- "googlePayToken": "BASE64_ENCODED_TOKEN",
657
- "salutation": "Herr",
658
- "gender": "m",
659
- "ip": "127.0.0.1",
660
- "language": "de",
661
- "customer_is_present": "yes"
662
- }
663
- ```
664
-
665
- **Payone Request Parameters** (automatically added by plugin):
666
-
667
- ```json
668
- {
669
- "request": "preauthorization",
670
- "amount": 1000,
671
- "currency": "EUR",
672
- "reference": "PAY1234567890ABCDEF",
673
- "clearingtype": "wlt",
674
- "wallettype": "GGP",
675
- "add_paydata[paymentmethod_token_data]": "BASE64_ENCODED_TOKEN",
676
- "add_paydata[paymentmethod]": "GGP",
677
- "add_paydata[paymentmethod_type]": "GOOGLEPAY",
678
- "add_paydata[gatewayid]": "payonegmbh",
679
- "add_paydata[gateway_merchantid]": "YOUR_PAYONE_MERCHANT_ID",
680
- "firstname": "John",
681
- "lastname": "Doe",
682
- "email": "john.doe@example.com",
683
- "street": "Main Street 123",
684
- "zip": "12345",
685
- "city": "Berlin",
686
- "country": "DE",
687
- "shipping_firstname": "John",
688
- "shipping_lastname": "Doe",
689
- "shipping_street": "Main Street 123",
690
- "shipping_zip": "12345",
691
- "shipping_city": "Berlin",
692
- "shipping_country": "DE",
693
- "successurl": "https://www.example.com/success",
694
- "errorurl": "https://www.example.com/error",
695
- "backurl": "https://www.example.com/back"
696
- }
697
- ```
698
-
699
- **Response**:
700
-
701
- ```json
702
- {
703
- "data": {
704
- "status": "APPROVED",
705
- "txid": "123456789"
706
- }
707
- }
708
- ```
709
-
710
-
711
- #### Capture
712
-
713
- **Endpoint:**
714
- - `POST /api/strapi-plugin-payone-provider/capture`
715
-
716
- **Request Body**:
717
-
718
- ```json
719
- {
720
- "txid": "123456789",
721
- "amount": 1000,
722
- "currency": "EUR",
723
- "sequencenumber": 1
724
- }
725
- ```
726
-
727
- **Response**:
728
-
729
- ```json
730
- {
731
- "data": {
732
- "status": "APPROVED",
733
- "txid": "123456789"
734
- }
735
- }
736
- ```
737
-
738
- #### Refund
739
-
740
- **Endpoint:**
741
- - `POST /api/strapi-plugin-payone-provider/refund`
742
-
743
- **Request Body**:
744
-
745
- ```json
746
- {
747
- "txid": "123456789",
748
- "amount": -1000,
749
- "currency": "EUR",
750
- "reference": "REF1234567890ABCDEF",
751
- "sequencenumber": 2
752
- }
753
- ```
754
-
755
- **Response**:
756
-
757
- ```json
758
- {
759
- "data": {
760
- "status": "APPROVED",
761
- "txid": "123456789"
762
- }
763
- }
764
- ```
765
-
766
- #### Required Parameters for Google Pay
767
-
768
- - `clearingtype`: Must be `"wlt"` (wallet)
769
- - `wallettype`: Must be `"GGP"` (Google Pay)
770
- - `add_paydata[paymentmethod_token_data]`: Base64 encoded Google Pay token (automatically added by plugin)
771
- - `add_paydata[paymentmethod]`: `"GGP"` (automatically added by plugin)
772
- - `add_paydata[paymentmethod_type]`: `"GOOGLEPAY"` (automatically added by plugin)
773
- - `add_paydata[gatewayid]`: `"payonegmbh"` (automatically added by plugin)
774
- - `add_paydata[gateway_merchantid]`: Your Payone Merchant ID (automatically added by plugin)
775
- - Shipping address parameters (required for wallet payments)
776
-
777
- </details>
778
-
779
- ---
780
-
781
- ### Apple Pay
782
-
783
- <details>
784
- <summary><strong>Apple Pay Payment Method</strong></summary>
785
-
786
- #### Preauthorization/Authorization
787
-
788
- **Endpoints:**
789
- - `POST /api/strapi-plugin-payone-provider/preauthorization`
790
- - `POST /api/strapi-plugin-payone-provider/authorization`
791
-
792
- **Request Body**:
793
-
794
- ```json
795
- {
796
- "amount": 1000,
797
- "currency": "EUR",
798
- "reference": "PAY1234567890ABCDEF",
799
- "clearingtype": "wlt",
800
- "wallettype": "APL",
801
- "firstname": "John",
802
- "lastname": "Doe",
803
- "email": "john.doe@example.com",
804
- "telephonenumber": "+4917512345678",
805
- "street": "Main Street 123",
806
- "zip": "12345",
807
- "city": "Berlin",
808
- "country": "DE",
809
- "shipping_firstname": "John",
810
- "shipping_lastname": "Doe",
811
- "shipping_street": "Main Street 123",
812
- "shipping_zip": "12345",
813
- "shipping_city": "Berlin",
814
- "shipping_country": "DE",
815
- "successurl": "https://www.example.com/success",
816
- "errorurl": "https://www.example.com/error",
817
- "backurl": "https://www.example.com/back",
818
- "salutation": "Herr",
819
- "gender": "m",
820
- "ip": "127.0.0.1",
821
- "language": "de",
822
- "customer_is_present": "yes"
823
- }
824
- ```
825
-
826
- **Response**:
827
-
828
- ```json
829
- {
830
- "data": {
831
- "status": "REDIRECT",
832
- "txid": "123456789",
833
- "redirecturl": "https://secure.pay1.de/redirect/..."
834
- }
835
- }
836
- ```
837
-
838
- #### Capture
839
-
840
- **Endpoint:**
841
- - `POST /api/strapi-plugin-payone-provider/capture`
842
-
843
- **Request Body**:
844
-
845
- ```json
846
- {
847
- "txid": "123456789",
848
- "amount": 1000,
849
- "currency": "EUR",
850
- "sequencenumber": 1,
851
- "capturemode": "full"
852
- }
853
- ```
854
-
855
- **Response**:
856
-
857
- ```json
858
- {
859
- "data": {
860
- "status": "APPROVED",
861
- "txid": "123456789"
862
- }
863
- }
864
- ```
865
-
866
- #### Refund
867
-
868
- **Endpoint:**
869
- - `POST /api/strapi-plugin-payone-provider/refund`
870
-
871
- **Request Body**:
872
-
873
- ```json
874
- {
875
- "txid": "123456789",
876
- "amount": -1000,
877
- "currency": "EUR",
878
- "reference": "REF1234567890ABCDEF",
879
- "sequencenumber": 2
880
- }
881
- ```
882
-
883
- **Response**:
884
-
885
- ```json
886
- {
887
- "data": {
888
- "status": "APPROVED",
889
- "txid": "123456789"
890
- }
891
- }
892
- ```
893
-
894
- </details>
895
-
896
- ---
897
-
898
- ### SEPA Direct Debit
899
-
900
- <details>
901
- <summary><strong>SEPA Direct Debit Payment Method</strong></summary>
902
-
903
- #### Preauthorization/Authorization
904
-
905
- **Endpoints:**
906
- - `POST /api/strapi-plugin-payone-provider/preauthorization`
907
- - `POST /api/strapi-plugin-payone-provider/authorization`
908
-
909
- **Request Body**:
910
-
911
- ```json
912
- {
913
- "amount": 1000,
914
- "currency": "EUR",
915
- "reference": "PAY1234567890ABCDEF",
916
- "clearingtype": "elv",
917
- "iban": "DE89370400440532013000",
918
- "bic": "COBADEFFXXX",
919
- "bankaccountholder": "John Doe",
920
- "bankcountry": "DE",
921
- "firstname": "John",
922
- "lastname": "Doe",
923
- "email": "john.doe@example.com",
924
- "telephonenumber": "+4917512345678",
925
- "street": "Main Street 123",
926
- "zip": "12345",
927
- "city": "Berlin",
928
- "country": "DE",
929
- "salutation": "Herr",
930
- "gender": "m",
931
- "ip": "127.0.0.1",
932
- "language": "de",
933
- "customer_is_present": "yes"
934
- }
935
- ```
936
-
937
- **Response**:
938
-
939
- ```json
940
- {
941
- "data": {
942
- "status": "APPROVED",
943
- "txid": "123456789",
944
- "userid": "987654321"
945
- }
946
- }
947
- ```
948
-
949
- #### Capture
950
-
951
- **Endpoint:**
952
- - `POST /api/strapi-plugin-payone-provider/capture`
953
-
954
- **Request Body**:
955
-
956
- ```json
957
- {
958
- "txid": "123456789",
959
- "amount": 1000,
960
- "currency": "EUR",
961
- "sequencenumber": 1
962
- }
963
- ```
964
-
965
- **Response**:
966
-
967
- ```json
968
- {
969
- "data": {
970
- "status": "APPROVED",
971
- "txid": "123456789"
972
- }
973
- }
974
- ```
975
-
976
- #### Refund
977
-
978
- **Endpoint:**
979
- - `POST /api/strapi-plugin-payone-provider/refund`
980
-
981
- **Request Body**:
982
-
983
- ```json
984
- {
985
- "txid": "123456789",
986
- "amount": -1000,
987
- "currency": "EUR",
988
- "reference": "REF1234567890ABCDEF",
989
- "sequencenumber": 2
990
- }
991
- ```
992
-
993
- **Response**:
994
-
995
- ```json
996
- {
997
- "data": {
998
- "status": "APPROVED",
999
- "txid": "123456789"
1000
- }
1001
- }
1002
- ```
1003
-
1004
- </details>
1005
-
1006
- ---
1007
-
1008
- ### Sofort Banking
1009
-
1010
- <details>
1011
- <summary><strong>Sofort Banking Payment Method</strong></summary>
1012
-
1013
- #### Preauthorization/Authorization
1014
-
1015
- **Endpoint:**
1016
- - `POST /api/strapi-plugin-payone-provider/preauthorization`
1017
- - `POST /api/strapi-plugin-payone-provider/authorization`
1018
-
1019
-
1020
- **Request Body**:
1021
-
1022
- ```json
1023
- {
1024
- "amount": 1000,
1025
- "currency": "EUR",
1026
- "reference": "PAY1234567890ABCDEF",
1027
- "clearingtype": "sb",
1028
- "onlinebanktransfertype": "PNT",
1029
- "bankcountry": "DE",
1030
- "firstname": "John",
1031
- "lastname": "Doe",
1032
- "email": "john.doe@example.com",
1033
- "telephonenumber": "+4917512345678",
1034
- "street": "Main Street 123",
1035
- "zip": "12345",
1036
- "city": "Berlin",
1037
- "country": "DE",
1038
- "successurl": "https://www.example.com/success",
1039
- "errorurl": "https://www.example.com/error",
1040
- "backurl": "https://www.example.com/back",
1041
- "salutation": "Herr",
1042
- "gender": "m",
1043
- "ip": "127.0.0.1",
1044
- "language": "de",
1045
- "customer_is_present": "yes"
1046
- }
1047
- ```
1048
-
1049
- **Response**:
1050
-
1051
- ```json
1052
- {
1053
- "data": {
1054
- "status": "REDIRECT",
1055
- "txid": "123456789",
1056
- "redirecturl": "https://secure.pay1.de/redirect/..."
1057
- }
1058
- }
1059
- ```
1060
-
1061
-
1062
- #### Capture
1063
-
1064
- **Endpoint:**
1065
- - `POST /api/strapi-plugin-payone-provider/capture`
1066
-
1067
- **Request Body**:
1068
-
1069
- ```json
1070
- {
1071
- "txid": "123456789",
1072
- "amount": 1000,
1073
- "currency": "EUR",
1074
- "sequencenumber": 1
1075
- }
1076
- ```
1077
-
1078
- **Response**:
1079
-
1080
- ```json
1081
- {
1082
- "data": {
1083
- "status": "APPROVED",
1084
- "txid": "123456789"
1085
- }
1086
- }
1087
- ```
1088
-
1089
- #### Refund
1090
-
1091
- **Endpoint:**
1092
- - `POST /api/strapi-plugin-payone-provider/refund`
1093
-
1094
- **Request Body**:
1095
-
1096
- ```json
1097
- {
1098
- "txid": "123456789",
1099
- "amount": -1000,
1100
- "currency": "EUR",
1101
- "reference": "REF1234567890ABCDEF",
1102
- "sequencenumber": 2
1103
- }
1104
- ```
1105
-
1106
- **Response**:
1107
-
1108
- ```json
1109
- {
1110
- "data": {
1111
- "status": "APPROVED",
1112
- "txid": "123456789"
1113
- }
1114
- }
1115
- ```
1116
-
1117
- </details>
1118
-
1119
- ---
1120
-
1121
- ## TransactionStatus Notifications
1122
-
1123
- The Payone platform provides an asynchronous way of notifying your system of changes to a transaction. These notifications are called "TransactionStatus" and are automatically handled by this plugin.
1124
-
1125
- ### What are TransactionStatus Notifications?
1126
-
1127
- TransactionStatus notifications are POST requests sent from Payone's servers to your endpoint when transaction status changes occur. This is especially important for:
1128
-
1129
- - **Redirect Payment Methods**: Verifying that payments were actually completed (prevents fraud)
1130
- - **Chargeback Processes**: Being notified when customers initiate chargebacks
1131
- - **Real-time Tracking**: Keeping your system updated with the latest transaction status
1132
-
1133
- ### How It Works
1134
-
1135
- 1. **Payone sends notification** → Your Strapi endpoint receives POST request
1136
- 2. **Plugin verifies request** → Checks IP address, User-Agent, and hash signature
1137
- 3. **Plugin processes notification** → Updates transaction history automatically
1138
- 4. **Plugin responds** → Returns `TSOK` to confirm receipt
1139
-
1140
- ### Endpoint Configuration
1141
-
1142
- The plugin automatically provides the TransactionStatus endpoint at:
1143
-
1144
- **URL**: `POST /api/strapi-plugin-payone-provider/transaction-status`
1145
-
1146
- **No authentication required** - The endpoint is secured by:
1147
-
1148
- - IP address verification (only Payone IPs allowed)
1149
- - User-Agent verification (must be "PAYONE FinanceGate")
1150
- - Hash signature verification (MD5 hash of transaction data)
1151
-
1152
- ### PMI Configuration
1153
-
1154
- You need to configure this endpoint in your Payone Merchant Interface (PMI):
1155
-
1156
- 1. Log into your Payone Merchant Interface (PMI)
1157
- 2. Navigate to **Configuration** → **Payment Portals** → **[Your Portal]**
1158
- 3. Find the **TransactionStatus Endpoint** setting
1159
- 4. Enter your endpoint URL: `https://yourdomain.com/api/strapi-plugin-payone-provider/transaction-status`
1160
- 5. Save the configuration
1161
-
1162
- > ⚠️ **Important**: The endpoint must be accessible via HTTPS. Payone will not send notifications to HTTP endpoints.
1163
-
1164
- ### Security Features
1165
-
1166
- The plugin automatically verifies:
1167
-
1168
- 1. **IP Address**: Only accepts requests from Payone's IP ranges:
1169
-
1170
- - `185.60.20.0/24`
1171
- - `54.246.203.105`
1172
-
1173
- 2. **User-Agent**: Must be exactly `"PAYONE FinanceGate"`
1174
-
1175
- 3. **Hash Signature**: Verifies MD5 hash using your Portal Key:
1176
-
1177
- ```
1178
- MD5(portalid + aid + txid + sequencenumber + price + currency + mode + key)
1179
- ```
1180
-
1181
- 4. **Credentials**: Verifies that `portalid` and `aid` match your configured settings
1182
-
1183
- > 📖 **Reference**: For more details, see [Payone TransactionStatus Notification Documentation](https://docs.payone.com/integration/response-handling/transactionstatus-notification)
1184
-
1185
- ---
1186
-
1187
- ## Notes
1188
-
1189
- For additional information and updates, please refer to the official Payone documentation:
1190
-
1191
- **Payone Documentation**: [https://docs.payone.com/payment-methods](https://docs.payone.com/payment-methods)
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
+ - [Using the Admin Panel](#using-the-admin-panel-recommended)
12
+ - [Apple Pay Setup](#apple-pay-setup)
13
+ - [Google Pay Configuration](#google-pay-configuration)
14
+ - [Usage](#usage)
15
+ - [Base URL](#base-url)
16
+ - [Common Request Headers](#common-request-headers)
17
+ - [Common Response Fields](#common-response-fields)
18
+ - [Payment Methods & Operations](#payment-methods--operations)
19
+ - [Credit Card](#credit-card)
20
+ - [PayPal](#paypal)
21
+ - [Google Pay](#google-pay)
22
+ - [Apple Pay](#apple-pay)
23
+ - [SEPA Direct Debit](#sepa-direct-debit)
24
+ - [Sofort Banking](#sofort-banking)
25
+ - [TransactionStatus Notifications](#transactionstatus-notifications)
26
+ - [Notes](#notes)
27
+
28
+ ## Features
29
+
30
+ - **Payone API Integration**: Full integration with Payone's Server API (v3.10)
31
+ - **Payment Operations**:
32
+ - Preauthorization (reserve funds)
33
+ - Authorization (immediate charge)
34
+ - Capture (complete preauthorized transactions)
35
+ - Refund (return funds to customers)
36
+ - **Admin Panel**:
37
+ - Easy configuration interface
38
+ - Transaction history viewer with filtering
39
+ - Payment testing tools
40
+ - Connection testing
41
+ - **Transaction Logging**: Automatic logging of all payment operations
42
+ - **Security**: Secure credential storage with masked API keys
43
+
44
+ ## Requirements
45
+
46
+ Before installing this plugin, ensure you have:
47
+
48
+ - **Strapi**:
49
+ - Version 5.x.x for plugin version 5.x.x
50
+ - Version 4.6.0 or higher for plugin version 4.x.x
51
+ - **Node.js**: Version 18.0.0 to 20.x.x
52
+ - **npm**: Version 6.0.0 or higher
53
+ - **Payone Account**: Active Payone merchant account with API credentials
54
+
55
+ ### Payone Credentials
56
+
57
+ You will need the following credentials from your Payone account:
58
+
59
+ 1. **AID (Account ID)**: Your Payone sub-account identifier
60
+ 2. **Portal ID**: Your Payone portal identifier
61
+ 3. **Merchant ID (MID)**: Your merchant identifier
62
+ 4. **Portal Key**: Your API authentication key (also called "Portal Key" or "Security Key")
63
+
64
+ > ℹ️ **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.
65
+
66
+ ## Installation
67
+
68
+
69
+ **Important**: Choose the correct version based on your Strapi version:
70
+
71
+ - **For Strapi 5.x.x**: Use plugin version `^5.x.x`
72
+ - **For Strapi 4.x.x**: Use plugin version `^4.x.x`
73
+
74
+ ```bash
75
+ # npm
76
+ npm install strapi-plugin-payone-provider
77
+ # yarn
78
+ yarn add strapi-plugin-payone-provider
79
+ # pnpm
80
+ pnpm add strapi-plugin-payone-provider
81
+
82
+ ```
83
+
84
+ > **Version Compatibility**: Make sure to install the correct plugin version that matches your Strapi version. Using an incompatible version may cause errors or unexpected behavior.
85
+
86
+
87
+
88
+ ## Configuration
89
+
90
+ After installation, you need to configure your Payone credentials:
91
+
92
+ ### Using the Admin Panel (Recommended)
93
+
94
+ 1. Open **Payone Provider** in the sidebar menu
95
+ 2. Go to the **Configuration** tab
96
+ 3. Fill in your Payone credentials and save:
97
+ - **Account ID (AID)**: Your Payone account ID
98
+ - **Portal ID**: Your Payone portal ID
99
+ - **Merchant ID (MID)**: Your merchant ID
100
+ - **Portal Key**: Your API security key
101
+ - **Mode**: Select `test` for testing or `live` for production
102
+ - **API Version**: Leave as `3.10` (default)
103
+ 4. Click **"Test Connection"** to verify your credentials
104
+
105
+ ### Apple Pay setup
106
+
107
+ > ⚠️ **Important**: Apple Pay requires a registered domain with HTTPS. It does NOT work on localhost. For testing, use a production domain with HTTPS or test on a device with Safari (iOS/macOS).
108
+
109
+ #### Apple Pay Domain Verification File (.well-known)
110
+
111
+ Apple Pay requires a domain verification file to be placed on your server. This file must be accessible at:
112
+
113
+ ```
114
+ https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
115
+ ```
116
+
117
+ **Steps to set up the domain verification file:**
118
+
119
+ 1. **Download the file from Payone:**
120
+
121
+ - Download the domain verification file from Payone documentation: [https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev](https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev)
122
+ - Alternatively, log into your Payone Merchant Interface (PMI)
123
+ - Navigate to **Configuration** → **Payment Portals** → **Apple Pay**
124
+
125
+ 2. **Place the file in Strapi:**
126
+
127
+ - Create the directory: `public/.well-known/` (if it doesn't exist)
128
+ - Place the file at: `public/.well-known/apple-developer-merchantid-domain-association`
129
+
130
+ 3. **Place the file in your Frontend (if separate):**
131
+
132
+ - Create the directory: `public/.well-known/` (if it doesn't exist)
133
+ - Place the file at: `public/.well-known/apple-developer-merchantid-domain-association`
134
+
135
+ 4. **Verify accessibility:**
136
+ - The file must be accessible via HTTPS at: `https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association`
137
+ - Test by visiting the URL in your browser - you should see the file content
138
+
139
+ > ⚠️ **Critical**: Without this file, Apple Pay will NOT work on your domain. The file must be accessible via HTTPS and must match exactly what Payone provides.
140
+
141
+ #### Middleware Configuration for Apple Pay
142
+
143
+ Apple Pay requires Content Security Policy (CSP) configuration in `config/middlewares.js` to allow Apple Pay scripts. Without this configuration, Apple Pay will NOT work on your strapi admin for make test transaction.
144
+
145
+ **Required CSP directives:**
146
+
147
+ ```javascript
148
+ module.exports = [
149
+ "strapi::logger",
150
+ "strapi::errors",
151
+ {
152
+ name: "strapi::security",
153
+ config: {
154
+ contentSecurityPolicy: {
155
+ useDefaults: true,
156
+ directives: {
157
+ "script-src": [
158
+ "'self'",
159
+ "'unsafe-inline'",
160
+ "'unsafe-eval'",
161
+ "https://applepay.cdn-apple.com", // Apple Pay SDK
162
+ "https://www.apple.com", // Apple Pay manifest
163
+ ],
164
+ "connect-src": [
165
+ "'self'",
166
+ "https:",
167
+ "https://applepay.cdn-apple.com", // Apple Pay API
168
+ "https://www.apple.com", // Apple Pay manifest
169
+ ],
170
+ "frame-src": [
171
+ "'self'",
172
+ "https://applepay.cdn-apple.com", // Apple Pay iframe
173
+ ],
174
+ },
175
+ },
176
+ },
177
+ },
178
+ // ... other middlewares
179
+ ];
180
+ ```
181
+
182
+ > ⚠️ **Important**: Without this middleware configuration, Apple Pay scripts will be blocked and Apple Pay will NOT work!
183
+
184
+ ### Google Pay Configuration
185
+
186
+
187
+ #### Middleware Configuration for Google Pay
188
+
189
+ Google Pay requires Content Security Policy (CSP) configuration in `config/middlewares.js` to allow Google Pay scripts. Without this configuration, Google Pay will NOT work on your strapi admin for make test transactions.
190
+
191
+ **Required CSP directives:**
192
+
193
+ ```javascript
194
+ module.exports = [
195
+ "strapi::logger",
196
+ "strapi::errors",
197
+ {
198
+ name: "strapi::security",
199
+ config: {
200
+ contentSecurityPolicy: {
201
+ useDefaults: true,
202
+ directives: {
203
+ "script-src": [
204
+ "'self'",
205
+ "'unsafe-inline'",
206
+ "'unsafe-eval'",
207
+ "https://pay.google.com", // Google Pay SDK
208
+ ],
209
+ "connect-src": [
210
+ "'self'",
211
+ "https:",
212
+ "https://pay.google.com", // Google Pay API
213
+ ],
214
+ "frame-src": [
215
+ "'self'",
216
+ "https://pay.google.com", // Google Pay iframe
217
+ ],
218
+ },
219
+ },
220
+ },
221
+ },
222
+ // ... other middlewares
223
+ ];
224
+ ```
225
+
226
+ > ⚠️ **Important**: Without this middleware configuration, Google Pay scripts will be blocked and Google Pay will NOT work!
227
+
228
+
229
+ ## Usage
230
+
231
+ ### Base URL
232
+
233
+ All API endpoints are available at:
234
+
235
+ **Content API (Frontend)**: `/api/strapi-plugin-payone-provider`
236
+
237
+ **Admin API**: `/strapi-plugin-payone-provider`
238
+
239
+ > ⚠️ **Authentication Required**: All endpoints require authentication. Include your Bearer token in the Authorization header.
240
+
241
+ ### Common Request Headers
242
+
243
+ ```javascript
244
+ {
245
+ "Content-Type": "application/json",
246
+ "Authorization": "Bearer YOUR_AUTH_TOKEN"
247
+ }
248
+ ```
249
+
250
+ ### Common Response Fields
251
+
252
+ All responses include:
253
+
254
+ - `status`: Transaction status (APPROVED, ERROR, REDIRECT, etc.)
255
+ - `txid`: Transaction ID (for successful transactions)
256
+ - `errorcode`: Error code (if status is ERROR)
257
+ - `errormessage`: Error message (if status is ERROR)
258
+
259
+ ---
260
+
261
+ ## Payment Methods & Operations
262
+
263
+ This section provides detailed API documentation for each supported payment method. Click on any payment method below to see the full implementation details:
264
+
265
+ ### Credit Card
266
+
267
+ <details>
268
+ <summary><strong>Credit Card Payment Method</strong></summary>
269
+
270
+ #### Preauthorization/Authorization
271
+
272
+ **Endpoints:**
273
+ - `POST /api/strapi-plugin-payone-provider/preauthorization`
274
+ - `POST /api/strapi-plugin-payone-provider/authorization`
275
+
276
+ **Request Body**:
277
+
278
+ ```json
279
+ {
280
+ "amount": 1000,
281
+ "currency": "EUR",
282
+ "reference": "PAY1234567890ABCDEF",
283
+ "clearingtype": "cc",
284
+ "cardtype": "V",
285
+ "cardpan": "4111111111111111",
286
+ "cardexpiredate": "2512",
287
+ "cardcvc2": "123",
288
+ "firstname": "John",
289
+ "lastname": "Doe",
290
+ "email": "john.doe@example.com",
291
+ "telephonenumber": "+4917512345678",
292
+ "street": "Main Street 123",
293
+ "zip": "12345",
294
+ "city": "Berlin",
295
+ "country": "DE",
296
+ "successurl": "https://www.example.com/success",
297
+ "errorurl": "https://www.example.com/error",
298
+ "backurl": "https://www.example.com/back",
299
+ "salutation": "Herr",
300
+ "gender": "m",
301
+ "ip": "127.0.0.1",
302
+ "language": "de",
303
+ "customer_is_present": "yes"
304
+ }
305
+ ```
306
+
307
+ **Response**:
308
+
309
+ ```json
310
+ {
311
+ "data": {
312
+ "status": "APPROVED",
313
+ "txid": "123456789",
314
+ "userid": "987654321"
315
+ }
316
+ }
317
+ ```
318
+
319
+ #### Capture
320
+
321
+ **Endpoint:**
322
+ - `POST /api/strapi-plugin-payone-provider/capture`
323
+
324
+ **Request Body**:
325
+
326
+ ```json
327
+ {
328
+ "txid": "123456789",
329
+ "amount": 1000,
330
+ "currency": "EUR",
331
+ "sequencenumber": 1
332
+ }
333
+ ```
334
+
335
+ **Response**:
336
+
337
+ ```json
338
+ {
339
+ "data": {
340
+ "status": "APPROVED",
341
+ "txid": "123456789"
342
+ }
343
+ }
344
+ ```
345
+
346
+ #### Refund
347
+
348
+ **Endpoint:**
349
+ - `POST /api/strapi-plugin-payone-provider/refund`
350
+
351
+ **Request Body**:
352
+
353
+ ```json
354
+ {
355
+ "txid": "123456789",
356
+ "amount": -1000,
357
+ "currency": "EUR",
358
+ "reference": "REF1234567890ABCDEF",
359
+ "sequencenumber": 2
360
+ }
361
+ ```
362
+
363
+ **Response**:
364
+
365
+ ```json
366
+ {
367
+ "data": {
368
+ "status": "APPROVED",
369
+ "txid": "123456789"
370
+ }
371
+ }
372
+ ```
373
+
374
+ </details>
375
+
376
+ ---
377
+
378
+ ### PayPal
379
+
380
+ <details>
381
+ <summary><strong>PayPal Payment Method</strong></summary>
382
+
383
+ #### Preauthorization/Authorization
384
+
385
+ **Endpoints:**
386
+ - `POST /api/strapi-plugin-payone-provider/preauthorization`
387
+ - `POST /api/strapi-plugin-payone-provider/authorization`
388
+
389
+ **Request Body**:
390
+
391
+ ```json
392
+ {
393
+ "amount": 1000,
394
+ "currency": "EUR",
395
+ "reference": "PAY1234567890ABCDEF",
396
+ "clearingtype": "wlt",
397
+ "wallettype": "PPE",
398
+ "firstname": "John",
399
+ "lastname": "Doe",
400
+ "email": "john.doe@example.com",
401
+ "telephonenumber": "+4917512345678",
402
+ "street": "Main Street 123",
403
+ "zip": "12345",
404
+ "city": "Berlin",
405
+ "country": "DE",
406
+ "shipping_firstname": "John",
407
+ "shipping_lastname": "Doe",
408
+ "shipping_street": "Main Street 123",
409
+ "shipping_zip": "12345",
410
+ "shipping_city": "Berlin",
411
+ "shipping_country": "DE",
412
+ "successurl": "https://www.example.com/success",
413
+ "errorurl": "https://www.example.com/error",
414
+ "backurl": "https://www.example.com/back",
415
+ "salutation": "Herr",
416
+ "gender": "m",
417
+ "ip": "127.0.0.1",
418
+ "language": "de",
419
+ "customer_is_present": "yes"
420
+ }
421
+ ```
422
+
423
+ **Response**:
424
+
425
+ ```json
426
+ {
427
+ "data": {
428
+ "status": "REDIRECT",
429
+ "txid": "123456789",
430
+ "redirecturl": "https://secure.pay1.de/redirect/..."
431
+ }
432
+ }
433
+ ```
434
+
435
+
436
+ #### Capture
437
+
438
+ **Endpoint:**
439
+ - `POST /api/strapi-plugin-payone-provider/capture`
440
+
441
+ **Request Body**:
442
+
443
+ ```json
444
+ {
445
+ "txid": "123456789",
446
+ "amount": 1000,
447
+ "currency": "EUR",
448
+ "sequencenumber": 1,
449
+ "capturemode": "full"
450
+ }
451
+ ```
452
+
453
+ **Response**:
454
+
455
+ ```json
456
+ {
457
+ "data": {
458
+ "status": "APPROVED",
459
+ "txid": "123456789"
460
+ }
461
+ }
462
+ ```
463
+
464
+ #### Refund
465
+
466
+ **Endpoint:**
467
+ - `POST /api/strapi-plugin-payone-provider/refund`
468
+
469
+ **Request Body**:
470
+
471
+ ```json
472
+ {
473
+ "txid": "123456789",
474
+ "amount": -1000,
475
+ "currency": "EUR",
476
+ "reference": "REF1234567890ABCDEF",
477
+ "sequencenumber": 2
478
+ }
479
+ ```
480
+
481
+ **Response**:
482
+
483
+ ```json
484
+ {
485
+ "data": {
486
+ "status": "APPROVED",
487
+ "txid": "123456789"
488
+ }
489
+ }
490
+ ```
491
+
492
+ </details>
493
+
494
+ ---
495
+
496
+ ### Google Pay
497
+
498
+ <details>
499
+ <summary><strong>Google Pay Payment Method</strong></summary>
500
+
501
+ #### Overview
502
+
503
+ 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.
504
+
505
+ #### Getting Google Pay Token
506
+
507
+ **1. Include Google Pay Script**
508
+
509
+ ```html
510
+ <script async src="https://pay.google.com/gp/p/js/pay.js"></script>
511
+ ```
512
+
513
+ **2. Initialize Google Pay**
514
+
515
+ ```javascript
516
+ const paymentsClient = new google.payments.api.PaymentsClient({
517
+ environment: "TEST", // or "PRODUCTION" for live mode
518
+ });
519
+
520
+ const baseRequest = {
521
+ apiVersion: 2,
522
+ apiVersionMinor: 0,
523
+ };
524
+
525
+ const allowedCardNetworks = ["MASTERCARD", "VISA"];
526
+ const allowedAuthMethods = ["PAN_ONLY", "CRYPTOGRAM_3DS"];
527
+
528
+ const tokenizationSpecification = {
529
+ type: "PAYMENT_GATEWAY",
530
+ parameters: {
531
+ gateway: "payonegmbh",
532
+ gatewayMerchantId: "YOUR_PAYONE_MERCHANT_ID", // Use your Payone MID or Portal ID
533
+ },
534
+ };
535
+
536
+ const cardPaymentMethod = {
537
+ type: "CARD",
538
+ parameters: {
539
+ allowedCardNetworks,
540
+ allowedAuthMethods,
541
+ },
542
+ tokenizationSpecification,
543
+ };
544
+
545
+ const isReadyToPayRequest = Object.assign({}, baseRequest);
546
+ isReadyToPayRequest.allowedPaymentMethods = [cardPaymentMethod];
547
+
548
+ paymentsClient.isReadyToPay(isReadyToPayRequest).then(function (response) {
549
+ if (response.result) {
550
+ // Google Pay is available, show button
551
+ }
552
+ });
553
+ ```
554
+
555
+ **3. Create Payment Button and Get Token**
556
+
557
+ ```javascript
558
+ const paymentDataRequest = Object.assign({}, baseRequest);
559
+ paymentDataRequest.allowedPaymentMethods = [cardPaymentMethod];
560
+ paymentDataRequest.transactionInfo = {
561
+ totalPriceStatus: "FINAL",
562
+ totalPrice: "10.00",
563
+ currencyCode: "EUR",
564
+ };
565
+ paymentDataRequest.merchantInfo = {
566
+ merchantId: "YOUR_GOOGLE_MERCHANT_ID", // Optional: from Google Console
567
+ merchantName: "Your Merchant Name",
568
+ };
569
+
570
+ const button = paymentsClient.createButton({
571
+ onClick: async () => {
572
+ try {
573
+ const paymentData = await paymentsClient.loadPaymentData(
574
+ paymentDataRequest
575
+ );
576
+ const token = paymentData.paymentMethodData.tokenizationData.token;
577
+
578
+ // Token is a JSON string, encode it to Base64 for Payone
579
+ const base64Token = btoa(unescape(encodeURIComponent(token)));
580
+
581
+ // Send to your backend
582
+ await fetch("/api/strapi-plugin-payone-provider/preauthorization", {
583
+ method: "POST",
584
+ headers: {
585
+ "Content-Type": "application/json",
586
+ Authorization: "Bearer YOUR_TOKEN",
587
+ },
588
+ body: JSON.stringify({
589
+ amount: 1000,
590
+ currency: "EUR",
591
+ reference: "PAY1234567890ABCDEF",
592
+ googlePayToken: base64Token,
593
+ }),
594
+ });
595
+ } catch (error) {
596
+ console.error("Google Pay error:", error);
597
+ }
598
+ },
599
+ });
600
+
601
+ document.getElementById("google-pay-button").appendChild(button);
602
+ ```
603
+
604
+ **Token Format**
605
+
606
+ The token from Google Pay is a JSON string with the following structure:
607
+
608
+ ```json
609
+ {
610
+ "signature": "MEUCIFr4ETGzv0uLZX3sR+i1ScARXnRBrncyYFDX/TI/VSLCAiEAvC/Q4dqXMQhwcSdg/ZvXj8+up0wXsfHja3V/6z48/vk=",
611
+ "intermediateSigningKey": {
612
+ "signedKey": "{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7PWUi+e6WPUhNmTSQ2WN006oWlcWy0FtBWizw9sph1wvX9XcXUNRLcfcsmCBfI5IsKQkjAmYxpCSB+L5sIudLw\\u003d\\u003d\",\"keyExpiration\":\"1722393105282\"}",
613
+ "signatures": [
614
+ "MEUCIQCpU30A3g2pP93IBE5NxgO9ZcJlGF9YPzCZS7H4/IR1CQIgF6+I5t8olT8YsRDUcj7w3R1bvX4ZCcyFXE2+YXa+3H0="
615
+ ]
616
+ },
617
+ "protocolVersion": "ECv2",
618
+ "signedMessage": "{\"encryptedMessage\":\"...\",\"ephemeralPublicKey\":\"...\",\"tag\":\"...\"}"
619
+ }
620
+ ```
621
+
622
+ **Important**: The token must be Base64 encoded before sending to Payone.
623
+
624
+ #### Preauthorization/Authorization
625
+
626
+ **Endpoints:**
627
+ - `POST /api/strapi-plugin-payone-provider/preauthorization`
628
+ - `POST /api/strapi-plugin-payone-provider/authorization`
629
+
630
+ **Request Body**:
631
+
632
+ ```json
633
+ {
634
+ "amount": 1000,
635
+ "currency": "EUR",
636
+ "reference": "PAY1234567890ABCDEF",
637
+ "clearingtype": "wlt",
638
+ "wallettype": "GGP",
639
+ "firstname": "John",
640
+ "lastname": "Doe",
641
+ "email": "john.doe@example.com",
642
+ "telephonenumber": "+4917512345678",
643
+ "street": "Main Street 123",
644
+ "zip": "12345",
645
+ "city": "Berlin",
646
+ "country": "DE",
647
+ "shipping_firstname": "John",
648
+ "shipping_lastname": "Doe",
649
+ "shipping_street": "Main Street 123",
650
+ "shipping_zip": "12345",
651
+ "shipping_city": "Berlin",
652
+ "shipping_country": "DE",
653
+ "successurl": "https://www.example.com/success",
654
+ "errorurl": "https://www.example.com/error",
655
+ "backurl": "https://www.example.com/back",
656
+ "googlePayToken": "BASE64_ENCODED_TOKEN",
657
+ "salutation": "Herr",
658
+ "gender": "m",
659
+ "ip": "127.0.0.1",
660
+ "language": "de",
661
+ "customer_is_present": "yes"
662
+ }
663
+ ```
664
+
665
+ **Payone Request Parameters** (automatically added by plugin):
666
+
667
+ ```json
668
+ {
669
+ "request": "preauthorization",
670
+ "amount": 1000,
671
+ "currency": "EUR",
672
+ "reference": "PAY1234567890ABCDEF",
673
+ "clearingtype": "wlt",
674
+ "wallettype": "GGP",
675
+ "add_paydata[paymentmethod_token_data]": "BASE64_ENCODED_TOKEN",
676
+ "add_paydata[paymentmethod]": "GGP",
677
+ "add_paydata[paymentmethod_type]": "GOOGLEPAY",
678
+ "add_paydata[gatewayid]": "payonegmbh",
679
+ "add_paydata[gateway_merchantid]": "YOUR_PAYONE_MERCHANT_ID",
680
+ "firstname": "John",
681
+ "lastname": "Doe",
682
+ "email": "john.doe@example.com",
683
+ "street": "Main Street 123",
684
+ "zip": "12345",
685
+ "city": "Berlin",
686
+ "country": "DE",
687
+ "shipping_firstname": "John",
688
+ "shipping_lastname": "Doe",
689
+ "shipping_street": "Main Street 123",
690
+ "shipping_zip": "12345",
691
+ "shipping_city": "Berlin",
692
+ "shipping_country": "DE",
693
+ "successurl": "https://www.example.com/success",
694
+ "errorurl": "https://www.example.com/error",
695
+ "backurl": "https://www.example.com/back"
696
+ }
697
+ ```
698
+
699
+ **Response**:
700
+
701
+ ```json
702
+ {
703
+ "data": {
704
+ "status": "APPROVED",
705
+ "txid": "123456789"
706
+ }
707
+ }
708
+ ```
709
+
710
+
711
+ #### Capture
712
+
713
+ **Endpoint:**
714
+ - `POST /api/strapi-plugin-payone-provider/capture`
715
+
716
+ **Request Body**:
717
+
718
+ ```json
719
+ {
720
+ "txid": "123456789",
721
+ "amount": 1000,
722
+ "currency": "EUR",
723
+ "sequencenumber": 1
724
+ }
725
+ ```
726
+
727
+ **Response**:
728
+
729
+ ```json
730
+ {
731
+ "data": {
732
+ "status": "APPROVED",
733
+ "txid": "123456789"
734
+ }
735
+ }
736
+ ```
737
+
738
+ #### Refund
739
+
740
+ **Endpoint:**
741
+ - `POST /api/strapi-plugin-payone-provider/refund`
742
+
743
+ **Request Body**:
744
+
745
+ ```json
746
+ {
747
+ "txid": "123456789",
748
+ "amount": -1000,
749
+ "currency": "EUR",
750
+ "reference": "REF1234567890ABCDEF",
751
+ "sequencenumber": 2
752
+ }
753
+ ```
754
+
755
+ **Response**:
756
+
757
+ ```json
758
+ {
759
+ "data": {
760
+ "status": "APPROVED",
761
+ "txid": "123456789"
762
+ }
763
+ }
764
+ ```
765
+
766
+ #### Required Parameters for Google Pay
767
+
768
+ - `clearingtype`: Must be `"wlt"` (wallet)
769
+ - `wallettype`: Must be `"GGP"` (Google Pay)
770
+ - `add_paydata[paymentmethod_token_data]`: Base64 encoded Google Pay token (automatically added by plugin)
771
+ - `add_paydata[paymentmethod]`: `"GGP"` (automatically added by plugin)
772
+ - `add_paydata[paymentmethod_type]`: `"GOOGLEPAY"` (automatically added by plugin)
773
+ - `add_paydata[gatewayid]`: `"payonegmbh"` (automatically added by plugin)
774
+ - `add_paydata[gateway_merchantid]`: Your Payone Merchant ID (automatically added by plugin)
775
+ - Shipping address parameters (required for wallet payments)
776
+
777
+ </details>
778
+
779
+ ---
780
+
781
+ ### Apple Pay
782
+
783
+ <details>
784
+ <summary><strong>Apple Pay Payment Method</strong></summary>
785
+
786
+ #### Preauthorization/Authorization
787
+
788
+ **Endpoints:**
789
+ - `POST /api/strapi-plugin-payone-provider/preauthorization`
790
+ - `POST /api/strapi-plugin-payone-provider/authorization`
791
+
792
+ **Request Body**:
793
+
794
+ ```json
795
+ {
796
+ "amount": 1000,
797
+ "currency": "EUR",
798
+ "reference": "PAY1234567890ABCDEF",
799
+ "clearingtype": "wlt",
800
+ "wallettype": "APL",
801
+ "firstname": "John",
802
+ "lastname": "Doe",
803
+ "email": "john.doe@example.com",
804
+ "telephonenumber": "+4917512345678",
805
+ "street": "Main Street 123",
806
+ "zip": "12345",
807
+ "city": "Berlin",
808
+ "country": "DE",
809
+ "shipping_firstname": "John",
810
+ "shipping_lastname": "Doe",
811
+ "shipping_street": "Main Street 123",
812
+ "shipping_zip": "12345",
813
+ "shipping_city": "Berlin",
814
+ "shipping_country": "DE",
815
+ "successurl": "https://www.example.com/success",
816
+ "errorurl": "https://www.example.com/error",
817
+ "backurl": "https://www.example.com/back",
818
+ "salutation": "Herr",
819
+ "gender": "m",
820
+ "ip": "127.0.0.1",
821
+ "language": "de",
822
+ "customer_is_present": "yes"
823
+ }
824
+ ```
825
+
826
+ **Response**:
827
+
828
+ ```json
829
+ {
830
+ "data": {
831
+ "status": "REDIRECT",
832
+ "txid": "123456789",
833
+ "redirecturl": "https://secure.pay1.de/redirect/..."
834
+ }
835
+ }
836
+ ```
837
+
838
+ #### Capture
839
+
840
+ **Endpoint:**
841
+ - `POST /api/strapi-plugin-payone-provider/capture`
842
+
843
+ **Request Body**:
844
+
845
+ ```json
846
+ {
847
+ "txid": "123456789",
848
+ "amount": 1000,
849
+ "currency": "EUR",
850
+ "sequencenumber": 1,
851
+ "capturemode": "full"
852
+ }
853
+ ```
854
+
855
+ **Response**:
856
+
857
+ ```json
858
+ {
859
+ "data": {
860
+ "status": "APPROVED",
861
+ "txid": "123456789"
862
+ }
863
+ }
864
+ ```
865
+
866
+ #### Refund
867
+
868
+ **Endpoint:**
869
+ - `POST /api/strapi-plugin-payone-provider/refund`
870
+
871
+ **Request Body**:
872
+
873
+ ```json
874
+ {
875
+ "txid": "123456789",
876
+ "amount": -1000,
877
+ "currency": "EUR",
878
+ "reference": "REF1234567890ABCDEF",
879
+ "sequencenumber": 2
880
+ }
881
+ ```
882
+
883
+ **Response**:
884
+
885
+ ```json
886
+ {
887
+ "data": {
888
+ "status": "APPROVED",
889
+ "txid": "123456789"
890
+ }
891
+ }
892
+ ```
893
+
894
+ </details>
895
+
896
+ ---
897
+
898
+ ### SEPA Direct Debit
899
+
900
+ <details>
901
+ <summary><strong>SEPA Direct Debit Payment Method</strong></summary>
902
+
903
+ #### Preauthorization/Authorization
904
+
905
+ **Endpoints:**
906
+ - `POST /api/strapi-plugin-payone-provider/preauthorization`
907
+ - `POST /api/strapi-plugin-payone-provider/authorization`
908
+
909
+ **Request Body**:
910
+
911
+ ```json
912
+ {
913
+ "amount": 1000,
914
+ "currency": "EUR",
915
+ "reference": "PAY1234567890ABCDEF",
916
+ "clearingtype": "elv",
917
+ "iban": "DE89370400440532013000",
918
+ "bic": "COBADEFFXXX",
919
+ "bankaccountholder": "John Doe",
920
+ "bankcountry": "DE",
921
+ "firstname": "John",
922
+ "lastname": "Doe",
923
+ "email": "john.doe@example.com",
924
+ "telephonenumber": "+4917512345678",
925
+ "street": "Main Street 123",
926
+ "zip": "12345",
927
+ "city": "Berlin",
928
+ "country": "DE",
929
+ "salutation": "Herr",
930
+ "gender": "m",
931
+ "ip": "127.0.0.1",
932
+ "language": "de",
933
+ "customer_is_present": "yes"
934
+ }
935
+ ```
936
+
937
+ **Response**:
938
+
939
+ ```json
940
+ {
941
+ "data": {
942
+ "status": "APPROVED",
943
+ "txid": "123456789",
944
+ "userid": "987654321"
945
+ }
946
+ }
947
+ ```
948
+
949
+ #### Capture
950
+
951
+ **Endpoint:**
952
+ - `POST /api/strapi-plugin-payone-provider/capture`
953
+
954
+ **Request Body**:
955
+
956
+ ```json
957
+ {
958
+ "txid": "123456789",
959
+ "amount": 1000,
960
+ "currency": "EUR",
961
+ "sequencenumber": 1
962
+ }
963
+ ```
964
+
965
+ **Response**:
966
+
967
+ ```json
968
+ {
969
+ "data": {
970
+ "status": "APPROVED",
971
+ "txid": "123456789"
972
+ }
973
+ }
974
+ ```
975
+
976
+ #### Refund
977
+
978
+ **Endpoint:**
979
+ - `POST /api/strapi-plugin-payone-provider/refund`
980
+
981
+ **Request Body**:
982
+
983
+ ```json
984
+ {
985
+ "txid": "123456789",
986
+ "amount": -1000,
987
+ "currency": "EUR",
988
+ "reference": "REF1234567890ABCDEF",
989
+ "sequencenumber": 2
990
+ }
991
+ ```
992
+
993
+ **Response**:
994
+
995
+ ```json
996
+ {
997
+ "data": {
998
+ "status": "APPROVED",
999
+ "txid": "123456789"
1000
+ }
1001
+ }
1002
+ ```
1003
+
1004
+ </details>
1005
+
1006
+ ---
1007
+
1008
+ ### Sofort Banking
1009
+
1010
+ <details>
1011
+ <summary><strong>Sofort Banking Payment Method</strong></summary>
1012
+
1013
+ #### Preauthorization/Authorization
1014
+
1015
+ **Endpoint:**
1016
+ - `POST /api/strapi-plugin-payone-provider/preauthorization`
1017
+ - `POST /api/strapi-plugin-payone-provider/authorization`
1018
+
1019
+
1020
+ **Request Body**:
1021
+
1022
+ ```json
1023
+ {
1024
+ "amount": 1000,
1025
+ "currency": "EUR",
1026
+ "reference": "PAY1234567890ABCDEF",
1027
+ "clearingtype": "sb",
1028
+ "onlinebanktransfertype": "PNT",
1029
+ "bankcountry": "DE",
1030
+ "firstname": "John",
1031
+ "lastname": "Doe",
1032
+ "email": "john.doe@example.com",
1033
+ "telephonenumber": "+4917512345678",
1034
+ "street": "Main Street 123",
1035
+ "zip": "12345",
1036
+ "city": "Berlin",
1037
+ "country": "DE",
1038
+ "successurl": "https://www.example.com/success",
1039
+ "errorurl": "https://www.example.com/error",
1040
+ "backurl": "https://www.example.com/back",
1041
+ "salutation": "Herr",
1042
+ "gender": "m",
1043
+ "ip": "127.0.0.1",
1044
+ "language": "de",
1045
+ "customer_is_present": "yes"
1046
+ }
1047
+ ```
1048
+
1049
+ **Response**:
1050
+
1051
+ ```json
1052
+ {
1053
+ "data": {
1054
+ "status": "REDIRECT",
1055
+ "txid": "123456789",
1056
+ "redirecturl": "https://secure.pay1.de/redirect/..."
1057
+ }
1058
+ }
1059
+ ```
1060
+
1061
+
1062
+ #### Capture
1063
+
1064
+ **Endpoint:**
1065
+ - `POST /api/strapi-plugin-payone-provider/capture`
1066
+
1067
+ **Request Body**:
1068
+
1069
+ ```json
1070
+ {
1071
+ "txid": "123456789",
1072
+ "amount": 1000,
1073
+ "currency": "EUR",
1074
+ "sequencenumber": 1
1075
+ }
1076
+ ```
1077
+
1078
+ **Response**:
1079
+
1080
+ ```json
1081
+ {
1082
+ "data": {
1083
+ "status": "APPROVED",
1084
+ "txid": "123456789"
1085
+ }
1086
+ }
1087
+ ```
1088
+
1089
+ #### Refund
1090
+
1091
+ **Endpoint:**
1092
+ - `POST /api/strapi-plugin-payone-provider/refund`
1093
+
1094
+ **Request Body**:
1095
+
1096
+ ```json
1097
+ {
1098
+ "txid": "123456789",
1099
+ "amount": -1000,
1100
+ "currency": "EUR",
1101
+ "reference": "REF1234567890ABCDEF",
1102
+ "sequencenumber": 2
1103
+ }
1104
+ ```
1105
+
1106
+ **Response**:
1107
+
1108
+ ```json
1109
+ {
1110
+ "data": {
1111
+ "status": "APPROVED",
1112
+ "txid": "123456789"
1113
+ }
1114
+ }
1115
+ ```
1116
+
1117
+ </details>
1118
+
1119
+ ---
1120
+
1121
+ ## TransactionStatus Notifications
1122
+
1123
+ The Payone platform provides an asynchronous way of notifying your system of changes to a transaction. These notifications are called "TransactionStatus" and are automatically handled by this plugin.
1124
+
1125
+ ### What are TransactionStatus Notifications?
1126
+
1127
+ TransactionStatus notifications are POST requests sent from Payone's servers to your endpoint when transaction status changes occur. This is especially important for:
1128
+
1129
+ - **Redirect Payment Methods**: Verifying that payments were actually completed (prevents fraud)
1130
+ - **Chargeback Processes**: Being notified when customers initiate chargebacks
1131
+ - **Real-time Tracking**: Keeping your system updated with the latest transaction status
1132
+
1133
+ ### How It Works
1134
+
1135
+ 1. **Payone sends notification** → Your Strapi endpoint receives POST request
1136
+ 2. **Plugin verifies request** → Checks IP address, User-Agent, and hash signature
1137
+ 3. **Plugin processes notification** → Updates transaction history automatically
1138
+ 4. **Plugin responds** → Returns `TSOK` to confirm receipt
1139
+
1140
+ ### Endpoint Configuration
1141
+
1142
+ The plugin automatically provides the TransactionStatus endpoint at:
1143
+
1144
+ **URL**: `POST /api/strapi-plugin-payone-provider/transaction-status`
1145
+
1146
+ **No authentication required** - The endpoint is secured by:
1147
+
1148
+ - IP address verification (only Payone IPs allowed)
1149
+ - User-Agent verification (must be "PAYONE FinanceGate")
1150
+ - Hash signature verification (MD5 hash of transaction data)
1151
+
1152
+ ### PMI Configuration
1153
+
1154
+ You need to configure this endpoint in your Payone Merchant Interface (PMI):
1155
+
1156
+ 1. Log into your Payone Merchant Interface (PMI)
1157
+ 2. Navigate to **Configuration** → **Payment Portals** → **[Your Portal]**
1158
+ 3. Find the **TransactionStatus Endpoint** setting
1159
+ 4. Enter your endpoint URL: `https://yourdomain.com/api/strapi-plugin-payone-provider/transaction-status`
1160
+ 5. Save the configuration
1161
+
1162
+ > ⚠️ **Important**: The endpoint must be accessible via HTTPS. Payone will not send notifications to HTTP endpoints.
1163
+
1164
+ ### Security Features
1165
+
1166
+ The plugin automatically verifies:
1167
+
1168
+ 1. **IP Address**: Only accepts requests from Payone's IP ranges:
1169
+
1170
+ - `185.60.20.0/24`
1171
+ - `54.246.203.105`
1172
+
1173
+ 2. **User-Agent**: Must be exactly `"PAYONE FinanceGate"`
1174
+
1175
+ 3. **Hash Signature**: Verifies MD5 hash using your Portal Key:
1176
+
1177
+ ```
1178
+ MD5(portalid + aid + txid + sequencenumber + price + currency + mode + key)
1179
+ ```
1180
+
1181
+ 4. **Credentials**: Verifies that `portalid` and `aid` match your configured settings
1182
+
1183
+ > 📖 **Reference**: For more details, see [Payone TransactionStatus Notification Documentation](https://docs.payone.com/integration/response-handling/transactionstatus-notification)
1184
+
1185
+ ---
1186
+
1187
+ ## Notes
1188
+
1189
+ For additional information and updates, please refer to the official Payone documentation:
1190
+
1191
+ **Payone Documentation**: [https://docs.payone.com/payment-methods](https://docs.payone.com/payment-methods)