strapi-plugin-payone-provider 1.4.1 → 1.5.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.
- package/APPLE_PAY_INTEGRATION.md +472 -0
- package/CSP_SETUP.md +184 -0
- package/HTTPS_REQUIREMENT.md +136 -0
- package/admin/src/pages/App/components/AppTabs.js +2 -0
- package/admin/src/pages/App/components/ApplePayButton.js +704 -0
- package/admin/src/pages/App/components/ApplePayConfig.js +305 -0
- package/admin/src/pages/App/components/PaymentActionsPanel.js +6 -0
- package/admin/src/pages/App/components/icons/BankIcon.js +10 -10
- package/admin/src/pages/App/components/icons/ChevronDownIcon.js +9 -9
- package/admin/src/pages/App/components/icons/ChevronUpIcon.js +9 -9
- package/admin/src/pages/App/components/icons/CreditCardIcon.js +9 -9
- package/admin/src/pages/App/components/icons/ErrorIcon.js +10 -10
- package/admin/src/pages/App/components/icons/InfoIcon.js +9 -9
- package/admin/src/pages/App/components/icons/PaymentIcon.js +10 -10
- package/admin/src/pages/App/components/icons/PendingIcon.js +9 -9
- package/admin/src/pages/App/components/icons/PersonIcon.js +9 -9
- package/admin/src/pages/App/components/icons/SuccessIcon.js +9 -9
- package/admin/src/pages/App/components/icons/WalletIcon.js +9 -9
- package/admin/src/pages/App/components/icons/index.js +11 -11
- package/admin/src/pages/App/components/paymentActions/AuthorizationForm.js +29 -2
- package/admin/src/pages/App/components/paymentActions/CaptureForm.js +1 -0
- package/admin/src/pages/App/components/paymentActions/CardDetailsInput.js +18 -16
- package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.js +44 -2
- package/admin/src/pages/App/components/paymentActions/RefundForm.js +1 -0
- package/admin/src/pages/hooks/usePaymentActions.js +25 -12
- package/admin/src/pages/utils/applePayConstants.js +222 -0
- package/admin/src/pages/utils/formatTransactionData.js +15 -15
- package/admin/src/pages/utils/paymentUtils.js +32 -69
- package/package.json +1 -1
- package/server/bootstrap.js +5 -1
- package/server/config/index.js +5 -1
- package/server/controllers/payone.js +10 -0
- package/server/routes/index.js +17 -0
- package/server/services/applePayService.js +261 -0
- package/server/services/paymentService.js +1 -7
- package/server/services/payone.js +10 -0
- package/server/utils/paymentMethodParams.js +19 -2
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Apple Pay HTTPS Requirement
|
|
2
|
+
|
|
3
|
+
## Muammo
|
|
4
|
+
|
|
5
|
+
Agar quyidagi xatoni ko'rsangiz:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
InvalidAccessError: Trying to start an Apple Pay session from an insecure document.
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Bu xato Apple Pay **faqat HTTPS** orqali ishlaydi degan ma'noni anglatadi.
|
|
12
|
+
|
|
13
|
+
## Yechim
|
|
14
|
+
|
|
15
|
+
### QADAM 1: HTTPS ga O'tish
|
|
16
|
+
|
|
17
|
+
Apple Pay ishlashi uchun saytingiz **HTTPS** orqali ishlashi kerak:
|
|
18
|
+
|
|
19
|
+
1. **Development (Localhost):**
|
|
20
|
+
- `http://localhost` - ✅ Ishlaydi (localhost maxsus ruxsatga ega)
|
|
21
|
+
- `http://127.0.0.1` - ✅ Ishlaydi
|
|
22
|
+
- `https://localhost` - ✅ Ishlaydi
|
|
23
|
+
|
|
24
|
+
2. **Production:**
|
|
25
|
+
- `http://yourdomain.com` - ❌ Ishlamaydi
|
|
26
|
+
- `https://yourdomain.com` - ✅ Ishlaydi
|
|
27
|
+
|
|
28
|
+
### QADAM 2: SSL Sertifikati O'rnatish
|
|
29
|
+
|
|
30
|
+
Production muhitda SSL sertifikati o'rnatish:
|
|
31
|
+
|
|
32
|
+
**Let's Encrypt (Bepul):**
|
|
33
|
+
```bash
|
|
34
|
+
# Certbot yuklab oling
|
|
35
|
+
sudo apt-get install certbot python3-certbot-nginx
|
|
36
|
+
|
|
37
|
+
# SSL sertifikati oling
|
|
38
|
+
sudo certbot --nginx -d yourdomain.com
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Yoki Cloudflare orqali:**
|
|
42
|
+
1. Cloudflare ga kiring
|
|
43
|
+
2. SSL/TLS > Overview
|
|
44
|
+
3. "Full" yoki "Full (strict)" ni tanlang
|
|
45
|
+
|
|
46
|
+
### QADAM 3: Strapi Server Config
|
|
47
|
+
|
|
48
|
+
`config/server.js` yoki environment variables:
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
// Production
|
|
52
|
+
module.exports = {
|
|
53
|
+
url: 'https://yourdomain.com',
|
|
54
|
+
// ...
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# .env
|
|
60
|
+
SERVER_URL=https://yourdomain.com
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### QADAM 4: Reverse Proxy (Nginx)
|
|
64
|
+
|
|
65
|
+
Agar Nginx ishlatilsa:
|
|
66
|
+
|
|
67
|
+
```nginx
|
|
68
|
+
server {
|
|
69
|
+
listen 80;
|
|
70
|
+
server_name yourdomain.com;
|
|
71
|
+
|
|
72
|
+
# HTTP dan HTTPS ga redirect
|
|
73
|
+
return 301 https://$server_name$request_uri;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
server {
|
|
77
|
+
listen 443 ssl http2;
|
|
78
|
+
server_name yourdomain.com;
|
|
79
|
+
|
|
80
|
+
ssl_certificate /path/to/certificate.crt;
|
|
81
|
+
ssl_certificate_key /path/to/private.key;
|
|
82
|
+
|
|
83
|
+
location / {
|
|
84
|
+
proxy_pass http://localhost:1337;
|
|
85
|
+
proxy_http_version 1.1;
|
|
86
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
87
|
+
proxy_set_header Connection 'upgrade';
|
|
88
|
+
proxy_set_header Host $host;
|
|
89
|
+
proxy_cache_bypass $http_upgrade;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Payment Request API
|
|
95
|
+
|
|
96
|
+
**Muhim:** Payment Request API HTTP da ham ishlaydi, lekin Apple Pay payment method uchun HTTPS kerak.
|
|
97
|
+
|
|
98
|
+
Agar siz HTTP da ishlatsangiz:
|
|
99
|
+
- ❌ Apple Pay JS API ishlamaydi
|
|
100
|
+
- ❌ Payment Request API da Apple Pay ishlamaydi
|
|
101
|
+
- ✅ Boshqa payment methodlar (Google Pay, Credit Card) ishlashi mumkin
|
|
102
|
+
|
|
103
|
+
## Test Qilish
|
|
104
|
+
|
|
105
|
+
1. **Localhost da:**
|
|
106
|
+
```bash
|
|
107
|
+
# HTTP da ishlaydi (localhost maxsus ruxsatga ega)
|
|
108
|
+
http://localhost:1337
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
2. **Production da:**
|
|
112
|
+
```bash
|
|
113
|
+
# Faqat HTTPS da ishlaydi
|
|
114
|
+
https://yourdomain.com
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Xatolarni Tekshirish
|
|
118
|
+
|
|
119
|
+
Browser console da quyidagi loglarni ko'rasiz:
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
[Apple Pay] Secure context check: {
|
|
123
|
+
protocol: "http:",
|
|
124
|
+
hostname: "yourdomain.com",
|
|
125
|
+
isSecure: false
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Agar `isSecure: false` bo'lsa va `protocol: "http:"` bo'lsa, HTTPS ga o'tishingiz kerak.
|
|
130
|
+
|
|
131
|
+
## Qo'shimcha Ma'lumotlar
|
|
132
|
+
|
|
133
|
+
- [Apple Pay Web Requirements](https://developer.apple.com/documentation/applepayontheweb)
|
|
134
|
+
- [Payment Request API](https://developer.mozilla.org/en-US/docs/Web/API/Payment_Request_API)
|
|
135
|
+
- [Strapi Deployment](https://docs.strapi.io/dev-docs/deployment)
|
|
136
|
+
|
|
@@ -115,6 +115,8 @@ const AppTabs = ({
|
|
|
115
115
|
settings={settings}
|
|
116
116
|
googlePayToken={paymentActions.googlePayToken}
|
|
117
117
|
setGooglePayToken={paymentActions.setGooglePayToken}
|
|
118
|
+
applePayToken={paymentActions.applePayToken}
|
|
119
|
+
setApplePayToken={paymentActions.setApplePayToken}
|
|
118
120
|
cardtype={paymentActions.cardtype}
|
|
119
121
|
setCardtype={paymentActions.setCardtype}
|
|
120
122
|
cardpan={paymentActions.cardpan}
|