com.xd.sdk.payment 6.31.8 → 6.32.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.
@@ -5,6 +5,6 @@
5
5
  // Created by Fattycat on 2023/4/14.
6
6
  //
7
7
 
8
- #define XDGPayment_VERSION @"6.31.2"
9
- #define XDSPayment_VERSION_CODE @"6031020"
10
- // HASH 8f3e7f53
8
+ #define XDGPayment_VERSION @"6.32.0"
9
+ #define XDSPayment_VERSION_CODE @"6032000"
10
+ // HASH 18a9cc0c
@@ -111,6 +111,7 @@ namespace XD.SDK.Payment
111
111
  public string productId;
112
112
  public string productType;
113
113
  public string title;
114
+ public List<GoogleOneTimePurchaseOfferDetails> oneTimePurchaseOfferDetailsList;
114
115
  public GoogleOneTimePurchaseOfferDetails googleOneTimePurchaseOfferDetails;
115
116
 
116
117
  public override string ToString()
@@ -133,11 +134,20 @@ namespace XD.SDK.Payment
133
134
  ProductId = productId = tempProductId;
134
135
  productType = SafeDictionary.GetValue<string>(dic, "productType");
135
136
  title = SafeDictionary.GetValue<string>(dic, "title");
136
- var googleDic = SafeDictionary.GetValue<Dictionary<string, object>>(dic, "googleOneTimePurchaseOfferDetails");
137
- if (googleDic != null && googleDic.Count > 0)
137
+
138
+ var offerList = SafeDictionary.GetValue<List<object>>(dic, "oneTimePurchaseOfferDetailsList");
139
+ if (offerList != null && offerList.Count > 0)
138
140
  {
139
- googleOneTimePurchaseOfferDetails = new GoogleOneTimePurchaseOfferDetails(googleDic);
140
- DisplayPrice = googleOneTimePurchaseOfferDetails.formattedPrice;
141
+ oneTimePurchaseOfferDetailsList = new List<GoogleOneTimePurchaseOfferDetails>();
142
+ foreach (var item in offerList)
143
+ {
144
+ if (item is Dictionary<string, object> itemDic)
145
+ oneTimePurchaseOfferDetailsList.Add(new GoogleOneTimePurchaseOfferDetails(itemDic));
146
+ }
147
+ googleOneTimePurchaseOfferDetails = oneTimePurchaseOfferDetailsList.Count > 0
148
+ ? oneTimePurchaseOfferDetailsList[0]
149
+ : null;
150
+ DisplayPrice = googleOneTimePurchaseOfferDetails?.formattedPrice;
141
151
  }
142
152
  else
143
153
  {
@@ -152,12 +162,29 @@ namespace XD.SDK.Payment
152
162
  public string formattedPrice;
153
163
  public long priceAmountMicros;
154
164
  public string priceCurrencyCode;
165
+ public string offerToken;
166
+ public string offerId;
167
+ public string purchaseOptionId;
168
+ public long? fullPriceMicros;
169
+ public List<string> offerTags;
155
170
 
156
171
  public GoogleOneTimePurchaseOfferDetails(Dictionary<string, object> dic)
157
172
  {
158
173
  formattedPrice = SafeDictionary.GetValue<string>(dic, "formattedPrice");
159
174
  priceAmountMicros = SafeDictionary.GetValue<long>(dic, "priceAmountMicros");
160
175
  priceCurrencyCode = SafeDictionary.GetValue<string>(dic, "priceCurrencyCode");
176
+ offerToken = SafeDictionary.GetValue<string>(dic, "offerToken");
177
+ offerId = SafeDictionary.GetValue<string>(dic, "offerId");
178
+ purchaseOptionId = SafeDictionary.GetValue<string>(dic, "purchaseOptionId");
179
+ if (dic.TryGetValue("fullPriceMicros", out var rawFullPriceMicros) && rawFullPriceMicros != null)
180
+ {
181
+ fullPriceMicros = long.Parse(rawFullPriceMicros.ToString());
182
+ }
183
+ var rawOfferTags = SafeDictionary.GetValue<List<object>>(dic, "offerTags");
184
+ if (rawOfferTags != null)
185
+ {
186
+ offerTags = rawOfferTags.ConvertAll(t => t?.ToString());
187
+ }
161
188
  }
162
189
  }
163
190
  #else
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.31.8",
4
+ "version": "6.32.0",
5
5
  "description": "XDSDK",
6
6
  "unity": "2018.3",
7
7
  "license": "MIT",