@devvit/payments 0.12.4-next-2025-11-20-18-26-56-3b48d8657.0 → 0.12.4

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.
@@ -1,4 +1,3 @@
1
- import { OrderResultStatus as OrderResultStatusProto } from '@devvit/protos/types/devvit/ui/effect_types/v1alpha/create_order.js';
2
1
  import type { AsyncError } from '@devvit/public-api/types/hooks.js';
3
2
  export declare enum OrderResultStatus {
4
3
  Cancelled = 0,
@@ -15,8 +14,6 @@ export type OnPurchaseResult = {
15
14
  metadata: OrderMetadata;
16
15
  };
17
16
  export type OnPurchaseResultHandler = (result: OnPurchaseResult) => void | Promise<void>;
18
- /** @internal */
19
- export declare function orderStatusProtoToHook(orderResultStatus: OrderResultStatusProto): OrderResultStatus;
20
17
  export type LoadingAsyncState = {
21
18
  loading: true;
22
19
  error: null;
@@ -1 +1 @@
1
- {"version":3,"file":"hook-types.d.ts","sourceRoot":"","sources":["../../src/hooks/hook-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,sBAAsB,EAAE,MAAM,qEAAqE,CAAC;AAClI,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAEpE,oBAAY,iBAAiB;IAC3B,SAAS,IAAA;IACT,OAAO,IAAA;IACP,KAAK,IAAA;CACN;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAu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SAAS,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAgBzF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF;;;EAGE;AACF,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KAAG,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;CAAE,GAAG,EAAE,CAAC;AAEpE,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,QAAQ,CACvE,CAAC,GAAG,CAAC,iBAAiB,GAAG,eAAe,GAAG,iBAAiB,CAAC,CAC9D,CAAC"}
package/meta.min.json CHANGED
@@ -2799,8 +2799,13 @@
2799
2799
  ],
2800
2800
  "format": "esm"
2801
2801
  },
2802
+ "src/paymentHelpMenuItem.ts": {
2803
+ "bytes": 1446,
2804
+ "imports": [],
2805
+ "format": "esm"
2806
+ },
2802
2807
  "src/plugin.ts": {
2803
- "bytes": 1332,
2808
+ "bytes": 350,
2804
2809
  "imports": [
2805
2810
  {
2806
2811
  "path": "@devvit/protos/payments.js",
@@ -2811,6 +2816,11 @@
2811
2816
  "path": "../public-api/dist/index.js",
2812
2817
  "kind": "import-statement",
2813
2818
  "original": "@devvit/public-api"
2819
+ },
2820
+ {
2821
+ "path": "src/paymentHelpMenuItem.ts",
2822
+ "kind": "import-statement",
2823
+ "original": "./paymentHelpMenuItem.js"
2814
2824
  }
2815
2825
  ],
2816
2826
  "format": "esm"
@@ -2889,7 +2899,7 @@
2889
2899
  "format": "esm"
2890
2900
  },
2891
2901
  "src/paymentHandler.ts": {
2892
- "bytes": 2841,
2902
+ "bytes": 3076,
2893
2903
  "imports": [
2894
2904
  {
2895
2905
  "path": "@devvit/protos/payments.js",
@@ -2966,7 +2976,7 @@
2966
2976
  "imports": [],
2967
2977
  "exports": [],
2968
2978
  "inputs": {},
2969
- "bytes": 1137934
2979
+ "bytes": 1138761
2970
2980
  },
2971
2981
  "dist/payments.min.js": {
2972
2982
  "imports": [
@@ -3556,7 +3566,10 @@
3556
3566
  "bytesInOutput": 1036
3557
3567
  },
3558
3568
  "src/plugin.ts": {
3559
- "bytesInOutput": 678
3569
+ "bytesInOutput": 107
3570
+ },
3571
+ "src/paymentHelpMenuItem.ts": {
3572
+ "bytesInOutput": 605
3560
3573
  },
3561
3574
  "src/hooks/use-orders.ts": {
3562
3575
  "bytesInOutput": 897
@@ -3571,7 +3584,7 @@
3571
3584
  "bytesInOutput": 751
3572
3585
  }
3573
3586
  },
3574
- "bytes": 251287
3587
+ "bytes": 251321
3575
3588
  }
3576
3589
  }
3577
3590
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/payments",
3
- "version": "0.12.4-next-2025-11-20-18-26-56-3b48d8657.0",
3
+ "version": "0.12.4",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,15 +45,15 @@
45
45
  },
46
46
  "types": "./dist/index.d.ts",
