question

kendrickvillaruel avatar image
kendrickvillaruel asked

PayPal Webview not Showing Up

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.

apis
10 |1200

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

Jordan avatar image
Jordan answered

Hi @kendrickvillaruel,

For PayPal purchasing, you will need to show the player the PayPal interface. Present the user with the Payment Confirmation page, which is returned from PayForPurchase to you as the PurchaseConfrimationPageURL (see more information at non-receipt payment processing)

Once the window is dismissed, then you can move to confirming the purchase in PlayFab with ConfirmPurchase.

Let me know if this is what you needed.

10 |1200

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

kendrickvillaruel avatar image
kendrickvillaruel answered

Got it now. Thank you!

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.