Hey !
I have been trying for a few weeks now to setup XSolla with Playfab but I cannot figure out what I am doing wrong.
My Playfab webhook URL is correctly set up on XSolla however I don't understand nor have I found any code sample to guide me on how to make the correct calls and send the correct data to XSolla, does anyone have a C#/.NET sample they are willing to share ?
I am just lost on how things are supposed to be going, and XSolla support hasn't been able to help at all. I am just willing to know the steps I need to take to go from pressing the button in my app to the user getting his virtual currency on his Playfab Account.
Ideally, I would only want to use XSolla as a gateway and perform every UI related thing on my own app, if at all possible.
Here is my current code that is supposed to call the Payment Gateway on XSolla but instead opens the store where none of my items are shown :
public static void XsollaRequest() { var requestPaymentToken = new GetPaymentTokenRequest { TokenProvider = "xsolla" }; var PaymentTokenTask = PlayFabClientAPI.GetPaymentTokenAsync(requestPaymentToken); var requestPurchase = new GetPurchaseRequest { OrderId = PaymentTokenTask.Result.Result.OrderId }; var PurchaseTask = PlayFabClientAPI.GetPurchaseAsync(requestPurchase); if (PaymentTokenTask.IsCompleted) { OnPurchaseComplete(PaymentTokenTask); string target = "https://sandbox-secure.xsolla.com/paystation3/?access_token=" + PaymentTokenTask.Result.Result.ProviderToken; try { Process.Start(new ProcessStartInfo(target) { UseShellExecute = true }); } catch (System.ComponentModel.Win32Exception noBrowser) { if (noBrowser.ErrorCode == -2147467259) Console.WriteLine(noBrowser.Message); MessageBox.Show(noBrowser.Message); } catch (System.Exception other) { Console.WriteLine(other.Message); MessageBox.Show(other.Message); } Console.WriteLine(PurchaseTask.Result.Result); } } private static void OnPurchaseComplete(Task<PlayFabResult<GetPaymentTokenResult>> TokenTaskResult) { var apiError = TokenTaskResult.Result.Error; var apiResult = TokenTaskResult.Result.Result; if (apiError != null) { Console.WriteLine("Something went wrong with API call. :("); Console.WriteLine(PlayFabUtil.GenerateErrorReport(apiError)); } else if (apiResult != null) { Console.WriteLine("Congratulations, successful API call!"); } } private void PurchaseButton(object sender, RoutedEventArgs e) { XsollaRequest(); }
Any help is greatly appreciated and thanks a million in advance !