com.xd.sdk.payment 6.22.3 → 6.23.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/Mobile/XDGPaymentMobile.cs +5 -0
- package/Mobile/XDGPaymentMobileImpl.cs +30 -0
- package/Plugins/Android/libs/XDGPayment_6.23.0.aar +0 -0
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPayment.h +7 -0
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentParams.h +25 -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/XDGPaymentVersion.h +2 -2
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDPaymentSDK.h +1 -0
- package/Plugins/iOS/XDPaymentSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDPaymentSDK.framework/XDPaymentSDK +0 -0
- package/Runtime/IXDGPayment.cs +2 -0
- package/Runtime/XDGPayment.cs +5 -0
- package/Runtime/XDGPaymentParams.cs +82 -0
- package/Runtime/XDGPaymentParams.cs.meta +3 -0
- package/package.json +2 -2
- package/Plugins/Android/libs/XDGPayment_6.22.3.aar +0 -0
- /package/Plugins/Android/libs/{XDGPayment_6.22.3.aar.meta → XDGPayment_6.23.0.aar.meta} +0 -0
|
@@ -11,6 +11,11 @@ namespace XD.SDK.Payment{
|
|
|
11
11
|
XDGPaymentMobileImpl.GetInstance().PayWithProduct(orderId, productId, roleId, serverId, ext, callback);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
public void PayWithParams(XDGPaymentParams paymentParams, Action<XDGOrderInfoWrapper> callback)
|
|
15
|
+
{
|
|
16
|
+
XDGPaymentMobileImpl.GetInstance().PayWithParams(paymentParams, callback);
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
public static void PayWithWeb(
|
|
15
20
|
string orderId,
|
|
16
21
|
string productId,
|
|
@@ -4,6 +4,7 @@ using LC.Newtonsoft.Json;
|
|
|
4
4
|
using TapTap.Common;
|
|
5
5
|
using UnityEngine;
|
|
6
6
|
using XD.SDK.Common;
|
|
7
|
+
using XD.SDK.Common.Internal;
|
|
7
8
|
|
|
8
9
|
namespace XD.SDK.Payment{
|
|
9
10
|
public class XDGPaymentMobileImpl{
|
|
@@ -48,6 +49,35 @@ namespace XD.SDK.Payment{
|
|
|
48
49
|
callback(new XDGSkuDetailInfoMobile(result.content) as XDGSkuDetailInfo);
|
|
49
50
|
});
|
|
50
51
|
}
|
|
52
|
+
|
|
53
|
+
public void PayWithParams(XDGPaymentParams paymentParams, Action<XDGOrderInfoWrapper> callback)
|
|
54
|
+
{
|
|
55
|
+
var paramsDic = new Dictionary<string, object>{
|
|
56
|
+
{"gameOrderId", paymentParams.gameOrderId},
|
|
57
|
+
{"productId", paymentParams.productId},
|
|
58
|
+
{"roleId", paymentParams.roleId},
|
|
59
|
+
{"serverId", paymentParams.serverId},
|
|
60
|
+
{"ext", paymentParams.ext},
|
|
61
|
+
{"quantity", paymentParams.quantity}
|
|
62
|
+
};
|
|
63
|
+
var dic = new Dictionary<string, object>
|
|
64
|
+
{
|
|
65
|
+
{"params", paramsDic}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var command = new Command.Builder()
|
|
69
|
+
.Service(XDG_PAYMENT_SERVICE)
|
|
70
|
+
.Method("payWithParams")
|
|
71
|
+
.Args(dic)
|
|
72
|
+
.Callback(true)
|
|
73
|
+
.OnceTime(true)
|
|
74
|
+
.CommandBuilder();
|
|
75
|
+
EngineBridge.GetInstance().CallHandler(command,
|
|
76
|
+
(result) => {
|
|
77
|
+
XDGLogger.Debug("PayWithParams 方法结果: " + result.ToJSON());
|
|
78
|
+
callback(new XDGOrderInfoWrapperMobile(result.content) as XDGOrderInfoWrapper);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
51
81
|
|
|
52
82
|
public void PayWithProduct(string orderId, string productId, string roleId, string serverId, string ext,
|
|
53
83
|
Action<XDGOrderInfoWrapper> callback){
|
|
Binary file
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
@class XDGOrderInfo;
|
|
7
7
|
|
|
8
|
+
@class XDGPaymentParams;
|
|
9
|
+
|
|
8
10
|
#import <XDPaymentSDK/XDGTransactionInfo.h>
|
|
9
11
|
|
|
10
12
|
NS_ASSUME_NONNULL_BEGIN
|
|
@@ -44,6 +46,11 @@ typedef void(^XDGRePaymentCallback)(XDGRepayMentCode code,NSString * _Nullable m
|
|
|
44
46
|
/// @param completionHandler 查询结果处理
|
|
45
47
|
+ (void)queryWithProductIds:(NSArray *)productIds completionHandler:(XDGQueryProductsCallback)completionHandler;
|
|
46
48
|
|
|
49
|
+
/// 支付商品 (支持批量购买)
|
|
50
|
+
/// @param paymentParam 支付参数
|
|
51
|
+
/// @param completionHandler 支付结果回调
|
|
52
|
+
+ (void)payWithParams:(XDGPaymentParams *)paymentParam completionHandler:(XDGPaymentCallback)completionHandler;
|
|
53
|
+
|
|
47
54
|
/// 支付商品
|
|
48
55
|
/// @param orderId 商品ID
|
|
49
56
|
/// @param productId 商品ID
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XDGPaymentParams.h
|
|
3
|
+
// XDPaymentSDK
|
|
4
|
+
//
|
|
5
|
+
// Created by Fattycat on 2024/9/13.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface XDGPaymentParams : NSObject
|
|
13
|
+
|
|
14
|
+
@property(nonatomic, strong, nullable) NSString *gameOrderId;
|
|
15
|
+
@property(nonatomic, strong) NSString *productId;
|
|
16
|
+
@property(nonatomic, strong, nullable) NSString *roleId;
|
|
17
|
+
@property(nonatomic, strong, nullable) NSString *serverId;
|
|
18
|
+
@property(nonatomic, strong, nullable) NSString *ext;
|
|
19
|
+
@property(nonatomic, assign) NSInteger quantity;
|
|
20
|
+
|
|
21
|
+
- (NSError *_Nullable)checkValid;
|
|
22
|
+
|
|
23
|
+
@end
|
|
24
|
+
|
|
25
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -10,9 +10,13 @@
|
|
|
10
10
|
NS_ASSUME_NONNULL_BEGIN
|
|
11
11
|
|
|
12
12
|
@interface XDGPaymentService : NSObject
|
|
13
|
+
|
|
13
14
|
// 查询 queryWithProductIds :
|
|
14
15
|
+ (void)productIds:(NSArray *)productIds bridgeCallback:(void (^)(NSString *result))callback;
|
|
15
16
|
|
|
17
|
+
+ (void)params:(NSDictionary *)params
|
|
18
|
+
bridgeCallback:(void (^)(NSString *result))callback;
|
|
19
|
+
|
|
16
20
|
// 支付 payWithProduct
|
|
17
21
|
+ (void)orderId:(NSString *)orderId
|
|
18
22
|
productId:(NSString *)productId
|
|
@@ -23,14 +27,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
23
27
|
|
|
24
28
|
+ (void)queryRestoredPurchases:(void (^)(NSString *result))callback;
|
|
25
29
|
|
|
26
|
-
+ (void)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
bridgeCallback:(void (^)(NSString *result))callback;
|
|
30
|
+
+ (void)transactionIdentifier:(NSString *)transactionIdentifier
|
|
31
|
+
productIdentifier:(NSString *)productIdentifier
|
|
32
|
+
orderId:(NSString *)orderId
|
|
33
|
+
roleId:(NSString *)roleId
|
|
34
|
+
serverId:(NSString *)serverId
|
|
35
|
+
ext:(NSString *)ext
|
|
36
|
+
bridgeCallback:(void (^)(NSString *result))callback;
|
|
34
37
|
|
|
35
38
|
/// 不带界面的补款
|
|
36
39
|
+ (void)checkRefundStatus:(void (^)(NSString *result))callback;
|
|
Binary file
|
|
Binary file
|
package/Runtime/IXDGPayment.cs
CHANGED
|
@@ -5,6 +5,8 @@ namespace XD.SDK.Payment
|
|
|
5
5
|
{
|
|
6
6
|
public interface IXDGPayment
|
|
7
7
|
{
|
|
8
|
+
void PayWithParams(XDGPaymentParams paymentParams, Action<XDGOrderInfoWrapper> callback);
|
|
9
|
+
|
|
8
10
|
void PayWithProduct(string orderId, string productId, string roleId, string serverId, string ext,
|
|
9
11
|
Action<XDGOrderInfoWrapper> callback);
|
|
10
12
|
|
package/Runtime/XDGPayment.cs
CHANGED
|
@@ -26,6 +26,11 @@ namespace XD.SDK.Payment{
|
|
|
26
26
|
TapLogger.Error($"No class implements {interfaceType} Type. Current Platform: {Application.platform}, if you are using Editor, please check if you have installed XDSDK pc module.");
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
public static void PayWithParams(XDGPaymentParams paymentParams, Action<XDGOrderInfoWrapper> callback)
|
|
31
|
+
{
|
|
32
|
+
platformWrapper.PayWithParams(paymentParams, callback);
|
|
33
|
+
}
|
|
29
34
|
|
|
30
35
|
public static void PayWithProduct(string orderId, string productId, string roleId, string serverId, string ext,
|
|
31
36
|
Action<XDGOrderInfoWrapper> callback){
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
using XD.SDK.Common.Internal;
|
|
2
|
+
|
|
3
|
+
namespace XD.SDK.Payment
|
|
4
|
+
{
|
|
5
|
+
public class XDGPaymentParams
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// 游戏订单号
|
|
9
|
+
/// 可以为空,为空时 SDK 会自动生成
|
|
10
|
+
/// </summary>
|
|
11
|
+
public string gameOrderId;
|
|
12
|
+
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// 商品ID
|
|
15
|
+
/// 不能为空
|
|
16
|
+
/// </summary>
|
|
17
|
+
public string productId;
|
|
18
|
+
|
|
19
|
+
/// <summary>
|
|
20
|
+
/// 角色 ID
|
|
21
|
+
/// 不建议为空
|
|
22
|
+
/// </summary>
|
|
23
|
+
public string roleId;
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
/// 服务器 ID
|
|
27
|
+
/// 不建议为空
|
|
28
|
+
/// </summary>
|
|
29
|
+
public string serverId;
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
/// 扩展字段
|
|
33
|
+
/// 可以为空,透传给游戏服务器
|
|
34
|
+
/// </summary>
|
|
35
|
+
public string ext;
|
|
36
|
+
|
|
37
|
+
/// <summary>
|
|
38
|
+
/// 数量
|
|
39
|
+
/// 只在 Apple 支付时有效,限制为 1-10,默认为 1
|
|
40
|
+
/// </summary>
|
|
41
|
+
public int quantity = 1;
|
|
42
|
+
|
|
43
|
+
public XDGPaymentParams()
|
|
44
|
+
{
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public XDGPaymentParams(string gameOrderId, string productId, string roleId, string serverId, string ext)
|
|
48
|
+
{
|
|
49
|
+
this.gameOrderId = gameOrderId;
|
|
50
|
+
this.productId = productId;
|
|
51
|
+
this.roleId = roleId;
|
|
52
|
+
this.serverId = serverId;
|
|
53
|
+
this.ext = ext;
|
|
54
|
+
this.quantity = 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public XDGPaymentParams(string gameOrderId, string productId, string roleId, string serverId, string ext, int quantity)
|
|
58
|
+
{
|
|
59
|
+
this.gameOrderId = gameOrderId;
|
|
60
|
+
this.productId = productId;
|
|
61
|
+
this.roleId = roleId;
|
|
62
|
+
this.serverId = serverId;
|
|
63
|
+
this.ext = ext;
|
|
64
|
+
this.quantity = quantity;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public XDException CheckValid()
|
|
68
|
+
{
|
|
69
|
+
if (string.IsNullOrEmpty(productId))
|
|
70
|
+
{
|
|
71
|
+
return new XDException(XDException.InvalidParam, "productId can not be null or empty");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (quantity < 1 || quantity > 10)
|
|
75
|
+
{
|
|
76
|
+
return new XDException(XDException.InvalidParam, "quantity must be between 1 and 10");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.xd.sdk.payment",
|
|
3
3
|
"displayName": "XDSDK Payment",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.23.0",
|
|
5
5
|
"description": "XDSDK",
|
|
6
6
|
"unity": "2018.3",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"com.xd.tds.common": "3.
|
|
9
|
+
"com.xd.tds.common": "3.29.4-xd.2"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
Binary file
|
|
File without changes
|