47
47
  "dependencies": {
48
- "@devvit/protos": "0.12.4-next-2025-11-20-18-26-56-3b48d8657.0",
49
- "@devvit/public-api": "0.12.4-next-2025-11-20-18-26-56-3b48d8657.0",
50
- "@devvit/server": "0.12.4-next-2025-11-20-18-26-56-3b48d8657.0",
51
- "@devvit/shared-types": "0.12.4-next-2025-11-20-18-26-56-3b48d8657.0"
48
+ "@devvit/protos": "0.12.4",
49
+ "@devvit/public-api": "0.12.4",
50
+ "@devvit/server": "0.12.4",
51
+ "@devvit/shared-types": "0.12.4"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@ampproject/filesize": "4.3.0",
55
- "@devvit/repo-tools": "0.12.4-next-2025-11-20-18-26-56-3b48d8657.0",
56
- "@devvit/tsconfig": "0.12.4-next-2025-11-20-18-26-56-3b48d8657.0",
55
+ "@devvit/repo-tools": "0.12.4",
56
+ "@devvit/tsconfig": "0.12.4",
57
57
  "esbuild": "0.25.9",
58
58
  "eslint": "9.11.1",
59
59
  "typescript": "5.8.3",
@@ -66,5 +66,5 @@
66
66
  }
67
67
  },
68
68
  "source": "./src/index.ts",
69
- "gitHead": "eda4e109681cd752a58198cdf51b34a6c864731c"
69
+ "gitHead": "20be04f7e49b59c13d5c69c67e0bfd22a0be316f"
70
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"paymentHandler.d.ts","sourceRoot":"","sources":["../src/paymentHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,gBAAgB,EAGjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIjE,OAAO,EAAE,KAAK,KAAK,EAAkB,MAAM,wCAAwC,CAAC;AAEpF,MAAM,MAAM,sBAAsB,GAAG,IAAI,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpG,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,CACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,cAAc,GAClB,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC5D,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI,CAGtE;AAED,wBAAgB,kBAAkB,CAAC,kBAAkB,EAAE,cAAc,GAAG,gBAAgB,CAgCvF"}
1
+ {"version":3,"file":"paymentHandler.d.ts","sourceRoot":"","sources":["../src/paymentHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,gBAAgB,EAGjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIjE,OAAO,EAAE,KAAK,KAAK,EAAkB,MAAM,wCAAwC,CAAC;AAEpF,MAAM,MAAM,sBAAsB,GAAG,IAAI,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpG,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,CACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,cAAc,GAClB,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC5D,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE,CAAC;AAKF,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI,CAGtE;AAED,wBAAgB,kBAAkB,CAAC,kBAAkB,EAAE,cAAc,GAAG,gBAAgB,CAgCvF"}
package/paymentHandler.js CHANGED
@@ -4,6 +4,9 @@ import { makeAPIClients } from '@devvit/public-api/apis/makeAPIClients.js';
4
4
  import { getContextFromMetadata } from '@devvit/public-api/devvit/internals/context.js';
5
5
  import { Header } from '@devvit/shared-types/Header.js';
6
6
  import { orderFromProto } from '@devvit/shared-types/payments/Order.js';
7
+ // The typed for this are copied over into `packages/build-pack/src/esbuild/templatizer/blocks.template.tsx`
8
+ // to avoid exposing the unnecessary internal-only function to Webbit users. If you change this here,
9
+ // change it there too.
7
10
  export function addPaymentHandler(paymentHandler) {
8
11
  Devvit.provide(PaymentProcessorDefinition);
9
12
  Object.assign(Devvit.prototype, makeWrappedHandler(paymentHandler));
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=paymentHelpMenuItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentHelpMenuItem.d.ts","sourceRoot":"","sources":["../src/paymentHelpMenuItem.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The types for this are copied over into packages/build-pack/src/esbuild/templatizer/blocks.template.tsx
3
+ * to avoid exposing the unnecessary internal-only object to Webbit users. If you change this here,
4
+ * change it there too.
5
+ * @internal
6
+ */
7
+ export const paymentHelpMenuItem = {
8
+ location: 'post',
9
+ label: 'Get Payments Help',
10
+ postFilter: 'currentApp',
11
+ onPress: async (_, context) => {
12
+ const url = new URL('https://support.reddithelp.com/hc/en-us/requests/new?ticket_form_id=29770197409428&tf_29764567374740=devvit_product_not_working');
13
+ const username = await context.reddit.getCurrentUsername();
14
+ // prefill reddit username
15
+ if (username) {
16
+ url.searchParams.append(`tf_360026362751`, username);
17
+ }
18
+ // prefill the post url
19
+ const postId = context.postId;
20
+ if (postId) {
21
+ //remove the t3_ prefix
22
+ const postWithoutPrefix = postId.replace('t3_', '');
23
+ if (postWithoutPrefix) {
24
+ const postUrl = `https://www.reddit.com/r/${context.subredditName}/comments/${postWithoutPrefix}`;
25
+ url.searchParams.append(`tf_29770117862932`, postUrl);
26
+ }
27
+ }
28
+ // subject with app name and app version
29
+ url.searchParams.append(`tf_subject`, `[${context.appName} v${context.appVersion}] Payments Help`);
30
+ // navigate to the url
31
+ context.ui.navigateTo(url.toString());
32
+ },
33
+ };