question

madouc-game avatar image
madouc-game asked

How to confirm steam overlay payment after PayForPurchase?

Hello,

I'm trying to had a payment processing using steam. Right now i added all the functions(startPurchase,PayForPurchase,...) and the steam overlay opens but i don't know what to do after that.

I can't find any documention on how to know if the users authorised the payment or not on my code and confirm the purchase.

Can someone explain me what happened when steam overlay opens and how to use it?

Thanks

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

swapnilnegi avatar image swapnilnegi commented ·

@madouc-game

Were you able to get the steam overlay in Unity editor? I am not able to get the steam overlay after successful PayForPurchase call which shows status as Init.

0 Likes 0 ·
madouc-game avatar image madouc-game swapnilnegi commented ·

Hello, i'm working on Unreal with the playfab plugins. I don't have any experience with Unity sorry.

0 Likes 0 ·
swapnilnegi avatar image swapnilnegi commented ·

@madouc-game Were you able to authorize the payment using the overlay? Even I get the overlay but when I press authorize nothing happens.

0 Likes 0 ·
madouc-game avatar image madouc-game swapnilnegi commented ·

No I still don't understand how to implement the callback in my game.

0 Likes 0 ·
brendan avatar image brendan madouc-game commented ·

Can you please specify where you're getting blocked? Are you having trouble registering for the callback?

0 Likes 0 ·
Show more comments
swapnilnegi avatar image swapnilnegi swapnilnegi commented ·

Yes its MicroTxnAuthorizationResponse_t, Yes i have callled Steam Init. Thanks for your reply!

0 Likes 0 ·
SniperED007 avatar image SniperED007 swapnilnegi commented ·

Did you manage to get it working, if so how?

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

The complete write-up on this is here: https://api.playfab.com/docs/tutorials/landing-commerce/non-receipt-payment-processing. In short, you need to register a callback handler for the MicroTxnAuthorizationResponse_t callback from Steam. When the pop-up has closed, you'll get the callback and can then call ConfirmPurchase, which will verify with Steam that the payment whether successful and, if so, add the purchased item(s) to the player inventory.

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.

eswitzer07 avatar image eswitzer07 commented ·

Not sure if Im allowed to bump a dead thread, but I was curious on the easiest way to do this?

Im doing all my playfab work in blueprint, and Im not sure how to register the callback without diving into cpp.

Is there a built in method for getting this callback? Currently my title is just looping a timer when the purchase is sent, to see if its authorized or still pending. This of course isnt ideal, as its spamming the server with API calls.

0 Likes 0 ·
brendan avatar image brendan eswitzer07 commented ·

Sorry, but I don't believe Unreal provides a built-in Steam callback processor for Blueprints, so you will need to implement a small function in their C++ code to do this. Spamming the server with calls is an extremely bad idea, as it can get your title throttled or blocked. Worst case, you would need to use an exponential backoff on the purchase check call, so that you increase the amount of time for each call (2 seconds, then 8, 30, etc.).

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.