question

Ricardo Chavarria avatar image
Ricardo Chavarria asked

How to award and item quantity

Seeing as we have no way to purchase multiple items in one transaction from the client, I made a CloudScript that takes an array of items and purchases them.

Now I have another problem. In our game, people may just buy a bunch of items in quick succession, so we want to minimize transactions by bunching them together in one call when they close the store.

I could grant items to the player using the same CloudScript, but I have no way of awarding more than the amount specified in the Item Catalog.

Is there a solution or workaround for this?

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

Yes, you can purchase many items simultaneously, using StartPurchase/PayForPurchase/ConfirmPurchase. The way this works is that when you call StartPurchase, specify all the items you want in the transaction. Since we're talking about virtual currency, in the response one of the options will have the provider name "TitleNNNN" where NNNN is your Title ID, and the currency type will be the VC in question for the items. Then, in the PayForPurchase call, you specify that as the currency and payment provider. You would then finalize the transaction with ConfirmPurchase.

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.