GS2-Money2 Transaction Actions
Specification of verify/consume/acquire transaction actions
Consume Action
Gs2Money2:WithdrawByUserId
Withdraw balance from Wallet by User ID
Withdraws the specified amount of currency from the wallet for the specified user. If paidOnly is false, free currency is consumed first, then paid currency.
Quantity specification supported: YES
Reversible action: YES
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID Specify #{userId} to substitute the currently logged-in user’s ID. | ||
| slot | int | ✓ | 0 ~ 100000000 | Slot Number Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed. | ||
| withdrawCount | int | ✓ | 1 ~ 2147483646 | Quantity of premium currency to be consumed | ||
| paidOnly | bool | false | Whether to target only paid currency | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Money2:WithdrawByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"slot": "[int]Slot Number",
"withdrawCount": "[int]Quantity of premium currency to be consumed",
"paidOnly": "[bool]Whether to target only paid currency",
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Money2:WithdrawByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
slot: "[int]Slot Number"
withdrawCount: "[int]Quantity of premium currency to be consumed"
paidOnly: "[bool]Whether to target only paid currency"
timeOffsetToken: "[string]Time offset token"transaction.service("money2").consume.withdraw_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
slot="[int]Slot Number",
withdrawCount="[int]Quantity of premium currency to be consumed",
paidOnly="[bool]Whether to target only paid currency",
timeOffsetToken="[string]Time offset token",
})Gs2Money2:VerifyReceiptByUserId
Mark a receipt as used by User ID
Verifies a purchase receipt for the specified user and records it as used. An event log is recorded and the verify receipt script configured in the Namespace is executed.
Quantity specification supported: NO
Reversible action: NO
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID Specify #{userId} to substitute the currently logged-in user’s ID. | ||
| contentName | string | ✓ | ~ 128 chars | Store Content Model name | ||
| receipt | Receipt | ✓ | Receipt | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Money2:VerifyReceiptByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"contentName": "[string]Store Content Model name",
"receipt": {
"Store": "[string]Store",
"TransactionID": "[string]Transaction ID",
"Payload": "[string]Payload"
},
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Money2:VerifyReceiptByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
contentName: "[string]Store Content Model name"
receipt:
Store: "[string]Store"
TransactionID: "[string]Transaction ID"
Payload: "[string]Payload"
timeOffsetToken: "[string]Time offset token"transaction.service("money2").consume.verify_receipt_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
contentName="[string]Store Content Model name",
receipt={
store="[string]Store",
transactionID="[string]Transaction ID",
payload="[string]Payload"
},
timeOffsetToken="[string]Time offset token",
})Acquire Action
Gs2Money2:DepositByUserId
Deposit balance to Wallet by User ID
Adds the specified deposit transactions to the wallet for the specified user. An event log is recorded for each deposit transaction.
Quantity specification supported: YES
Reversible action: YES
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID Specify #{userId} to substitute the currently logged-in user’s ID. | ||
| slot | int | ✓ | 0 ~ 100000000 | Slot Number Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed. | ||
| depositTransactions | List<DepositTransaction> | ✓ | 1 ~ 1000 items | List of Deposit transactions | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
{
"action": "Gs2Money2:DepositByUserId",
"request": {
"namespaceName": "[string]Namespace name",
"userId": "[string]User ID",
"slot": "[int]Slot Number",
"depositTransactions": [
{
"price": "[double]Purchase Price",
"currency": "[string]Currency Code",
"count": "[int]Quantity of premium currency",
"depositedAt": "[long]Deposit Date"
}
],
"timeOffsetToken": "[string]Time offset token"
}
}action: Gs2Money2:DepositByUserId
request:
namespaceName: "[string]Namespace name"
userId: "[string]User ID"
slot: "[int]Slot Number"
depositTransactions:
- price: "[double]Purchase Price"
currency: "[string]Currency Code"
count: "[int]Quantity of premium currency"
depositedAt: "[long]Deposit Date"
timeOffsetToken: "[string]Time offset token"transaction.service("money2").acquire.deposit_by_user_id({
namespaceName="[string]Namespace name",
userId="[string]User ID",
slot="[int]Slot Number",
depositTransactions={
{
price="[double]Purchase Price",
currency="[string]Currency Code",
count="[int]Quantity of premium currency",
depositedAt="[long]Deposit Date"
}
},
timeOffsetToken="[string]Time offset token",
})