Persist the actual grant in the purchase log and open one native receipt per unread entry. Keep pending receipts during log trimming and resume them when the price table becomes available. Verified TypeScript types, GUI patch application, and Quirrel syntax.
32 lines
2.0 KiB
JSON
32 lines
2.0 KiB
JSON
{
|
|
"id": "online-shop/use-entitlement-receipt-for-native-payment",
|
|
"title": "Use the entitlement receipt as the native payment confirmation",
|
|
"file": "scripts/onlineshop/onlinepurchase.nut",
|
|
"program_behaviour": {
|
|
"stock": "A successful native payment requests a profile update and immediately shows a text-only confirmation.",
|
|
"patched": "Track the profile task through its native error handler. The saved purchase log provides the success receipt."
|
|
},
|
|
"derivation": {
|
|
"requirement": "Present a single success dialog for a successful native payment.",
|
|
"cause": "The immediate confirmation and the reward from the persisted purchase log would both report the same grant.",
|
|
"lighter_options_ruled_out": [
|
|
"Keep an immediate native success box alongside the receipt. The confirmed grant would be presented again when its log arrives.",
|
|
"Show a separate success box on a refresh error. The purchase still has a pending log and would be presented a second time on the next successful refresh."
|
|
],
|
|
"if_not_applied": "A successful native purchase can display an immediate confirmation followed by a second one from the purchase log."
|
|
},
|
|
"features": [
|
|
"G-Store",
|
|
"G-Premium Account"
|
|
],
|
|
"evidence": [
|
|
"2.61.0.37 scripts/onlineshop/onlinepurchase.nut: doYuplayPurchase displays a confirmation after update_entitlements.",
|
|
"2.61.0.37 scripts/clientstate/localprofile.nut and scripts/userlog/userlogdata.nut: the profile update triggers a gamercard update and unread reward processing.",
|
|
"2.61.0.37 scripts/tasker.nut: showErrorMessageBox displays the existing task error on a failed refresh."
|
|
],
|
|
"edit": {
|
|
"find": " update_entitlements()\r\n\r\n scene_msg_box(\"purchase_done\", get_cur_gui_scene(),\r\n format(loc(\"userlog/buy_entitlement\"), getEntitlementName(product)),\r\n [[\"ok\", @() null]], \"ok\", { cancel_fn = @() null })",
|
|
"replace": " let { addTask } = require(\"%scripts/tasker.nut\")\r\n addTask(update_entitlements(), { showErrorMessageBox = true })"
|
|
}
|
|
}
|