Hello, everyone
I’m integrating non-recept payments into my game (with paypal) and i'm having an issue with the confirm payments. Specifically with the PayerID missing. I double checked my merchant ID within PayPal and in PlayFab and it seems to be correct.
The whole error message is this:
/Client/ConfirmPurchase: Failed by payment provider ProviderErrorCode: 1 ProviderErrorMessage: Failure ProviderErrorDetails: FinalizeTransaction failed, Ack=FailureExpress Checkout PayerID is missing. The PayerID value is invalid. ProviderOrderId: UnityEngine.Debug:LogError(Object) <>c:<confirmPurchase>b__2_1(PlayFabError) (at Assets/Scripts/PayPalController.cs:61) PlayFab.Internal.PlayFabUnityHttp:OnResponse(String, CallRequestContainer) (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:260) PlayFab.Internal.<Post>d__12:MoveNext() (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:190) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
I have a hunch it is due to the way my code is set up. I’m unsure where to put the ‘confirmPurchase(orderid)’ line. I know a paypal window is supposed to appear but i never see that it does. I believe my issue will be within either payForPurchase() or confirmPurchase().
PlayFabClientAPI.StartPurchase(new StartPurchaseRequest() { CatalogVersion = "IAP1_0", Items = new List<ItemPurchaseRequest>() { new ItemPurchaseRequest() { ItemId = "One", Quantity = 1, Annotation = "Purchased via in-game store" } } }, result => { // Handle success Debug.Log(result); payForPurchase(result.OrderId); }, error => { // Handle error Debug.LogError(error.GenerateErrorReport()); }); } void payForPurchase(string orderId) { PlayFabClientAPI.PayForPurchase(new PayForPurchaseRequest() { OrderId = orderId, ProviderName = "PayPal", Currency = "RM" }, result => { // Handle success Debug.Log("Pay for purchase was successful"); confirmPurchase(orderId); }, error => { // Handle error Debug.LogError(error.GenerateErrorReport()); }); } void confirmPurchase(string orderId) { PlayFabClientAPI.ConfirmPurchase(new ConfirmPurchaseRequest() { OrderId = orderId }, result => { //Handle success Debug.Log("Comfirm purchase was successful"); }, error => { //Handle error Debug.LogError(error.GenerateErrorReport()); }); }
If anyone has a solution let me know. I feel like the answer is obvious, I'm just missing something here.