question

jnicholls avatar image
jnicholls asked

Execute Cloud code after purchase

Hello

I am wondering if it is possible to have a cloud code function be executed after a bundle purchase has been made.

We do not just wanna be able to call the cloud code from the client since it can cause a security risk.

If it is not possible would there be an alternative solution or could this be implemented into Playfab in the future as an optional parameter when purchasing a bundle.

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

·
Joshua Strunk avatar image
Joshua Strunk answered

You could create a rule to fire off an Action based on a PlayStream event. (under Automation->Rules) You might have to manually put in a built in event as a custom one as it appears not all are in the drop down list.

A list of built in events can be found here.

A quick glance shows several events for purchasing and adding items to inventories.

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.

brendan avatar image brendan commented ·

Correct - trigger the Rule using Event player_inventory_item_added, and have the Condition be ItemId | string | is | {ItemId for your bundle}.

0 Likes 0 ·
jnicholls avatar image jnicholls commented ·

I tried to add the rule but only got

Title is over the limit of 3 for ActionTriggerCount. No more can be created until some are deleted.

I checked the limits for the game and found that we have 0 action triggers being used out of the 3.

Is this because I am using the basic tier of playfab or would that make no difference?

playfab game ID: 1AF7

0 Likes 0 ·
brendan avatar image brendan jnicholls commented ·

There were two scheduled task actions associated with a scheduled task that has since been deleted (and old bug which has since been fixed - you shouldn't be able to get any more in this state). I've removed them from the data tables.

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.