question

brendan avatar image
brendan asked

Purchasing many items at once with virtual currency

Question from a developer:

What's the best way to purchase multiple items all at once, using Virtual Currency? It looks like StartPurchase is the one to use, but what PaymentProvider do I specify?

In-Game EconomyPlayer 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

In the call to PayForPurchase, use the title as the provider. If you have VC prices defined, your response from StartPurchase should have something similar to what's in the example in the docs:

  {
    "Currency": "GV",
    "ProviderName": "TitleA90A",
    "Price": 25,
    "StoreCredit": 0
  }

So in this example, your call to PayForPurchase would specify "TitleA90A" as the PaymentProvider, and "GV" for the Currency. While this doesn't require any communication with an outside payment provider, you do then need to call ConfirmPurchase to finalize this, as that's the stage where we add the items to the player inventory.

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

carlos avatar image carlos commented ·

Hello @Brendan where can I get the "TitleA90A" equivalent for my project? I tried using my title name and title ID together but it didn't worked, also I was following this tutorial https://api.playfab.com/docs/tutorials/landing-commerce/stores where PayForPurchase is used without ProviderName but when I do it that way I get "InvalidParams" error on the Unity console.

0 Likes 0 ·
brendan avatar image brendan carlos commented ·

When you call StartPurchase, it'll show up in the response, as shown above. It's literally "Title" and your Title ID.

0 Likes 0 ·
carlos avatar image carlos brendan commented ·

oh! Great, thanks!

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.