question

Kim Strasser avatar image
Kim Strasser asked

How can I get the receipt's orderId in CloudScript?

I use a rule to call my CloudScript function after a player has bought an item. But I don't know how to get the orderId in CloudScript.

CloudScript:

handlers.StoreOrderId = function (args, context)
{
    var psEvent = context.playStreamEvent;

}

How can I get the receipt's orderId in CloudScript?

CloudScript
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

·
Made Wang avatar image
Made Wang answered

If you refer to the case in Getting started with PlayFab, Unity IAP, and Android - PlayFab | Microsoft Docs, the OrderID is stored in ReceiptJson. Referring to player_receipt_validation - PlayFab | Microsoft Docs, you can get the relevant information from ReceiptContent.

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.