From 0e062bbf1ed2a87d7fb6d6698d70fb7414a0de91 Mon Sep 17 00:00:00 2001 From: Ondrej Rehacek Date: Tue, 29 Oct 2024 14:23:31 +0100 Subject: [PATCH] Refactoring, fix constants. --- .../Stash.Sample/Scripts/DeeplinkExample.cs | 19 +++++-------------- Assets/Stash/Scripts/Core/StashConstants.cs | 2 +- .../Stash/Scripts/Models/CheckoutResponse.cs | 5 ++++- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Assets/Stash.Sample/Scripts/DeeplinkExample.cs b/Assets/Stash.Sample/Scripts/DeeplinkExample.cs index ee11804..11184f9 100644 --- a/Assets/Stash.Sample/Scripts/DeeplinkExample.cs +++ b/Assets/Stash.Sample/Scripts/DeeplinkExample.cs @@ -19,14 +19,7 @@ public class DeeplinkExample : MonoBehaviour private async void Awake() { - try{ - CheckoutResponse response = await StashLauncher.Checkout("ITEM_ID", "ID_PLAYER", "ID_TOKEN", StashEnvironment.Test); - } - catch (StashRequestError e) - { - Console.WriteLine(e); - throw; - } + //Event handler "OnDeepLinkActivated" is invoked every time the game is launched or resumed via the Stash’s deep link. if (Instance == null) @@ -50,12 +43,10 @@ private async void Awake() private async void Start() { - Debug.Log("TRYING "); - - try - { - LinkResponse response = await StashCustomLogin.LinkFacebook("LINK_CODE", "PLAYER_ID", "FB_APPID", "ACCESS_TOKEN", StashEnvironment.Test); - + try{ + CheckoutResponse response = await StashLauncher.Checkout("realMoneyProduct_gems_001", "351eb55e-16c5-431a-b4fa-8e00537e0523", "eyJhbGciOiJSUzI1NiIsImtpZCI6IjhkOWJlZmQzZWZmY2JiYzgyYzgzYWQwYzk3MmM4ZWE5NzhmNmYxMzciLCJ0eXAiOiJKV1QifQ.eyJuYW1lIjoiT25kcmVqIFJlaGFjZWsiLCJwaWN0dXJlIjoiaHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EvQUNnOG9jSnFxM2hHX3V4T204STE3Zm5nVjRIc29NNWZoUmpSWEZFbVRBTXBna0F4WlVuRHBVRT1zOTYtYyIsImlzcyI6Imh0dHBzOi8vc2VjdXJldG9rZW4uZ29vZ2xlLmNvbS9waWUtc3R1ZGlvLTc5YTkyIiwiYXVkIjoicGllLXN0dWRpby03OWE5MiIsImF1dGhfdGltZSI6MTcyNzM2NjMxOSwidXNlcl9pZCI6IlJ0bnpwRlZTVEdhcEp4OERDNHNpc1VHRFBrUzIiLCJzdWIiOiJSdG56cEZWU1RHYXBKeDhEQzRzaXNVR0RQa1MyIiwiaWF0IjoxNzI5MTE2MTMwLCJleHAiOjE3MjkxMTk3MzAsImVtYWlsIjoib25kcmVqQGZyYWN0YWwuaXMiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiZmlyZWJhc2UiOnsiaWRlbnRpdGllcyI6eyJnb29nbGUuY29tIjpbIjExNjUzOTk1MTA2ODE3MjY0MzA3NCJdLCJlbWFpbCI6WyJvbmRyZWpAZnJhY3RhbC5pcyJdfSwic2lnbl9pbl9wcm92aWRlciI6Imdvb2dsZS5jb20ifX0.PZOOAU3El4mQdDx51HmwS3RR-5qb1IbxLbQMrU-IlVrlY2JBC2YTKD_0yLBl5E-cgXrCVTJS7rw8k_ABP_tVrlJsz5n2pqAOP_0GNacRMnFZPEB0llKGr85vhuTTyuQexTK_-2qwA8RcUMrbeIF97xJPWilnvIEyFIpuwGyelocODCMsOgAPDmfxSzGP40SG-ss3u7XdbfFwRHDcgOI2cXiYHe7UDYPYN0oD0t5WBr93PhhPg-TMRYkOhD_60Hd_eYXedq7D2QbzvF4THhuXws95sufBL8Yy5EstcfZUegWyYOHW494nkiBpD4ruynI-Qm_rMWdeqaFEgWnvDCtRJw", StashEnvironment.Test); + Debug.Log(response.url); + Application.OpenURL(response.url); } catch (StashRequestError e) { diff --git a/Assets/Stash/Scripts/Core/StashConstants.cs b/Assets/Stash/Scripts/Core/StashConstants.cs index 3553b12..278a9ac 100644 --- a/Assets/Stash/Scripts/Core/StashConstants.cs +++ b/Assets/Stash/Scripts/Core/StashConstants.cs @@ -3,7 +3,7 @@ namespace Stash.Core public class StashConstants { //TODO: Switch to package file. - public const string SdkVersion = "0.9.0"; + public const string SdkVersion = "0.9.1"; //Root URLs public const string RootUrl = "https://api.stash.gg"; diff --git a/Assets/Stash/Scripts/Models/CheckoutResponse.cs b/Assets/Stash/Scripts/Models/CheckoutResponse.cs index 83c9731..23dad54 100644 --- a/Assets/Stash/Scripts/Models/CheckoutResponse.cs +++ b/Assets/Stash/Scripts/Models/CheckoutResponse.cs @@ -1,7 +1,10 @@ +using System; + namespace Stash.Models { + [Serializable] public class CheckoutResponse { - public string url { get; set; } + public string url; } } \ No newline at end of file