question

Jonathan Schenker avatar image
Jonathan Schenker asked

Playfab Server Purchase Confirmation

Hello, we have set up our backend server to do a custom Xsolla + Playfab integration (not using the Playfab "Xsolla Addon" so that we can use custom XSolla UI styling) where we receive the Xsolla webhooks on our backend and finish up the transactions.

Our current flow looks like the following:

Client (Unity) creates a `StartPurchaseRequest` -> Recieves an OrderID


Client sends a request to Backend with (OrderID, PlayfabID)

Backend calculates the correct price and requests an Xsolla payment token for the purchase, and returns it to the Client

Client opens Xsolla Paystation with token and Pays amount

Xsolla sends Backend a Payment-Made confirmation with (OrderID, PlayfabID) info

All of this is working, and the last steps I would like to do are the following:

Backend Retrieves Item info for OrderID and grants items to user (from PlayfabID)

Backend sets OrderID for Player as "Succeeded" (instead of "Cart created")

What would be the easiest way to do this? I have not found an API to let me get a 'cart' based on a PlayfabID + OrderID which is what seemed intuitive to me.
I think it is probably possible to achieve this with cloud code, but that seems more complex (don't have any cloud code in project currently).

As for the last step, it might not be critical, but it would be nice so that the Client can use the GetPurchase method as intended on the OrderID that they created.

Thanks for the help!

Player Inventory
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

I know we discussed this in Discord, but posting here, so that others have the info:

The only Xsolla integration we have is with their Simple Payments system. If you're using the Xsolla catalog, there's no direct way for us to get the info about the items you've sold the player. You would need to get the tokens from Xsolla and grant the items to the player directly (potentially in an Azure Functions Cloud Script). We wouldn't be able to track on the money spent in that case, so that also wouldn't show up in your dashboard (though we do have a backlog item to add an API call in inject a payment amount into the event stream, for payments occurring outside the systems in PlayFab directly).

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.