com.xd.sdk.payment 6.23.13 → 6.26.2
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 +9 -0
- package/Mobile/XDGPaymentMobileImpl.cs +25 -0
- package/Plugins/Android/libs/XDGPayment_6.26.2.aar +0 -0
- package/Plugins/Android/libs/{XDGPayment_6.23.13.aar.meta → XDGPayment_6.26.2.aar.meta} +1 -1
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGPaymentVersion.h +3 -3
- package/Plugins/iOS/XDPaymentSDK.framework/Headers/XDGProductInfo.h +2 -0
- package/Plugins/iOS/XDPaymentSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDPaymentSDK.framework/XDPaymentSDK +0 -0
- package/Runtime/IXDGPayment.cs +1 -0
- package/Runtime/XDGPayment.cs +4 -0
- package/Runtime/XDGSkuDetailInfo.cs +58 -40
- package/package.json +1 -1
- package/Plugins/Android/libs/XDGPayment_6.23.13.aar +0 -0
|
@@ -32,6 +32,10 @@ namespace XD.SDK.Payment{
|
|
|
32
32
|
XDGPaymentMobileImpl.GetInstance().QueryWithProductIds(productIds, callback);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
public static void QueryProductList(string[] productIds, Action<XDGSkuDetailInfo> callback){
|
|
36
|
+
XDGPaymentMobileImpl.GetInstance().QueryProductList(productIds, callback);
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
public static void QueryRestoredPurchase(Action<List<XDGRestoredPurchase>> callback){
|
|
36
40
|
XDGPaymentMobileImpl.GetInstance().QueryRestoredPurchase(callback);
|
|
37
41
|
}
|
|
@@ -99,6 +103,11 @@ namespace XD.SDK.Payment{
|
|
|
99
103
|
QueryWithProductIds(productIds, callback);
|
|
100
104
|
}
|
|
101
105
|
|
|
106
|
+
void IXDGPayment.QueryProductList(string[] productIds, Action<XDGSkuDetailInfo> callback)
|
|
107
|
+
{
|
|
108
|
+
QueryProductList(productIds, callback);
|
|
109
|
+
}
|
|
110
|
+
|
|
102
111
|
void IXDGPayment.QueryRestoredPurchase(Action<List<XDGRestoredPurchase>> callback)
|
|
103
112
|
{
|
|
104
113
|
QueryRestoredPurchase(callback);
|
|
@@ -50,6 +50,31 @@ namespace XD.SDK.Payment{
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
public void QueryProductList(string[] productIds, Action<XDGSkuDetailInfo> callback){
|
|
54
|
+
var dic = new Dictionary<string, object>{
|
|
55
|
+
{"productIds", productIds}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var method = "queryWithProductIds";
|
|
59
|
+
|
|
60
|
+
#if UNITY_ANDROID
|
|
61
|
+
method = "queryProductList";
|
|
62
|
+
#endif
|
|
63
|
+
|
|
64
|
+
var command = new Command.Builder()
|
|
65
|
+
.Service(XDG_PAYMENT_SERVICE)
|
|
66
|
+
.Method(method)
|
|
67
|
+
.Args(dic)
|
|
68
|
+
.Callback(true)
|
|
69
|
+
.OnceTime(true)
|
|
70
|
+
.CommandBuilder();
|
|
71
|
+
|
|
72
|
+
EngineBridge.GetInstance().CallHandler(command, result => {
|
|
73
|
+
XDGLogger.Debug("queryWithProductIds 方法结果: " + result.ToJSON());
|
|
74
|
+
callback(new XDGSkuDetailInfoMobile(result.content) as XDGSkuDetailInfo);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
53
78
|
public void PayWithParams(XDGPaymentParams paymentParams, Action<XDGOrderInfoWrapper> callback)
|
|
54
79
|
{
|
|
55
80
|
var paramsDic = new Dictionary<string, object>{
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/Runtime/IXDGPayment.cs
CHANGED
|
@@ -21,6 +21,7 @@ namespace XD.SDK.Payment
|
|
|
21
21
|
Action<WebPayResultType, string> callback);
|
|
22
22
|
|
|
23
23
|
void QueryWithProductIds(string[] productIds, Action<XDGSkuDetailInfo> callback);
|
|
24
|
+
void QueryProductList(string[] productIds, Action<XDGSkuDetailInfo> callback);
|
|
24
25
|
|
|
25
26
|
void QueryRestoredPurchase(Action<List<XDGRestoredPurchase>> callback);
|
|
26
27
|
|
package/Runtime/XDGPayment.cs
CHANGED
|
@@ -52,6 +52,10 @@ namespace XD.SDK.Payment{
|
|
|
52
52
|
public static void QueryWithProductIds(string[] productIds, Action<XDGSkuDetailInfo> callback){
|
|
53
53
|
platformWrapper.QueryWithProductIds(productIds, callback);
|
|
54
54
|
}
|
|
55
|
+
|
|
56
|
+
public static void QueryProductList(string[] productIds, Action<XDGSkuDetailInfo> callback){
|
|
57
|
+
platformWrapper.QueryProductList(productIds, callback);
|
|
58
|
+
}
|
|
55
59
|
|
|
56
60
|
public static void QueryRestoredPurchase(Action<List<XDGRestoredPurchase>> callback){
|
|
57
61
|
platformWrapper.QueryRestoredPurchase(callback);
|
|
@@ -14,9 +14,15 @@ namespace XD.SDK.Payment
|
|
|
14
14
|
List<SkuDetailBean> skuDetailList { get; }
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
public class BaseSkuDetailBean
|
|
18
|
+
{
|
|
19
|
+
[JsonProperty("productId")] public string ProductId;
|
|
20
|
+
[JsonProperty("displayCostPrice")] public string DisplayPrice;
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
#if UNITY_IOS
|
|
18
24
|
[Serializable]
|
|
19
|
-
public class SkuDetailBean
|
|
25
|
+
public class SkuDetailBean: BaseSkuDetailBean
|
|
20
26
|
{
|
|
21
27
|
public string localizedDescription;
|
|
22
28
|
|
|
@@ -36,7 +42,8 @@ namespace XD.SDK.Payment
|
|
|
36
42
|
this.localeIdentifier = SafeDictionary.GetValue<string>(dic,"localeIdentifier");
|
|
37
43
|
this.localizedTitle = SafeDictionary.GetValue<string>(dic,"localizedTitle") ;
|
|
38
44
|
this.price = SafeDictionary.GetValue<double>(dic, "price");
|
|
39
|
-
this.productIdentifier = SafeDictionary.GetValue<string>(dic,"productIdentifier");
|
|
45
|
+
ProductId = this.productIdentifier = SafeDictionary.GetValue<string>(dic,"productIdentifier");
|
|
46
|
+
DisplayPrice = SafeDictionary.GetValue<string>(dic,"displayPrice");
|
|
40
47
|
Dictionary<string,object> priceLocaleDic =
|
|
41
48
|
SafeDictionary.GetValue<Dictionary<string,object>>(dic,"priceLocale") as Dictionary<string,object>;
|
|
42
49
|
this.priceLocale = new PriceLocale(priceLocaleDic);
|
|
@@ -47,7 +54,8 @@ namespace XD.SDK.Payment
|
|
|
47
54
|
this.localeIdentifier = SafeDictionary.GetValue<string>(dic,"localeIdentifier");
|
|
48
55
|
this.localizedTitle = SafeDictionary.GetValue<string>(dic,"localizedTitle") ;
|
|
49
56
|
this.price = SafeDictionary.GetValue<double>(dic,"price");
|
|
50
|
-
this.productIdentifier = SafeDictionary.GetValue<string>(dic,"productIdentifier");
|
|
57
|
+
ProductId = this.productIdentifier = SafeDictionary.GetValue<string>(dic,"productIdentifier");
|
|
58
|
+
DisplayPrice = SafeDictionary.GetValue<string>(dic,"displayPrice");
|
|
51
59
|
Dictionary<string,object> priceLocaleDic =
|
|
52
60
|
SafeDictionary.GetValue<Dictionary<string,object>>(dic,"priceLocale") as Dictionary<string,object>;
|
|
53
61
|
this.priceLocale = new PriceLocale(priceLocaleDic);
|
|
@@ -95,7 +103,7 @@ namespace XD.SDK.Payment
|
|
|
95
103
|
|
|
96
104
|
#elif UNITY_ANDROID
|
|
97
105
|
[Serializable]
|
|
98
|
-
public class SkuDetailBean
|
|
106
|
+
public class SkuDetailBean : BaseSkuDetailBean
|
|
99
107
|
{
|
|
100
108
|
private string _originString;
|
|
101
109
|
public string description;
|
|
@@ -116,65 +124,73 @@ namespace XD.SDK.Payment
|
|
|
116
124
|
_originString = SafeDictionary.GetValue<string>(dic, "originString");
|
|
117
125
|
description = SafeDictionary.GetValue<string>(dic, "description");
|
|
118
126
|
name = SafeDictionary.GetValue<string>(dic, "name");
|
|
119
|
-
|
|
127
|
+
var tempProductId = SafeDictionary.GetValue<string>(dic, "productId");
|
|
128
|
+
if (string.IsNullOrEmpty(tempProductId))
|
|
129
|
+
{
|
|
130
|
+
tempProductId = SafeDictionary.GetValue<string>(dic, "productSkuCode");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
ProductId = productId = tempProductId;
|
|
120
134
|
productType = SafeDictionary.GetValue<string>(dic, "productType");
|
|
121
135
|
title = SafeDictionary.GetValue<string>(dic, "title");
|
|
122
|
-
|
|
136
|
+
var googleDic = SafeDictionary.GetValue<Dictionary<string, object>>(dic, "googleOneTimePurchaseOfferDetails");
|
|
137
|
+
if (googleDic != null && googleDic.Count > 0)
|
|
138
|
+
{
|
|
139
|
+
googleOneTimePurchaseOfferDetails = new GoogleOneTimePurchaseOfferDetails(googleDic);
|
|
140
|
+
DisplayPrice = googleOneTimePurchaseOfferDetails.formattedPrice;
|
|
141
|
+
}
|
|
142
|
+
else
|
|
143
|
+
{
|
|
144
|
+
DisplayPrice = SafeDictionary.GetValue<string>(dic, "displayPrice");
|
|
145
|
+
}
|
|
123
146
|
}
|
|
124
147
|
}
|
|
125
|
-
|
|
148
|
+
|
|
126
149
|
[Serializable]
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
150
|
+
public class GoogleOneTimePurchaseOfferDetails
|
|
151
|
+
{
|
|
152
|
+
public string formattedPrice;
|
|
153
|
+
public long priceAmountMicros;
|
|
154
|
+
public string priceCurrencyCode;
|
|
132
155
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
156
|
+
public GoogleOneTimePurchaseOfferDetails(Dictionary<string, object> dic)
|
|
157
|
+
{
|
|
158
|
+
formattedPrice = SafeDictionary.GetValue<string>(dic, "formattedPrice");
|
|
159
|
+
priceAmountMicros = SafeDictionary.GetValue<long>(dic, "priceAmountMicros");
|
|
160
|
+
priceCurrencyCode = SafeDictionary.GetValue<string>(dic, "priceCurrencyCode");
|
|
139
161
|
}
|
|
162
|
+
}
|
|
140
163
|
#else
|
|
141
|
-
public class SkuDetailBean
|
|
164
|
+
public class SkuDetailBean : BaseSkuDetailBean
|
|
142
165
|
{
|
|
143
|
-
[JsonProperty("productSkuName")]
|
|
144
|
-
public string ProductSkuName { get; set; }
|
|
166
|
+
[JsonProperty("productSkuName")] public string ProductSkuName { get; set; }
|
|
145
167
|
|
|
146
|
-
[JsonProperty("productSkuCode")]
|
|
147
|
-
public string ProductSkuCode { get; set; }
|
|
168
|
+
[JsonProperty("productSkuCode")] public string ProductSkuCode { get; set; }
|
|
148
169
|
|
|
149
|
-
[JsonProperty("desc")]
|
|
150
|
-
public string Desc { get; set; }
|
|
170
|
+
[JsonProperty("desc")] public string Desc { get; set; }
|
|
151
171
|
|
|
152
|
-
[JsonProperty("channelSkuCode")]
|
|
153
|
-
public string ChannelSkuCode { get; set; }
|
|
172
|
+
[JsonProperty("channelSkuCode")] public string ChannelSkuCode { get; set; }
|
|
154
173
|
|
|
155
|
-
[JsonProperty("currency")]
|
|
156
|
-
public string Currency { get; set; }
|
|
174
|
+
[JsonProperty("currency")] public string Currency { get; set; }
|
|
157
175
|
|
|
158
|
-
[JsonProperty("region")]
|
|
159
|
-
public string Region { get; set; }
|
|
176
|
+
[JsonProperty("region")] public string Region { get; set; }
|
|
160
177
|
|
|
161
|
-
[JsonProperty("costPrice")]
|
|
162
|
-
public double CostPrice { get; set; }
|
|
178
|
+
[JsonProperty("costPrice")] public double CostPrice { get; set; }
|
|
163
179
|
|
|
164
|
-
[JsonProperty("salePrice")]
|
|
165
|
-
public double SalePrice { get; set; }
|
|
180
|
+
[JsonProperty("salePrice")] public double SalePrice { get; set; }
|
|
166
181
|
|
|
167
|
-
public string ToJSON()
|
|
182
|
+
public string ToJSON()
|
|
183
|
+
{
|
|
168
184
|
return JsonConvert.SerializeObject(this);
|
|
169
185
|
}
|
|
170
186
|
}
|
|
171
187
|
#endif
|
|
172
|
-
|
|
188
|
+
|
|
173
189
|
[Serializable]
|
|
174
190
|
public class XDGRestoredPurchase
|
|
175
191
|
{
|
|
176
192
|
public string purchaseToken;
|
|
177
|
-
|
|
193
|
+
|
|
178
194
|
public string productId;
|
|
179
195
|
|
|
180
196
|
#if UNITY_ANDROID
|
|
@@ -202,7 +218,7 @@ namespace XD.SDK.Payment
|
|
|
202
218
|
if (dic == null) return;
|
|
203
219
|
#if UNITY_IOS
|
|
204
220
|
this.purchaseToken = SafeDictionary.GetValue<string>(dic,"transactionIdentifier") ;
|
|
205
|
-
this.productId = SafeDictionary.GetValue<string>(dic,"productIdentifier") ;
|
|
221
|
+
this.productId = SafeDictionary.GetValue<string>(dic,"productIdentifier") ;
|
|
206
222
|
#elif UNITY_ANDROID
|
|
207
223
|
purchaseToken = SafeDictionary.GetValue<string>(dic, "purchaseToken");
|
|
208
224
|
productId = SafeDictionary.GetValue<string>(dic, "productId");
|
|
@@ -237,7 +253,9 @@ namespace XD.SDK.Payment
|
|
|
237
253
|
|
|
238
254
|
public string ext;
|
|
239
255
|
|
|
240
|
-
public XDGOrderInfo()
|
|
256
|
+
public XDGOrderInfo()
|
|
257
|
+
{
|
|
258
|
+
}
|
|
241
259
|
|
|
242
260
|
public XDGOrderInfo(Dictionary<string, object> dic)
|
|
243
261
|
{
|
package/package.json
CHANGED
|
Binary file
|