Skip to content

Commit 6f9b033

Browse files
Erik Bylundkirre-bylund
authored andcommitted
Change character to class for store redemptions
1 parent 0d686d6 commit 6f9b033

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4302,22 +4302,22 @@ public static void RedeemAppleAppStorePurchaseForPlayer(string transactionId, Ac
43024302
}
43034303

43044304
/// <summary>
4305-
/// Redeem a purchase that was made successfully towards the Apple App Store for a character that the current player owns
4305+
/// Redeem a purchase that was made successfully towards the Apple App Store for a class that the current player owns
43064306
/// </summary>
43074307
/// <param name="transactionId">The id of the transaction successfully made towards the Apple App Store</param>
4308-
/// <param name="characterId">The id of the character to redeem this transaction for</param>
4308+
/// <param name="classId">The id of the class to redeem this transaction for</param>
43094309
/// <param name="onComplete">onComplete Action for handling the response</param>
4310-
public static void RedeemAppleAppStorePurchaseForCharacter(string transactionId, int characterId, Action<LootLockerResponse> onComplete)
4310+
public static void RedeemAppleAppStorePurchaseForClass(string transactionId, int classId, Action<LootLockerResponse> onComplete)
43114311
{
43124312
if (!CheckInitialized())
43134313
{
43144314
onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerResponse>());
43154315
return;
43164316
}
4317-
var body = LootLockerJson.SerializeObject(new LootLockerRedeemAppleAppStorePurchaseForCharacterRequest()
4317+
var body = LootLockerJson.SerializeObject(new LootLockerRedeemAppleAppStorePurchaseForClassRequest()
43184318
{
43194319
transaction_id = transactionId,
4320-
character_id = characterId
4320+
class_id = classId
43214321
});
43224322

43234323
LootLockerServerRequest.CallAPI(LootLockerEndPoints.redeemAppleAppStorePurchase.endPoint, LootLockerEndPoints.redeemAppleAppStorePurchase.httpMethod, body, onComplete: (serverResponse) => { LootLockerResponse.Deserialize(onComplete, serverResponse); });
@@ -4346,24 +4346,24 @@ public static void RedeemGooglePlayStorePurchaseForPlayer(string productId, stri
43464346
}
43474347

43484348
/// <summary>
4349-
/// Redeem a purchase that was made successfully towards the Google Play Store for a character that the current player owns
4349+
/// Redeem a purchase that was made successfully towards the Google Play Store for a class that the current player owns
43504350
/// </summary>
43514351
/// <param name="productId">The id of the product that this redemption refers to</param>
43524352
/// <param name="purchaseToken">The token from the purchase successfully made towards the Google Play Store</param>
4353-
/// <param name="characterId">The id of the character to redeem this purchase for</param>
4353+
/// <param name="classId">The id of the class to redeem this purchase for</param>
43544354
/// <param name="onComplete">onComplete Action for handling the response</param>
4355-
public static void RedeemGooglePlayStorePurchaseForCharacter(string productId, string purchaseToken, int characterId, Action<LootLockerResponse> onComplete)
4355+
public static void RedeemGooglePlayStorePurchaseForClass(string productId, string purchaseToken, int classId, Action<LootLockerResponse> onComplete)
43564356
{
43574357
if (!CheckInitialized())
43584358
{
43594359
onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerResponse>());
43604360
return;
43614361
}
4362-
var body = LootLockerJson.SerializeObject(new LootLockerRedeemGooglePlayStorePurchaseForCharacterRequest()
4362+
var body = LootLockerJson.SerializeObject(new LootLockerRedeemGooglePlayStorePurchaseForClassRequest()
43634363
{
43644364
product_id = productId,
43654365
purchase_token = purchaseToken,
4366-
character_id = characterId
4366+
class_id = classId
43674367
});
43684368

43694369
LootLockerServerRequest.CallAPI(LootLockerEndPoints.redeemGooglePlayStorePurchase.endPoint, LootLockerEndPoints.redeemGooglePlayStorePurchase.httpMethod, body, onComplete: (serverResponse) => { LootLockerResponse.Deserialize(onComplete, serverResponse); });

Runtime/Game/Requests/PurchaseRequest.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
using LootLocker.Requests;
22
using System;
3+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
4+
using Newtonsoft.Json;
5+
#else
6+
using LLlibs.ZeroDepJson;
7+
#endif
38

49
namespace LootLocker.Requests
510
{
@@ -102,12 +107,17 @@ public class LootLockerRedeemAppleAppStorePurchaseForPlayerRequest
102107
/// <summary>
103108
///
104109
/// </summary>
105-
public class LootLockerRedeemAppleAppStorePurchaseForCharacterRequest : LootLockerRedeemAppleAppStorePurchaseForPlayerRequest
110+
public class LootLockerRedeemAppleAppStorePurchaseForClassRequest : LootLockerRedeemAppleAppStorePurchaseForPlayerRequest
106111
{
107112
/// <summary>
108-
/// The id of the character to redeem this transaction for
113+
/// The id of the class to redeem this transaction for
109114
/// </summary>
110-
public int character_id { get; set; }
115+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
116+
[JsonProperty("character_id")]
117+
#else
118+
[Json(Name = "character_id")]
119+
#endif
120+
public int class_id { get; set; }
111121
}
112122

113123
/// <summary>
@@ -128,12 +138,17 @@ public class LootLockerRedeemGooglePlayStorePurchaseForPlayerRequest
128138
/// <summary>
129139
///
130140
/// </summary>
131-
public class LootLockerRedeemGooglePlayStorePurchaseForCharacterRequest : LootLockerRedeemGooglePlayStorePurchaseForPlayerRequest
141+
public class LootLockerRedeemGooglePlayStorePurchaseForClassRequest : LootLockerRedeemGooglePlayStorePurchaseForPlayerRequest
132142
{
133143
/// <summary>
134-
/// The id of the character to redeem this purchase for
144+
/// The id of the class to redeem this purchase for
135145
/// </summary>
136-
public int character_id { get; set; }
146+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
147+
[JsonProperty("character_id")]
148+
#else
149+
[Json(Name = "character_id")]
150+
#endif
151+
public int class_id { get; set; }
137152
}
138153
}
139154

0 commit comments

Comments
 (0)