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.
@@ -5,6 +5,6 @@
5
5
  // Created by Fattycat on 2023/4/14.
6
6
  //
7
7
 
8
- #define XDGPayment_VERSION @"7.7.0"
9
- #define XDSPayment_VERSION_CODE @"7070000"
10
- // HASH a8b1407f
8
+ #define XDGPayment_VERSION @"7.7.3"
9
+ #define XDSPayment_VERSION_CODE @"7070300"
10
+ // HASH 18c75b8c
@@ -1,15 +1,15 @@
1
- #if (UNITY_STANDALONE || (UNITY_EDITOR && !UNITY_ANDROID && !UNITY_IOS)) && !XDSDK_DISABLE_VUPLEX
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 Vuplex.WebView;
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
- CanvasWebViewPrefab canvasWebViewPrefab;
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
- GameObject webviewGO = Instantiate(Resources.Load("CanvasWebViewPrefab")) as GameObject;
22
- canvasWebViewPrefab = webviewGO.GetComponent<CanvasWebViewPrefab>();
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 canvasWebViewPrefab.WaitUntilInitialized();
46
+ await webViewPanel.WaitUntilInitialized();
48
47
 
49
- canvasWebViewPrefab.WebView.UrlChanged += OnUrlChanged;
50
- canvasWebViewPrefab.WebView.PageLoadFailed += OnPageLoadFailed;
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
- canvasWebViewPrefab.WebView.LoadUrl(url);
64
+ webViewPanel.WebView.LoadUrl(url);
66
65
  }
67
66
  }
68
67
 
69
68
  private void OnDestroy()
70
69
  {
71
- canvasWebViewPrefab.WebView.UrlChanged -= OnUrlChanged;
72
- canvasWebViewPrefab.WebView.PageLoadFailed -= OnPageLoadFailed;
70
+ webViewPanel.WebView.UrlChanged -= OnUrlChanged;
71
+ webViewPanel.WebView.PageLoadFailed -= OnPageLoadFailed;
73
72
  }
74
73
 
75
- void OnUrlChanged(object sender, UrlChangedEventArgs eventArgs)
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 (UNITY_STANDALONE || (UNITY_EDITOR && !UNITY_ANDROID && !UNITY_IOS)) && !XDSDK_DISABLE_VUPLEX
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>
@@ -5,7 +5,7 @@
5
5
  "XD.SDK.Common",
6
6
  "XD.SDK.Account",
7
7
  "XD.SDK.Foundation",
8
- "Vuplex.WebView"
8
+ "XD.SDK.WebView"
9
9
  ],
10
10
  "includePlatforms": [],
11
11
  "excludePlatforms": [],
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.0",
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.0"
9
+ "com.xd.sdk.common": "7.7.3"
10
10
  }
11
11
  }