Hi, I would like to ask which part I am missing. I got to receive an OK response from PlayFabClientAPI.StartPurchase and PlayFabClientAPI.PayForPurchase
But it's not opening any PayPal Checkout Express WebView.
This is my code for StartPurchase
PlayFabClientAPI.StartPurchase(new StartPurchaseRequest() { CatalogVersion = "Live01", Items = new List<ItemPurchaseRequest>() { new ItemPurchaseRequest() { ItemId = id, Quantity = 1, Annotation = "Purchased via in-game?" } } }, resultCallback => { Debug.LogWarningFormat("Start Purchase Result OK: {0} \n\n Contents:{1}", resultCallback.OrderId, resultCallback.Contents); RequestPurchaseComplete(resultCallback.OrderId); }, errorCallback => { Debug.LogWarning("Error callback? What to put here?/"); } );
This is my code for PayForPurchase (Called when the StartPurchase returns an OK result)
private void RequestPurchaseComplete(string orderId) { PlayFabClientAPI.PayForPurchase(new PayForPurchaseRequest() { OrderId = orderId, ProviderName = "PayPal", Currency = "RM" }, resultCallback => { Debug.LogWarningFormat("Payfor puchase completed?{0} \n status:{1}", resultCallback.PurchasePrice, resultCallback.Status); }, errorCallback => { Debug.LogWarningFormat("Error purcahse paypal:{0}\n errorDetails:{1} \n errorCallbackError:{2}", errorCallback.ErrorMessage, errorCallback.ErrorDetails, errorCallback.Error); }); }
I had PlayFab authorized in PayPal. And then also installed PayPal add-on in PlayFab Account with the Merchant ID and Sample Return Link in the image below.
2020-02-04-18-41-37-strokesplus.png
Please let me know if I am missing something. Thank you.