@gnosispay/pse-react-native 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/lib/PSEWebView.js +2 -1
- package/lib/PSEWebView.tsx +2 -1
- package/lib/types.d.ts +3 -1
- package/lib/types.ts +4 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ export default function PaymentScreen() {
|
|
|
47
47
|
|
|
48
48
|
const config = {
|
|
49
49
|
appId: "your-app-id",
|
|
50
|
-
|
|
50
|
+
gnosisPayApiAuthToken: "users-gnosispay-api-token",
|
|
51
51
|
cardToken: "users-card-token",
|
|
52
52
|
webViewUrl: "https://pse-backend.v2.gnosispay.com/native-webview",
|
|
53
53
|
};
|
|
@@ -104,7 +104,7 @@ export default function PaymentScreen() {
|
|
|
104
104
|
```tsx
|
|
105
105
|
interface PSEConfig {
|
|
106
106
|
appId: string; // Your application identifier
|
|
107
|
-
|
|
107
|
+
gnosisPayApiAuthToken: string; // Authentication token
|
|
108
108
|
cardToken: string; // Card-specific token
|
|
109
109
|
webViewUrl?: string; // Full URL where your PSE iframe is hosted
|
|
110
110
|
}
|
|
@@ -174,7 +174,7 @@ const handleError = (error: string) => {
|
|
|
174
174
|
```tsx
|
|
175
175
|
const config = {
|
|
176
176
|
appId: "your-prod-app-id",
|
|
177
|
-
|
|
177
|
+
gnosisPayApiAuthToken: "your-prod-auth-token",
|
|
178
178
|
cardToken: "your-prod-card-token",
|
|
179
179
|
webViewUrl: "https://pse-backend.v2.gnosispay.com/native-webview",
|
|
180
180
|
};
|
|
@@ -185,7 +185,7 @@ const config = {
|
|
|
185
185
|
```tsx
|
|
186
186
|
const config = {
|
|
187
187
|
appId: "your-staging-app-id",
|
|
188
|
-
|
|
188
|
+
gnosisPayApiAuthToken: "your-staging-auth-token",
|
|
189
189
|
cardToken: "your-staging-card-token",
|
|
190
190
|
webViewUrl: "https://pse-backend-staging.v2.gnosispay.com/native-webview",
|
|
191
191
|
};
|
|
@@ -247,7 +247,7 @@ This compiles the TypeScript source files and generates the distribution files i
|
|
|
247
247
|
|
|
248
248
|
**Authentication errors:**
|
|
249
249
|
|
|
250
|
-
- Double-check your appId,
|
|
250
|
+
- Double-check your appId, gnosisPayApiAuthToken, and cardToken
|
|
251
251
|
- Verify tokens haven't expired
|
|
252
252
|
- Contact your PSE provider for token validation
|
|
253
253
|
|
package/lib/PSEWebView.js
CHANGED
|
@@ -18,8 +18,9 @@ const PSEWebView = forwardRef(({ config, onError, onMessage, onLoad, style, test
|
|
|
18
18
|
// Send parameters to webview after it loads
|
|
19
19
|
const params = {
|
|
20
20
|
appId: config.appId.trim(),
|
|
21
|
-
|
|
21
|
+
gnosisPayApiAuthToken: config.gnosisPayApiAuthToken.trim(),
|
|
22
22
|
cardToken: config.cardToken.trim(),
|
|
23
|
+
elementType: config.elementType,
|
|
23
24
|
};
|
|
24
25
|
const message = JSON.stringify(params);
|
|
25
26
|
webViewRef.current?.postMessage(message);
|
package/lib/PSEWebView.tsx
CHANGED
|
@@ -23,8 +23,9 @@ const PSEWebView = forwardRef<PSEWebViewRef, PSEWebViewProps>(
|
|
|
23
23
|
// Send parameters to webview after it loads
|
|
24
24
|
const params = {
|
|
25
25
|
appId: config.appId.trim(),
|
|
26
|
-
|
|
26
|
+
gnosisPayApiAuthToken: config.gnosisPayApiAuthToken.trim(),
|
|
27
27
|
cardToken: config.cardToken.trim(),
|
|
28
|
+
elementType: config.elementType,
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
const message = JSON.stringify(params);
|
package/lib/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { ElementType } from "@gnosispay/pse-sdk";
|
|
1
2
|
export interface PSEConfig {
|
|
2
3
|
appId: string;
|
|
3
|
-
|
|
4
|
+
gnosisPayApiAuthToken: string;
|
|
4
5
|
cardToken: string;
|
|
5
6
|
webViewUrl?: string;
|
|
7
|
+
elementType: ElementType;
|
|
6
8
|
}
|
|
7
9
|
export interface PSEWebViewProps {
|
|
8
10
|
config: PSEConfig;
|
package/lib/types.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { ElementType } from "@gnosispay/pse-sdk";
|
|
2
|
+
|
|
1
3
|
export interface PSEConfig {
|
|
2
4
|
appId: string;
|
|
3
|
-
|
|
5
|
+
gnosisPayApiAuthToken: string;
|
|
4
6
|
cardToken: string;
|
|
5
7
|
webViewUrl?: string;
|
|
8
|
+
elementType: ElementType;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
11
|
export interface PSEWebViewProps {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gnosispay/pse-react-native",
|
|
3
3
|
"main": "lib/index.js",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
7
7
|
"lib/",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@expo/vector-icons": "^14.1.0",
|
|
39
|
+
"@gnosispay/pse-sdk": "^1.2.2",
|
|
39
40
|
"@react-navigation/bottom-tabs": "^7.3.10",
|
|
40
41
|
"@react-navigation/elements": "^2.3.8",
|
|
41
42
|
"@react-navigation/native": "^7.1.6",
|
|
@@ -52,21 +53,21 @@
|
|
|
52
53
|
"expo-symbols": "~0.4.5",
|
|
53
54
|
"expo-system-ui": "~5.0.10",
|
|
54
55
|
"expo-web-browser": "~14.2.0",
|
|
55
|
-
"react": "
|
|
56
|
+
"react": ">=18.0.0",
|
|
56
57
|
"react-dom": "19.0.0",
|
|
57
|
-
"react-native": "0.
|
|
58
|
+
"react-native": ">=0.70.0",
|
|
58
59
|
"react-native-gesture-handler": "~2.24.0",
|
|
59
60
|
"react-native-reanimated": "~3.17.4",
|
|
60
61
|
"react-native-safe-area-context": "5.4.0",
|
|
61
62
|
"react-native-screens": "~4.11.1",
|
|
62
63
|
"react-native-web": "~0.20.0",
|
|
63
|
-
"react-native-webview": "13.
|
|
64
|
+
"react-native-webview": ">=13.0.0"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@babel/core": "^7.25.2",
|
|
67
68
|
"@types/react": "~19.0.10",
|
|
68
|
-
"typescript": "~5.8.3",
|
|
69
69
|
"eslint": "^9.25.0",
|
|
70
|
-
"eslint-config-expo": "~9.2.0"
|
|
70
|
+
"eslint-config-expo": "~9.2.0",
|
|
71
|
+
"typescript": "~5.8.3"
|
|
71
72
|
}
|
|
72
73
|
}
|