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.
@@ -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>{
@@ -1,5 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: 144543d77bad74c1fa342af5b293a64f
2
+ guid: d8986cf39263342d984411d425169b25
3
3
  PluginImporter:
4
4
  externalObjects: {}
5
5
  serializedVersion: 2
@@ -5,6 +5,6 @@
5
5
  // Created by Fattycat on 2023/4/14.
6
6
  //
7
7
 
8
- #define XDGPayment_VERSION @"6.23.8"
9
- #define XDGPayment_VERSION_CODE @"6023080"
10
- // HASH 838231ea
8
+ #define XDGPayment_VERSION @"6.26.2"
9
+ #define XDSPayment_VERSION_CODE @"6026020"
10
+ // HASH 3e572e74
@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
14
14
 
15
15
  @property(nonatomic,strong,readonly) NSString *productIdentifier;
16
16
 
17
+ @property(nonatomic,strong,readonly) NSString *displayPrice;
18
+
17
19
  @end
18
20
 
19
21
  NS_ASSUME_NONNULL_END
@@ -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
 
@@ -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
- productId = SafeDictionary.GetValue<string>(dic, "productId");
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
- googleOneTimePurchaseOfferDetails = new GoogleOneTimePurchaseOfferDetails(SafeDictionary.GetValue<Dictionary<string, object>>(dic, "googleOneTimePurchaseOfferDetails"));
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
- public class GoogleOneTimePurchaseOfferDetails
128
- {
129
- public string formattedPrice;
130
- public long priceAmountMicros;
131
- public string priceCurrencyCode;
150
+ public class GoogleOneTimePurchaseOfferDetails
151
+ {
152
+ public string formattedPrice;
153
+ public long priceAmountMicros;
154
+ public string priceCurrencyCode;
132
155
 
133
- public GoogleOneTimePurchaseOfferDetails(Dictionary<string, object> dic)
134
- {
135
- formattedPrice = SafeDictionary.GetValue<string>(dic, "formattedPrice");
136
- priceAmountMicros = SafeDictionary.GetValue<long>(dic, "priceAmountMicros");
137
- priceCurrencyCode = SafeDictionary.GetValue<string>(dic, "priceCurrencyCode");
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "com.xd.sdk.payment",
3
3
  "displayName": "XDSDK Payment",
4
- "version": "6.23.13",
4
+ "version": "6.26.2",
5
5
  "description": "XDSDK",
6
6
  "unity": "2018.3",
7
7
  "license": "MIT",