@mpgd/adapter-devvit 0.9.13 → 0.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,10 +35,12 @@ function normalizeDevvitOrder(input, expectedStatus) {
|
|
|
35
35
|
}
|
|
36
36
|
const product = requireRecord(record.products[0], 'Devvit payment product');
|
|
37
37
|
const orderId = requireString(record.id, 'order.id');
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
|
|
38
|
+
// Devvit's payment handler request (`PaymentHandlerRequest` in @devvit/payments
|
|
39
|
+
// 0.14) has no userId: Devvit runs the handler in the purchasing user's request
|
|
40
|
+
// context, which is the authenticated playerId. When an order does carry a
|
|
41
|
+
// userId, it must still match that context.
|
|
42
|
+
if (record.userId !== undefined
|
|
43
|
+
&& requireString(record.userId, 'order.userId') !== playerId) {
|
|
42
44
|
throw new TypeError('Devvit payment order userId must match the authenticated context playerId.');
|
|
43
45
|
}
|
|
44
46
|
const platformSku = requireString(product.sku, 'order.products[0].sku');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpgd/adapter-devvit",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.14",
|
|
4
4
|
"description": "Reddit Devvit Web platform adapter for mpgd games.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@devvit/web": "0.14.1",
|
|
58
58
|
"@mpgd/bridge": "0.10.0",
|
|
59
|
-
"@mpgd/
|
|
60
|
-
"@mpgd/
|
|
59
|
+
"@mpgd/platform": "0.14.0",
|
|
60
|
+
"@mpgd/game-services": "0.17.2"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"ttsc": "0.30.4",
|