question

Abquhazar avatar image
Abquhazar asked

Checkout PayerID is missing

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.

Partner Add-ons
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Rick Chen avatar image
Rick Chen answered

If you have successfully installed the PayPal Add-on to your title, the PayForPurchase API should return a PurchaseConfirmationPageURL. This is the payment confirmation page, what you need to do is to present the player with this page. After the player finished the payment from the paypal interface, you could then use ConfirmPurchase API to add items to the player inventory. Please refer to: https://docs.microsoft.com/en-us/gaming/playfab/features/commerce/economy/non-receipt-payment-processing#paypal

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.