com.xd.sdk.payment 0.0.1 → 0.0.11-alpha
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/Android/libs/XDGPaymentUPPay_7.0.0.aar +0 -0
- package/Plugins/Android/libs/{XDGPayment_6.21.1.aar.meta → XDGPaymentUPPay_7.0.0.aar.meta} +2 -2
- package/Plugins/Android/libs/XDGPayment_7.0.0.aar +0 -0
- package/Plugins/Android/libs/XDGPayment_7.0.0.aar.meta +32 -0
- package/Plugins/Android/libs.meta +1 -1
- package/Plugins/Android.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGOrderInfo.h +9 -9
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGOrderInfo.h.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPayment.h +12 -57
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPayment.h.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentDefines.h +49 -0
- package/{README.md.meta → Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentDefines.h.meta} +2 -2
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentParams.h +43 -0
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentParams.h.meta +7 -0
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentService.h +11 -8
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentService.h.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentVersion.h +3 -2
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentVersion.h.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPendingPurchase.h +18 -0
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPendingPurchase.h.meta +7 -0
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGProductInfo.h +29 -2
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGProductInfo.h.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGTransactionInfo.h +7 -3
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGTransactionInfo.h.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDPaymentSDK.h +2 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDPaymentSDK.h.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDPaymentSDK.framework/Info.plist.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Modules/module.modulemap.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Modules.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/XDPaymentSDK +0 -0
- package/Plugins/iOS/XDPaymentSDK.framework/XDPaymentSDK.meta +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework.meta +56 -3
- package/Plugins/iOS.meta +1 -1
- package/Plugins.meta +1 -1
- package/{Mobile → Runtime/Internal/Mobile}/PaymentConstants.cs +5 -8
- package/{Mobile/Editor/XDPaymentMobileProcessBuild.cs.meta → Runtime/Internal/Mobile/PaymentConstants.cs.meta} +1 -1
- package/Runtime/Internal/Mobile/PaymentFeaturesImpl.cs +185 -0
- package/{Editor/XDGAndroidPaymentProcessor.cs.meta → Runtime/Internal/Mobile/PaymentFeaturesImpl.cs.meta} +1 -1
- package/Runtime/Internal/Mobile/XDGRestoredPurchasesWrapper.cs +23 -0
- package/{Mobile → Runtime/Internal/Mobile}/XDGRestoredPurchasesWrapper.cs.meta +1 -1
- package/{Mobile.meta → Runtime/Internal/Mobile.meta} +1 -1
- package/Runtime/Internal/Standalone/AliyunTrack.Payment.cs +156 -0
- package/{Mobile/XDGDataBean.cs.meta → Runtime/Internal/Standalone/AliyunTrack.Payment.cs.meta} +1 -1
- package/Runtime/Internal/Standalone/Bean/PayCheckResponse.cs +19 -0
- package/{Editor/XDPaymentProcessBuild.cs.meta → Runtime/Internal/Standalone/Bean/PayCheckResponse.cs.meta} +1 -1
- package/Runtime/Internal/Standalone/Bean/PayInfo.cs +31 -0
- package/Runtime/Internal/Standalone/Bean/PayInfo.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Bean/QueryProductsResponse.cs +46 -0
- package/Runtime/Internal/Standalone/Bean/QueryProductsResponse.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Bean/XDGRefundResultWrapper.cs +19 -0
- package/Runtime/Internal/Standalone/Bean/XDGRefundResultWrapper.cs.meta +11 -0
- package/{Editor/XD.SDK.Payment.Editor.asmdef.meta → Runtime/Internal/Standalone/Bean.meta} +3 -2
- package/Runtime/Internal/Standalone/PayListener.cs +83 -0
- package/Runtime/Internal/Standalone/PayListener.cs.meta +11 -0
- package/Runtime/Internal/Standalone/PayModule.cs +261 -0
- package/Runtime/Internal/Standalone/PayModule.cs.meta +11 -0
- package/Runtime/Internal/Standalone/PaymentAlert.cs +112 -0
- package/Runtime/Internal/Standalone/PaymentAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/PaymentFeaturesImpl.cs +238 -0
- package/Runtime/Internal/Standalone/PaymentFeaturesImpl.cs.meta +11 -0
- package/{Mobile/Editor.meta → Runtime/Internal/Standalone.meta} +1 -1
- package/Runtime/Internal/XDGPaymentInternal.cs +46 -0
- package/Runtime/Internal/XDGPaymentInternal.cs.meta +11 -0
- package/Runtime/{XDGRefundDetails.cs → Internal/XDGRefundDetails.cs} +3 -5
- package/Runtime/Internal/XDGRefundDetails.cs.meta +11 -0
- package/Runtime/{XDGRefundResultWrapper.cs → Internal/XDGRefundResultWrapper.cs} +1 -1
- package/Runtime/Internal/XDGRefundResultWrapper.cs.meta +11 -0
- package/{Editor.meta → Runtime/Internal.meta} +1 -1
- package/Runtime/Public/XDGPayment.Deprecated.cs +231 -0
- package/Runtime/Public/XDGPayment.Deprecated.cs.meta +11 -0
- package/Runtime/Public/XDGPayment.cs +97 -0
- package/Runtime/Public/XDGPayment.cs.meta +11 -0
- package/Runtime/Public/XDGPaymentEventHandler.cs +34 -0
- package/Runtime/Public/XDGPaymentEventHandler.cs.meta +3 -0
- package/Runtime/Public.meta +8 -0
- package/Runtime/XD.SDK.Payment.asmdef +5 -2
- package/Runtime/XD.SDK.Payment.asmdef.meta +6 -2
- package/Runtime.meta +7 -2
- package/package.json +5 -5
- package/package.json.meta +2 -2
- package/Editor/XD.SDK.Payment.Editor.asmdef +0 -19
- package/Editor/XDGAndroidPaymentProcessor.cs +0 -44
- package/Editor/XDPaymentProcessBuild.cs +0 -18
- package/Mobile/Editor/XD.SDK.Payment.Mobile.Editor.asmdef +0 -20
- package/Mobile/Editor/XD.SDK.Payment.Mobile.Editor.asmdef.meta +0 -7
- package/Mobile/Editor/XDPaymentMobileProcessBuild.cs +0 -20
- package/Mobile/PaymentConstants.cs.meta +0 -3
- package/Mobile/XD.SDK.Payment.Mobile.asmdef +0 -22
- package/Mobile/XD.SDK.Payment.Mobile.asmdef.meta +0 -7
- package/Mobile/XDGDataBean.cs +0 -242
- package/Mobile/XDGPaymentDetailsParam.cs +0 -127
- package/Mobile/XDGPaymentDetailsParam.cs.meta +0 -3
- package/Mobile/XDGPaymentMobile.cs +0 -132
- package/Mobile/XDGPaymentMobile.cs.meta +0 -11
- package/Mobile/XDGPaymentMobileImpl.cs +0 -331
- package/Mobile/XDGPaymentMobileImpl.cs.meta +0 -11
- package/Mobile/XDGRestoredPurchasesWrapper.cs +0 -42
- package/Plugins/Android/libs/XDGPayment_6.21.1.aar +0 -0
- package/README.md +0 -0
- package/Runtime/IXDGPayment.cs +0 -38
- package/Runtime/IXDGPayment.cs.meta +0 -3
- package/Runtime/WebPayResultType.cs +0 -8
- package/Runtime/WebPayResultType.cs.meta +0 -3
- package/Runtime/XDGPayType.cs +0 -8
- package/Runtime/XDGPayType.cs.meta +0 -3
- package/Runtime/XDGPayment.cs +0 -101
- package/Runtime/XDGPayment.cs.meta +0 -3
- package/Runtime/XDGRefundDetails.cs.meta +0 -3
- package/Runtime/XDGRefundResultWrapper.cs.meta +0 -3
- package/Runtime/XDGSkuDetailInfo.cs +0 -252
- package/Runtime/XDGSkuDetailInfo.cs.meta +0 -3
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine.Scripting;
|
|
4
|
+
using XD.SDK.Common;
|
|
5
|
+
using XD.SDK.Payment.Internal;
|
|
6
|
+
|
|
7
|
+
[assembly: Preserve]
|
|
8
|
+
[assembly: AlwaysLinkAssembly]
|
|
9
|
+
|
|
10
|
+
namespace XD.SDK.Payment
|
|
11
|
+
{
|
|
12
|
+
public static class XDGPayment
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
/// 查询商品信息
|
|
16
|
+
/// </summary>
|
|
17
|
+
/// <param name="productIds">商品ID</param>
|
|
18
|
+
/// <param name="callback">查询回调</param>
|
|
19
|
+
public static void QueryWithProductIds(string[] productIds, Action<List<XDGProductInfo>> callback, Action<XDGError> errorCallback)
|
|
20
|
+
{
|
|
21
|
+
XDGPaymentInternal.QueryWithProductIds(productIds, (infos, error) =>
|
|
22
|
+
{
|
|
23
|
+
if (error != null)
|
|
24
|
+
{
|
|
25
|
+
errorCallback?.Invoke(error);
|
|
26
|
+
}
|
|
27
|
+
else
|
|
28
|
+
{
|
|
29
|
+
callback?.Invoke(infos);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/// <summary>
|
|
35
|
+
/// 开始支付
|
|
36
|
+
/// </summary>
|
|
37
|
+
/// <param name="paymentParams">支付参数</param>
|
|
38
|
+
/// <param name="callback">支付回调</param>
|
|
39
|
+
// TODO: 补齐相关的 bean
|
|
40
|
+
public static void PayWithParams(XDGPaymentParams paymentParams, Action<XDGOrderInfo> callback, Action<XDGError> errorCallback)
|
|
41
|
+
{
|
|
42
|
+
XDGPaymentInternal.PayWithParams(paymentParams, (info, error) =>
|
|
43
|
+
{
|
|
44
|
+
if (error != null)
|
|
45
|
+
{
|
|
46
|
+
errorCallback?.Invoke(error);
|
|
47
|
+
}
|
|
48
|
+
else if (info != null)
|
|
49
|
+
{
|
|
50
|
+
callback?.Invoke(info);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// <summary>
|
|
56
|
+
/// 查询未完成订单
|
|
57
|
+
/// 只支持 iOS
|
|
58
|
+
/// </summary>
|
|
59
|
+
/// <param name="callback">查询回调</param>
|
|
60
|
+
public static void QueryPendingPurchases(Action<List<XDGPendingPurchase>> callback, Action<XDGError> errorCallback)
|
|
61
|
+
{
|
|
62
|
+
XDGPaymentInternal.QueryPendingPurchases((pendingPurchases, error) =>
|
|
63
|
+
{
|
|
64
|
+
if (error != null)
|
|
65
|
+
{
|
|
66
|
+
errorCallback?.Invoke(error);
|
|
67
|
+
}
|
|
68
|
+
else if (pendingPurchases != null)
|
|
69
|
+
{
|
|
70
|
+
callback?.Invoke(pendingPurchases);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// <summary>
|
|
76
|
+
/// 处理未完成订单
|
|
77
|
+
/// 只支持 iOS
|
|
78
|
+
/// PNSDK 时请直接调用 PayWithParams
|
|
79
|
+
/// </summary>
|
|
80
|
+
/// <param name="paymentParams">订单参数</param>
|
|
81
|
+
/// <param name="callback">支付回调</param>
|
|
82
|
+
public static void HandlePendingPurchase(XDGPaymentParams paymentParams, Action<XDGOrderInfo> callback, Action<XDGError> errorCallback)
|
|
83
|
+
{
|
|
84
|
+
XDGPaymentInternal.HandlePendingPurchase(paymentParams, new Action<XDGOrderInfo, XDGError>((info, error) =>
|
|
85
|
+
{
|
|
86
|
+
if (error != null)
|
|
87
|
+
{
|
|
88
|
+
errorCallback?.Invoke(error);
|
|
89
|
+
}
|
|
90
|
+
else if (info != null)
|
|
91
|
+
{
|
|
92
|
+
callback?.Invoke(info);
|
|
93
|
+
}
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
using UnityEditor;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
using XD.SDK.Account;
|
|
4
|
+
using XD.SDK.Common.Internal.Events;
|
|
5
|
+
|
|
6
|
+
#if UNITY_EDITOR || UNITY_STANDALONE
|
|
7
|
+
using System;
|
|
8
|
+
using System.Threading.Tasks;
|
|
9
|
+
using XD.SDK.Payment.Internal;
|
|
10
|
+
using XD.SDK.Account.Internal.Standalone;
|
|
11
|
+
using XD.SDK.Payment.Internal.Standalone;
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
namespace XD.SDK.Payment
|
|
15
|
+
{
|
|
16
|
+
public static class XDGPaymentEventHandler
|
|
17
|
+
{
|
|
18
|
+
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
|
19
|
+
static void RegisterEventHandlers()
|
|
20
|
+
{
|
|
21
|
+
#if UNITY_EDITOR || UNITY_STANDALONE
|
|
22
|
+
XDGEventBus.SubscribeAsync(XDGEvents.PaymentCheckRefundStatusWithUI, async _ =>
|
|
23
|
+
{
|
|
24
|
+
var tsc = new TaskCompletionSource<XDGRefundResultWrapper>();
|
|
25
|
+
PaymentFeaturesImpl.Instance.CheckRefundStatusWithUI(result =>
|
|
26
|
+
{
|
|
27
|
+
tsc.SetResult(result);
|
|
28
|
+
});
|
|
29
|
+
return await tsc.Task;
|
|
30
|
+
});
|
|
31
|
+
#endif
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "XD.SDK.Payment",
|
|
3
|
+
"rootNamespace": "",
|
|
3
4
|
"references": [
|
|
4
|
-
"
|
|
5
|
-
"
|
|
5
|
+
"XD.SDK.Common",
|
|
6
|
+
"XD.SDK.Account",
|
|
7
|
+
"XD.SDK.Foundation",
|
|
8
|
+
"Vuplex.WebView"
|
|
6
9
|
],
|
|
7
10
|
"includePlatforms": [],
|
|
8
11
|
"excludePlatforms": [],
|
package/Runtime.meta
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.xd.sdk.payment",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"displayName": "XDGSDK Payment",
|
|
4
|
+
"version": "0.0.11-alpha",
|
|
5
|
+
"description": "XDGSDK",
|
|
6
|
+
"unity": "2019.3",
|
|
6
7
|
"license": "MIT",
|
|
7
8
|
"dependencies": {
|
|
8
|
-
"com.xd.sdk.common": "0.0.
|
|
9
|
-
"com.xd.tds.common": "3.27.1-xd.1"
|
|
9
|
+
"com.xd.sdk.common": "0.0.11-alpha"
|
|
10
10
|
}
|
|
11
11
|
}
|
package/package.json.meta
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "XD.SDK.Payment.Editor",
|
|
3
|
-
"references": [
|
|
4
|
-
"GUID:616cea76def2d4f059b94440fc8cc03d",
|
|
5
|
-
"GUID:0acc523941302664db1f4e527237feb3",
|
|
6
|
-
"GUID:27619889b8ba8c24980f49ee34dbb44a"
|
|
7
|
-
],
|
|
8
|
-
"includePlatforms": [
|
|
9
|
-
"Editor"
|
|
10
|
-
],
|
|
11
|
-
"excludePlatforms": [],
|
|
12
|
-
"allowUnsafeCode": false,
|
|
13
|
-
"overrideReferences": false,
|
|
14
|
-
"precompiledReferences": [],
|
|
15
|
-
"autoReferenced": true,
|
|
16
|
-
"defineConstraints": [],
|
|
17
|
-
"versionDefines": [],
|
|
18
|
-
"noEngineReferences": false
|
|
19
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// #if UNITY_EDITOR && UNITY_ANDROID
|
|
2
|
-
// using System.IO;
|
|
3
|
-
// using UnityEditor.Android;
|
|
4
|
-
// using UnityEngine;
|
|
5
|
-
//
|
|
6
|
-
// public class XDGAndroidPaymentProcessor : IPostGenerateGradleAndroidProject{
|
|
7
|
-
// void IPostGenerateGradleAndroidProject.OnPostGenerateGradleAndroidProject(string path){
|
|
8
|
-
// var projectPath = path;
|
|
9
|
-
// if (path.Contains("unityLibrary")){
|
|
10
|
-
// projectPath = path.Substring(0, path.Length - 12);
|
|
11
|
-
// }
|
|
12
|
-
//
|
|
13
|
-
// var parentFolder = Directory.GetParent(Application.dataPath)?.FullName;
|
|
14
|
-
//
|
|
15
|
-
// //配置路径
|
|
16
|
-
// var gradlePropertiesFile = projectPath + "/gradle.properties";
|
|
17
|
-
// var baseProjectGradle = projectPath + "/build.gradle";
|
|
18
|
-
// var launcherGradle = projectPath + "/launcher/build.gradle";
|
|
19
|
-
// #if UNITY_2019_3_OR_NEWER
|
|
20
|
-
// var unityLibraryGradle = projectPath + "/unityLibrary/build.gradle";
|
|
21
|
-
// #else
|
|
22
|
-
// var unityLibraryGradle = projectPath + "/build.gradle";
|
|
23
|
-
// #endif
|
|
24
|
-
//
|
|
25
|
-
// //implementation 可根据需要添加或删除
|
|
26
|
-
// if (File.Exists(unityLibraryGradle))
|
|
27
|
-
// {
|
|
28
|
-
// Debug.Log("编辑 unityLibraryGradle");
|
|
29
|
-
// var writerHelper = new XD.SDK.Common.Editor.XDGScriptHandlerProcessor(unityLibraryGradle);
|
|
30
|
-
// writerHelper.WriteBelow(@"implementation 'com.google.code.gson:gson:2.8.6'", @"
|
|
31
|
-
// implementation 'androidx.browser:browser:1.4.0'
|
|
32
|
-
// ");
|
|
33
|
-
// }
|
|
34
|
-
// else
|
|
35
|
-
// {
|
|
36
|
-
// Debug.LogWarning("打包警告 --- unityLibraryGradle 不存在");
|
|
37
|
-
// }
|
|
38
|
-
// }
|
|
39
|
-
//
|
|
40
|
-
// public int callbackOrder{
|
|
41
|
-
// get{ return 1098; }
|
|
42
|
-
// }
|
|
43
|
-
// }
|
|
44
|
-
// #endif
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using TapTap.Common.Editor;
|
|
3
|
-
using UnityEditor.Build.Reporting;
|
|
4
|
-
|
|
5
|
-
namespace XD.SDK.Payment.Editor
|
|
6
|
-
{
|
|
7
|
-
public class XDPaymentProcessBuild : SDKLinkProcessBuild {
|
|
8
|
-
public override int callbackOrder => 5;
|
|
9
|
-
|
|
10
|
-
public override string LinkPath => "XDSDK/Gen/Payment/link.xml";
|
|
11
|
-
|
|
12
|
-
public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
|
|
13
|
-
new LinkedAssembly { Fullname = "XD.SDK.Payment" },
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
public override Func<BuildReport, bool> IsTargetPlatform => (report) => true;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "XD.SDK.Payment.Mobile.Editor",
|
|
3
|
-
"references": [
|
|
4
|
-
"GUID:616cea76def2d4f059b94440fc8cc03d",
|
|
5
|
-
"GUID:747e53b1749584bae9386571797e5eb5",
|
|
6
|
-
"GUID:0acc523941302664db1f4e527237feb3",
|
|
7
|
-
"GUID:27619889b8ba8c24980f49ee34dbb44a"
|
|
8
|
-
],
|
|
9
|
-
"includePlatforms": [
|
|
10
|
-
"Editor"
|
|
11
|
-
],
|
|
12
|
-
"excludePlatforms": [],
|
|
13
|
-
"allowUnsafeCode": false,
|
|
14
|
-
"overrideReferences": false,
|
|
15
|
-
"precompiledReferences": [],
|
|
16
|
-
"autoReferenced": true,
|
|
17
|
-
"defineConstraints": [],
|
|
18
|
-
"versionDefines": [],
|
|
19
|
-
"noEngineReferences": false
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using TapTap.Common.Editor;
|
|
3
|
-
using UnityEditor.Build.Reporting;
|
|
4
|
-
|
|
5
|
-
namespace XD.SDK.Payment.Editor
|
|
6
|
-
{
|
|
7
|
-
public class XDPaymentMobileProcessBuild : SDKLinkProcessBuild {
|
|
8
|
-
public override int callbackOrder => 6;
|
|
9
|
-
|
|
10
|
-
public override string LinkPath => "XDSDK/Gen/Payment/Mobile/link.xml";
|
|
11
|
-
|
|
12
|
-
public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
|
|
13
|
-
new LinkedAssembly { Fullname = "XD.SDK.Payment.Mobile" }
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
public override Func<BuildReport, bool> IsTargetPlatform => (report) => {
|
|
17
|
-
return BuildTargetUtils.IsSupportMobile(report.summary.platform);
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "XD.SDK.Payment.Mobile",
|
|
3
|
-
"references": [
|
|
4
|
-
"GUID:66fa57e362eb4ba98db4f804bf7b5c61",
|
|
5
|
-
"GUID:271a06ab0780d4a5ea46c9c3be2ab5dc",
|
|
6
|
-
"GUID:d2c60bf9347574ed480e55a6682a81f4",
|
|
7
|
-
"GUID:0b3f64ec33f5b4da98a17367a35b82f2",
|
|
8
|
-
"GUID:43c632eee0a6f42cdaf21080b154f3a1"
|
|
9
|
-
],
|
|
10
|
-
"includePlatforms": [
|
|
11
|
-
"Android",
|
|
12
|
-
"iOS"
|
|
13
|
-
],
|
|
14
|
-
"excludePlatforms": [],
|
|
15
|
-
"allowUnsafeCode": false,
|
|
16
|
-
"overrideReferences": false,
|
|
17
|
-
"precompiledReferences": [],
|
|
18
|
-
"autoReferenced": true,
|
|
19
|
-
"defineConstraints": [],
|
|
20
|
-
"versionDefines": [],
|
|
21
|
-
"noEngineReferences": false
|
|
22
|
-
}
|
package/Mobile/XDGDataBean.cs
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using System.Collections.Generic;
|
|
3
|
-
using TapTap.Common;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
using XD.SDK.Common;
|
|
6
|
-
using XD.SDK.Payment;
|
|
7
|
-
|
|
8
|
-
namespace XD.SDK.Payment
|
|
9
|
-
{
|
|
10
|
-
public class XDGSkuDetailInfoMobile : XDGSkuDetailInfo
|
|
11
|
-
{
|
|
12
|
-
private XDGError _xdgError;
|
|
13
|
-
|
|
14
|
-
private List<SkuDetailBean> _skuDetailList;
|
|
15
|
-
|
|
16
|
-
public XDGError xdgError => _xdgError;
|
|
17
|
-
|
|
18
|
-
public List<SkuDetailBean> skuDetailList => _skuDetailList;
|
|
19
|
-
|
|
20
|
-
public XDGSkuDetailInfoMobile(string jsonStr)
|
|
21
|
-
{
|
|
22
|
-
var dic = Json.Deserialize(jsonStr) as Dictionary<string, object>;
|
|
23
|
-
var errorDic = SafeDictionary.GetValue<Dictionary<string, object>>(dic, "error");
|
|
24
|
-
if (errorDic != null)
|
|
25
|
-
{
|
|
26
|
-
_xdgError = new XDGErrorMobile(errorDic);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var list = SafeDictionary.GetValue<List<object>>(dic, "products");
|
|
30
|
-
if (list == null) return;
|
|
31
|
-
_skuDetailList = new List<SkuDetailBean>();
|
|
32
|
-
foreach (var skuDetail in list)
|
|
33
|
-
{
|
|
34
|
-
var innerDic = skuDetail as Dictionary<string, object>;
|
|
35
|
-
var skuDetailBean = new SkuDetailBean(innerDic);
|
|
36
|
-
_skuDetailList.Add(skuDetailBean);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public class XDGOrderInfoWrapperMobile : XDGOrderInfoWrapper
|
|
42
|
-
{
|
|
43
|
-
private XDGError _xdgError;
|
|
44
|
-
private XDGOrderInfo _orderInfo;
|
|
45
|
-
private string _debugMsg;
|
|
46
|
-
|
|
47
|
-
public XDGError xdgError => _xdgError;
|
|
48
|
-
public XDGOrderInfo orderInfo => _orderInfo;
|
|
49
|
-
public string debugMsg => _debugMsg;
|
|
50
|
-
|
|
51
|
-
public XDGOrderInfoWrapperMobile(string jsonStr)
|
|
52
|
-
{
|
|
53
|
-
Debug.LogFormat("支付返回 json: {0}", jsonStr);
|
|
54
|
-
var dic = Json.Deserialize(jsonStr) as Dictionary<string, object>;
|
|
55
|
-
var errorDic = SafeDictionary.GetValue<Dictionary<string, object>>(dic, "error");
|
|
56
|
-
if (errorDic != null)
|
|
57
|
-
{
|
|
58
|
-
_xdgError = new XDGErrorMobile(errorDic);
|
|
59
|
-
XDGLogger.Debug($"产品支付失败: {jsonStr}");
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var orderInfoDic = SafeDictionary.GetValue<Dictionary<string, object>>(dic, "orderInfo");
|
|
63
|
-
_orderInfo = new XDGOrderInfo(orderInfoDic);
|
|
64
|
-
|
|
65
|
-
_debugMsg = SafeDictionary.GetValue<string>(dic, "debugMessage");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
public class XDGRestoredPurchaseWrapper
|
|
71
|
-
{
|
|
72
|
-
public List<XDGRestoredPurchase> transactionList;
|
|
73
|
-
|
|
74
|
-
public XDGRestoredPurchaseWrapper(string jsonStr)
|
|
75
|
-
{
|
|
76
|
-
var dic = Json.Deserialize(jsonStr) as Dictionary<string, object>;
|
|
77
|
-
var list = SafeDictionary.GetValue<List<object>>(dic, "transactions");
|
|
78
|
-
if (list == null)
|
|
79
|
-
{
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
transactionList = new List<XDGRestoredPurchase>();
|
|
84
|
-
foreach (var obj in list)
|
|
85
|
-
{
|
|
86
|
-
var beanDic = obj as Dictionary<string, object>;
|
|
87
|
-
transactionList.Add(new XDGRestoredPurchase(beanDic));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public class XDGRefundResultWrapperMobile : XDGRefundResultWrapper
|
|
93
|
-
{
|
|
94
|
-
private XDGError _xdgError;
|
|
95
|
-
private List<XDGRefundDetails> _refundList;
|
|
96
|
-
|
|
97
|
-
public XDGRefundResultWrapperMobile(string jsonStr)
|
|
98
|
-
{
|
|
99
|
-
var dic = Json.Deserialize(jsonStr) as Dictionary<string, object>;
|
|
100
|
-
var code = SafeDictionary.GetValue<int>(dic, "code");
|
|
101
|
-
var msg = SafeDictionary.GetValue<string>(dic, "msg");
|
|
102
|
-
if (code != Result.RESULT_SUCCESS)
|
|
103
|
-
{
|
|
104
|
-
XDGLogger.Warn($"CheckRefundResult 失败 :{jsonStr}");
|
|
105
|
-
_xdgError = new XDGErrorMobile(code, msg);
|
|
106
|
-
}
|
|
107
|
-
else
|
|
108
|
-
{
|
|
109
|
-
var dataDic = SafeDictionary.GetValue<Dictionary<string, object>>(dic, "data");
|
|
110
|
-
if (dataDic == null) return;
|
|
111
|
-
var list = SafeDictionary.GetValue<List<object>>(dataDic, "list");
|
|
112
|
-
if (list == null)return;
|
|
113
|
-
|
|
114
|
-
_refundList = new List<XDGRefundDetails>();
|
|
115
|
-
for (var index = 0; index < list.Count; index++)
|
|
116
|
-
{
|
|
117
|
-
var obj = list[index];
|
|
118
|
-
var beanDic = obj as Dictionary<string, object>;
|
|
119
|
-
_refundList.Add(new XDGRefundDetailsMobile(beanDic));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
public XDGError xdgError => _xdgError as XDGError;
|
|
125
|
-
public List<XDGRefundDetails> refundList => _refundList?.ConvertAll<XDGRefundDetails>(a => a as XDGRefundDetails);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
[Serializable]
|
|
129
|
-
public class XDGRefundDetailsMobile : XDGRefundDetails
|
|
130
|
-
{
|
|
131
|
-
private string _tradeNo;
|
|
132
|
-
private string _productId;
|
|
133
|
-
private string _currency;
|
|
134
|
-
private string _outTradeNo;
|
|
135
|
-
private double _refundAmount;
|
|
136
|
-
private int _supplyStatus;
|
|
137
|
-
private int _platform;
|
|
138
|
-
private int _channelType;
|
|
139
|
-
|
|
140
|
-
public XDGRefundDetailsMobile(Dictionary<string, object> dic)
|
|
141
|
-
{
|
|
142
|
-
if (dic == null) return;
|
|
143
|
-
_tradeNo = SafeDictionary.GetValue<string>(dic, "tradeNo");
|
|
144
|
-
_productId = SafeDictionary.GetValue<string>(dic, "productId");
|
|
145
|
-
_currency = SafeDictionary.GetValue<string>(dic, "currency");
|
|
146
|
-
_outTradeNo = SafeDictionary.GetValue<string>(dic, "outTradeNo");
|
|
147
|
-
_refundAmount = SafeDictionary.GetValue<double>(dic, "refundAmount");
|
|
148
|
-
_supplyStatus = SafeDictionary.GetValue<int>(dic, "supplyStatus");
|
|
149
|
-
_platform = SafeDictionary.GetValue<int>(dic, "platform");
|
|
150
|
-
_channelType = SafeDictionary.GetValue<int>(dic, "channelType");
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
public string tradeNo => _tradeNo;
|
|
154
|
-
|
|
155
|
-
public string productId => _productId;
|
|
156
|
-
|
|
157
|
-
public string currency => _currency;
|
|
158
|
-
|
|
159
|
-
public string outTradeNo => _outTradeNo;
|
|
160
|
-
|
|
161
|
-
public double refundAmount => _refundAmount;
|
|
162
|
-
|
|
163
|
-
public int supplyStatus => _supplyStatus;
|
|
164
|
-
|
|
165
|
-
public int platform => _platform;
|
|
166
|
-
|
|
167
|
-
public int channelType => _channelType;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
public class XDGInlinePayResult
|
|
171
|
-
{
|
|
172
|
-
public int code = -1;
|
|
173
|
-
public string message = "";
|
|
174
|
-
|
|
175
|
-
public XDGInlinePayResult(string jsonStr)
|
|
176
|
-
{
|
|
177
|
-
if (!(Json.Deserialize(jsonStr) is Dictionary<string, object> dic)) return;
|
|
178
|
-
code = SafeDictionary.GetValue<int>(dic, "code");
|
|
179
|
-
message = SafeDictionary.GetValue<string>(dic, "message");
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
public XDGInlinePayResult(int code, string message)
|
|
183
|
-
{
|
|
184
|
-
this.code = code;
|
|
185
|
-
this.message = message;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
public class ProductSkuWrapper
|
|
191
|
-
{
|
|
192
|
-
public XDGError xdgError;
|
|
193
|
-
|
|
194
|
-
public List<ProductSkuInfo> skuList;
|
|
195
|
-
|
|
196
|
-
public ProductSkuWrapper(string jsonStr)
|
|
197
|
-
{
|
|
198
|
-
var dic = Json.Deserialize(jsonStr) as Dictionary<string, object>;
|
|
199
|
-
var errorDic = SafeDictionary.GetValue<Dictionary<string, object>>(dic, "error");
|
|
200
|
-
if (errorDic != null)
|
|
201
|
-
{
|
|
202
|
-
xdgError = new XDGErrorMobile(errorDic);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
var list = SafeDictionary.GetValue<List<object>>(dic, "products");
|
|
206
|
-
if (list == null) return;
|
|
207
|
-
skuList = new List<ProductSkuInfo>();
|
|
208
|
-
foreach (var skuDetail in list)
|
|
209
|
-
{
|
|
210
|
-
var innerDic = skuDetail as Dictionary<string, object>;
|
|
211
|
-
var skuDetailBean = new ProductSkuInfo(innerDic);
|
|
212
|
-
skuList.Add(skuDetailBean);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
public class ProductSkuInfo
|
|
219
|
-
{
|
|
220
|
-
public string channelSkuCode; // 渠道 sku
|
|
221
|
-
public string costPrice; // 原价
|
|
222
|
-
public string currency; // 货币
|
|
223
|
-
public string desc; // 商品描述
|
|
224
|
-
public string productSkuCode; // 商品 sku
|
|
225
|
-
public string productSkuName; // 商品 sku 的名称
|
|
226
|
-
public string region; // 国家/地区
|
|
227
|
-
public string salePrice; // 现价
|
|
228
|
-
|
|
229
|
-
public ProductSkuInfo(Dictionary<string, object> dic)
|
|
230
|
-
{
|
|
231
|
-
if (dic == null) return;
|
|
232
|
-
channelSkuCode = SafeDictionary.GetValue<string>(dic, "channelSkuCode");
|
|
233
|
-
costPrice = SafeDictionary.GetValue<string>(dic, "costPrice");
|
|
234
|
-
currency = SafeDictionary.GetValue<string>(dic, "currency");
|
|
235
|
-
desc = SafeDictionary.GetValue<string>(dic, "desc");
|
|
236
|
-
productSkuCode = SafeDictionary.GetValue<string>(dic, "productSkuCode");
|
|
237
|
-
productSkuName = SafeDictionary.GetValue<string>(dic, "productSkuName");
|
|
238
|
-
region = SafeDictionary.GetValue<string>(dic, "region");
|
|
239
|
-
salePrice = SafeDictionary.GetValue<string>(dic, "salePrice");
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|