Skip to main content

ReceiptProcessingService

Centralize receipt processing within games since this is a constrained resource.

Functions

SetDefaultPurchaseDecision

ReceiptProcessingService:SetDefaultPurchaseDecision(productPurchaseDecisionProductPurchaseDecision) → ()

Sets the default purchase decision in case you want more control

ObserveReceiptProcessedForPlayer

ReceiptProcessingService:ObserveReceiptProcessedForPlayer(playerPlayer) → Observable<ReceiptInfo>

Observes receipt by player

ObserveReceiptProcessedForUserId

ReceiptProcessingService:ObserveReceiptProcessedForUserId(userIdnumber) → Observable<ReceiptInfo>

Observes receipt by userId

RegisterReceiptProcessor

ReceiptProcessingService:RegisterReceiptProcessor(
processor(receiptInfo) → ProductPurchaseDecision | Promise<ProductPurchaseDecision> | nil,
prioritynumber
) → ()

Registers a new receipt processor. This works exactly like a normal receipt processor except it will also take a Promise as a result (of which an error).

Show raw api
{
    "functions": [
        {
            "name": "SetDefaultPurchaseDecision",
            "desc": "Sets the default purchase decision in case you want more control",
            "params": [
                {
                    "name": "productPurchaseDecision",
                    "desc": "",
                    "lua_type": "ProductPurchaseDecision"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 48,
                "path": "src/receiptprocessing/src/Server/ReceiptProcessingService.lua"
            }
        },
        {
            "name": "ObserveReceiptProcessedForPlayer",
            "desc": "Observes receipt by player",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<ReceiptInfo>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 60,
                "path": "src/receiptprocessing/src/Server/ReceiptProcessingService.lua"
            }
        },
        {
            "name": "ObserveReceiptProcessedForUserId",
            "desc": "Observes receipt by userId",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<ReceiptInfo>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 71,
                "path": "src/receiptprocessing/src/Server/ReceiptProcessingService.lua"
            }
        },
        {
            "name": "RegisterReceiptProcessor",
            "desc": "Registers a new receipt processor. This works exactly like a normal receipt processor except it will also\ntake a Promise as a result (of which an error).",
            "params": [
                {
                    "name": "processor",
                    "desc": "",
                    "lua_type": "(receiptInfo) -> ProductPurchaseDecision | Promise<ProductPurchaseDecision> | nil"
                },
                {
                    "name": "priority",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 84,
                "path": "src/receiptprocessing/src/Server/ReceiptProcessingService.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ReceiptProcessingService",
    "desc": "Centralize receipt processing within games since this is a constrained resource.",
    "source": {
        "line": 6,
        "path": "src/receiptprocessing/src/Server/ReceiptProcessingService.lua"
    }
}