question

carlo avatar image
carlo asked

integration flow with Paypal

Hi,

We are in the process to integrate paypal and I am a little confused about the confirmpurchase() using unity SDK. In the documentation

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

we can see a field called "status:succeed" but we cannot see that variable when using the API, so are we supposed to call this function after the payment has been done (so do we need to ask the user to press a button after payment) or can we poll this every N seconds to check if the item has been purchased ? Right now when the Paypal dialog is displayed with the correct price and everything the user can enter his paypal login, but if if we call confirmpurchase() without touching anything, we got the following error :

PlayFabError(FailedByPaymentProvider, Failed by payment provider, 400 BadRequest - Details: ProviderErrorCode: 1 | ProviderErrorMessage: Failure | ProviderErrorDetails: FinalizeTransaction failed, Ack=FailureExpress Checkout PayerID is missing. The PayerID value is invalid.

So can somebody advise if we did something wrong or what should be the correct flow ? To get confirmation in the client side that the Paypal transaction was OK ?

Thank you

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

·
brendan avatar image
brendan answered

In the case of PayPal, the purchase is completed in the PayPal interface. Until that is done, the ConfirmPurchase call will always fail (since PayPal doesn't register the payment as finished until the actual money charge/transfer has occurred).

After you have completed the purchase in the PayPal interface, you should be able to successfully call ConfrimPurchase.

2 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.

carlo avatar image carlo commented ·

Thank you for the quick reply,

Just for the knowledge, is there a way to check the difference between that particular error that we get to call earlier before the paypal transaction is done and an error because the transaction went through but was rejected or canceled ?

0 Likes 0 ·
brendan avatar image brendan carlo commented ·

Yes, for any case where the error is FailedByPaymentProvider, the errorDetails is the response will contain any additional information we have on why the transaction failed.

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.