com.xd.sdk.payment 7.7.0 → 7.7.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/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentVersion.h +3 -3
- package/Plugins/iOS/XDPaymentSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDPaymentSDK.framework/XDPaymentSDK +0 -0
- package/Runtime/Internal/Standalone/PaymentAlert.cs +13 -14
- package/Runtime/Internal/Standalone/PaymentFeaturesImpl.cs +10 -1
- package/Runtime/XD.SDK.Payment.asmdef +1 -1
- package/package.json +2 -2
|
Binary file
|
|
Binary file
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#if (
|
|
1
|
+
#if ((UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX) || ((UNITY_EDITOR_WIN || UNITY_EDITOR_OSX) && !UNITY_ANDROID && !UNITY_IOS))
|
|
2
2
|
using System;
|
|
3
3
|
using UnityEngine;
|
|
4
4
|
using UnityEngine.UI;
|
|
5
|
-
using
|
|
5
|
+
using XD.SDK.WebView;
|
|
6
6
|
using XD.SDK.Common.Internal.Standalone;
|
|
7
7
|
|
|
8
8
|
namespace XD.SDK.Payment.Internal.Standalone
|
|
9
9
|
{
|
|
10
10
|
public class PaymentAlert : UIElement
|
|
11
11
|
{
|
|
12
|
-
|
|
12
|
+
IXDWebViewPanel webViewPanel;
|
|
13
13
|
Button closeButton;
|
|
14
14
|
|
|
15
15
|
GameObject loadFailedGO;
|
|
@@ -18,15 +18,14 @@ namespace XD.SDK.Payment.Internal.Standalone
|
|
|
18
18
|
|
|
19
19
|
private void Awake()
|
|
20
20
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
canvasWebViewPrefab.Resolution = 2;
|
|
21
|
+
webViewPanel = XDWebViewService.Provider.CreatePanel();
|
|
22
|
+
webViewPanel.Resolution = 2;
|
|
24
23
|
|
|
24
|
+
GameObject webviewGO = webViewPanel.GameObject;
|
|
25
25
|
webviewGO.transform.SetParent(transform.Find("WebViewContainer"));
|
|
26
26
|
RectTransform rectTransform = webviewGO.GetComponent<RectTransform>();
|
|
27
27
|
rectTransform.offsetMin = Vector2.zero;
|
|
28
28
|
rectTransform.offsetMax = Vector2.zero;
|
|
29
|
-
canvasWebViewPrefab = webviewGO.GetComponent<CanvasWebViewPrefab>();
|
|
30
29
|
|
|
31
30
|
closeButton = GameObject.Find("CloseButton").GetComponent<Button>();
|
|
32
31
|
closeButton.onClick.AddListener(OnCloseButtonClicked);
|
|
@@ -44,10 +43,10 @@ namespace XD.SDK.Payment.Internal.Standalone
|
|
|
44
43
|
|
|
45
44
|
private async void Start()
|
|
46
45
|
{
|
|
47
|
-
await
|
|
46
|
+
await webViewPanel.WaitUntilInitialized();
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
webViewPanel.WebView.UrlChanged += OnUrlChanged;
|
|
49
|
+
webViewPanel.WebView.PageLoadFailed += OnPageLoadFailed;
|
|
51
50
|
|
|
52
51
|
LoadPaymentPage();
|
|
53
52
|
}
|
|
@@ -62,17 +61,17 @@ namespace XD.SDK.Payment.Internal.Standalone
|
|
|
62
61
|
else
|
|
63
62
|
{
|
|
64
63
|
string url = Extra["url"] as string;
|
|
65
|
-
|
|
64
|
+
webViewPanel.WebView.LoadUrl(url);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
private void OnDestroy()
|
|
70
69
|
{
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
webViewPanel.WebView.UrlChanged -= OnUrlChanged;
|
|
71
|
+
webViewPanel.WebView.PageLoadFailed -= OnPageLoadFailed;
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
void OnUrlChanged(object sender,
|
|
74
|
+
void OnUrlChanged(object sender, XDWebViewUrlChangedEventArgs eventArgs)
|
|
76
75
|
{
|
|
77
76
|
string url = eventArgs.Url;
|
|
78
77
|
Uri uri = new Uri(url);
|
|
@@ -9,6 +9,9 @@ using XD.SDK.Account;
|
|
|
9
9
|
using XD.SDK.Common;
|
|
10
10
|
using XD.SDK.Common.Internal;
|
|
11
11
|
using XD.SDK.Common.Internal.Standalone;
|
|
12
|
+
#if ((UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX) || ((UNITY_EDITOR_WIN || UNITY_EDITOR_OSX) && !UNITY_ANDROID && !UNITY_IOS))
|
|
13
|
+
using XD.SDK.WebView;
|
|
14
|
+
#endif
|
|
12
15
|
using Task = System.Threading.Tasks.Task;
|
|
13
16
|
|
|
14
17
|
namespace XD.SDK.Payment.Internal.Standalone
|
|
@@ -212,7 +215,13 @@ namespace XD.SDK.Payment.Internal.Standalone
|
|
|
212
215
|
}
|
|
213
216
|
else
|
|
214
217
|
{
|
|
215
|
-
#if (
|
|
218
|
+
#if ((UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX) || ((UNITY_EDITOR_WIN || UNITY_EDITOR_OSX) && !UNITY_ANDROID && !UNITY_IOS))
|
|
219
|
+
if (!XDWebViewService.IsAvailable)
|
|
220
|
+
{
|
|
221
|
+
XDGLogger.Error("[XDSDK WebView] XDWebViewService.Provider is not registered. Please check whether XD.SDK.WebView.Vuplex is included and preserved in the build.", XDGLoggerTag.Pay);
|
|
222
|
+
throw new XDGError(ResponseCode.Common.Failed, "This function need vuplex enabled");
|
|
223
|
+
}
|
|
224
|
+
|
|
216
225
|
var tcs = new TaskCompletionSource<object>();
|
|
217
226
|
|
|
218
227
|
var data = new Dictionary<string, object>
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.xd.sdk.payment",
|
|
3
3
|
"displayName": "XDGSDK Payment",
|
|
4
|
-
"version": "7.7.
|
|
4
|
+
"version": "7.7.3",
|
|
5
5
|
"description": "XDGSDK",
|
|
6
6
|
"unity": "2019.3",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"com.xd.sdk.common": "7.7.
|
|
9
|
+
"com.xd.sdk.common": "7.7.3"
|
|
10
10
|
}
|
|
11
11
|
}
|