@@ -5058,18 +5058,52 @@ public static void GetWalletByWalletId(string walletId, Action<LootLockerGetWall
5058
5058
/// <summary>
5059
5059
/// Get information about a wallet for a specified holder
5060
5060
/// </summary>
5061
- /// <param name="holderId">Ulid of the holder of the wallet you want to get information for</param>
5061
+ /// <param name="holderUlid">ULID of the holder of the wallet you want to get information for</param>
5062
+ /// <param name="holderType">The type of the holder to get the wallet for</param>
5062
5063
/// <param name="onComplete">onComplete Action for handling the response</param>
5063
- public static void GetWalletByHolderId ( string holderId , Action < LootLockerGetWalletResponse > onComplete )
5064
+ public static void GetWalletByHolderId ( string holderUlid , LootLockerWalletHolderTypes holderType , Action < LootLockerGetWalletResponse > onComplete )
5064
5065
{
5065
5066
if ( ! CheckInitialized ( ) )
5066
5067
{
5067
5068
onComplete ? . Invoke ( LootLockerResponseFactory . SDKNotInitializedError < LootLockerGetWalletResponse > ( ) ) ;
5068
5069
return ;
5069
5070
}
5070
- var endpoint = string . Format ( LootLockerEndPoints . getWalletByHolderId . endPoint , holderId ) ;
5071
+ var endpoint = string . Format ( LootLockerEndPoints . getWalletByHolderId . endPoint , holderUlid ) ;
5071
5072
5072
- LootLockerServerRequest . CallAPI ( endpoint , LootLockerEndPoints . getWalletByHolderId . httpMethod , onComplete : ( serverResponse ) => { LootLockerResponse . Deserialize ( onComplete , serverResponse ) ; } ) ;
5073
+ LootLockerServerRequest . CallAPI ( endpoint , LootLockerEndPoints . getWalletByHolderId . httpMethod , onComplete :
5074
+ ( serverResponse ) =>
5075
+ {
5076
+ var parsedResponse = LootLockerResponse . Deserialize < LootLockerGetWalletResponse > ( serverResponse ) ;
5077
+ if ( ! parsedResponse . success && parsedResponse . statusCode == 404 )
5078
+ {
5079
+ LootLockerCreateWalletRequest request = new LootLockerCreateWalletRequest ( )
5080
+ {
5081
+ holder_id = holderUlid ,
5082
+ holder_type = holderType
5083
+ } ;
5084
+ LootLockerServerRequest . CallAPI ( LootLockerEndPoints . createWallet . endPoint ,
5085
+ LootLockerEndPoints . createWallet . httpMethod , LootLockerJson . SerializeObject ( request ) ,
5086
+ createWalletResponse =>
5087
+ {
5088
+ if ( createWalletResponse . success )
5089
+ {
5090
+ LootLockerServerRequest . CallAPI ( endpoint ,
5091
+ LootLockerEndPoints . getWalletByHolderId . httpMethod , null ,
5092
+ secondResponse =>
5093
+ {
5094
+ LootLockerResponse . Deserialize ( onComplete , secondResponse ) ;
5095
+ } ) ;
5096
+ return ;
5097
+ }
5098
+
5099
+ onComplete ? . Invoke ( parsedResponse ) ;
5100
+ } ) ;
5101
+ return ;
5102
+ }
5103
+
5104
+ onComplete ? . Invoke ( parsedResponse ) ;
5105
+ }
5106
+ ) ;
5073
5107
}
5074
5108
5075
5109
/// <summary>
0 commit comments