question

julez avatar image
julez asked

ConfirmPurchase - failed by payment provider

I wrote my Paypal Email in the PlayFab-Paypal Addon.

I dont know the return link so I just wrote "http://www.google.de". <- ist this the problem?

I get following error message on my ConfirmPurchase in Unity:

Playfab Purchase:

My onPayResult Code:

 private void OnPayResult(PayForPurchaseResult purchase)
    {
        Debug.Log("Payment started !");

        ConfirmPurchaseResult confirmResult = new ConfirmPurchaseResult();

        Debug.Log("Order Confirmed: "+ purchase.OrderId + " on " + confirmResult.PurchaseDate + " confirmID: "+confirmResult.OrderId);


        
        PlayFabClientAPI.ConfirmPurchase(new ConfirmPurchaseRequest()
        {
            OrderId = purchase.OrderId
        }, result => {
            Debug.Log("Purchase Confirmed !");
            // Handle success
        }, error => {
            Debug.Log("Purchase Failed ! " +error.ErrorMessage);
            // Handle error
        });
        

    }
l1fif.png (3.2 KiB)
kadas.png (15.1 KiB)
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

·
brendan avatar image
brendan answered

Have a look at this thread: https://community.playfab.com/questions/638/208252737-PlayFab-and-PayPal-integration-problem.html (which also has info on the Return URL). That specific error means that when we attempted to confirm that the payment was complete with PayPal, they said it wasn't. In all likelihood, this is going to be a configuration issue.

5 comments
10 |1200

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

julez avatar image julez commented ·

Thanks for your response.

As far as I know there is no "page" in Unity I could refer to - can I refer to a scene? Or maybe just handle it with 'confirmPurchase' 'result =>' ?

I also know that you use 'Express Checkout' but I saw that this method cannot be implemented anymore:

Express Checkout - NVP/SOAP (Deprecated)

"Important: This integration method is deprecated as of January 1, 2017. PayPal continues to support existing merchants using this method, but please be advised new features and enhancements will not be applied to these integrations. For new integrations, see the PayPal Subscriptions Integration Guide."

Source: https://developer.paypal.com/docs/classic/express-checkout/ec_integration/

Could this lead to my problem? I checked the steps several times and can't find coniguration issues :/

0 Likes 0 ·
Andy avatar image Andy ♦♦ julez commented ·

The "page" referred to in the thread Brendan linked is a web page associated with the Return URL. You have to show that page in your game and allow the user to enter any required information before submitting. To do so, you'll need a Unity component capable of rendering HTML pages. There are quite a few available on the marketplace.

1 Like 1 ·
julez avatar image julez commented ·

@Andy I can now display a website in the App.

Im using this to have a unity browser:

https://bitbucket.org/vitaly_chashin/simpleunitybrowser/overview

How do I trigger the payment request? I have still the same Error :/

Do I need to connect PlayFab to that browser component in any way or how do I process further?

0 Likes 0 ·
brendan avatar image brendan julez commented ·

No, that part of the process - the payment confirmation page - has nothing to do with PlayFab. I'd suggest reviewing our non-receipt payment tutorial and the PayPal guide for express checkouts:

https://api.playfab.com/docs/tutorials/landing-commerce/non-receipt-payment-processing

https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReference/#troubleshooting

The only way we would return that specific error - "failed by payment provider" - is if a) the player did not confirm the purchase in the PayPal interface you present to them, or b) PayPal determines that the payment is invalid for some other reason, such as their fraud detection. How specifically are you taking care of presenting the player with the purchase screen?

0 Likes 0 ·
julez avatar image julez commented ·

@Brendan thanks for your response! It works now ! :)

I didnt know where I get the Paypal URL for the Player to confirm at...Sorry that I missed that line in the documentary.


I'm so grateful for your help! :)

0 Likes 0 ·

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.