@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.
package/plugin.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- import { type PaymentsService } from '@devvit/protos/payments.js';
2
- /** @internal */
3
- export declare const paymentsPlugin: PaymentsService;
1
+ export {};
4
2
  //# sourceMappingURL=plugin.d.ts.map
package/plugin.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAA6B,MAAM,4BAA4B,CAAC;AAG7F,gBAAgB;AAChB,eAAO,MAAM,cAAc,EAAE,eAAuD,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":""}
package/plugin.js CHANGED
@@ -1,30 +1,6 @@
1
1
  import { PaymentsServiceDefinition } from '@devvit/protos/payments.js';
2
2
  import { Devvit } from '@devvit/public-api';
3
+ import { paymentHelpMenuItem } from './paymentHelpMenuItem.js';
3
4
  /** @internal */
4
5
  export const paymentsPlugin = Devvit.use(PaymentsServiceDefinition);
5
- Devvit.addMenuItem({
6
- location: 'post',
7
- label: 'Get Payments Help',
8
- onPress: async (_, context) => {
9
- const url = new URL('https://support.reddithelp.com/hc/en-us/requests/new?ticket_form_id=29770197409428&tf_29764567374740=devvit_product_not_working');
10
- const username = await context.reddit.getCurrentUsername();
11
- // prefill reddit username
12
- if (username) {
13
- url.searchParams.append(`tf_360026362751`, username);
14
- }
15
- // prefill the post url
16
- const postId = context.postId;
17
- if (postId) {
18
- //remove the t3_ prefix
19
- const postWithoutPrefix = postId.replace('t3_', '');
20
- if (postWithoutPrefix) {
21
- const postUrl = `https://www.reddit.com/r/${context.subredditName}/comments/${postWithoutPrefix}`;
22
- url.searchParams.append(`tf_29770117862932`, postUrl);
23
- }
24
- }
25
- // subject with app name and app version
26
- url.searchParams.append(`tf_subject`, `[${context.appName} v${context.appVersion}] Payments Help`);
27
- // navigate to the url
28
- context.ui.navigateTo(url.toString());
29
- },
30
- });
6
+ Devvit.addMenuItem(paymentHelpMenuItem);
package/shared/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from '../paymentHelpMenuItem.js';
1
2
  export type { Order } from '@devvit/protos/json/devvit/payments/v1alpha/order.js';
2
3
  export type { Product } from '@devvit/protos/json/devvit/payments/v1alpha/product.js';
3
4
  export type { PageInfo } from '@devvit/protos/json/devvit/plugin/payments/v1alpha/payments.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAClF,YAAY,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AACtF,YAAY,EAAE,QAAQ,EAAE,MAAM,gEAAgE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAEA,cAAc,2BAA2B,CAAC;AAC1C,YAAY,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAClF,YAAY,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AACtF,YAAY,EAAE,QAAQ,EAAE,MAAM,gEAAgE,CAAC"}
package/shared/index.js CHANGED
@@ -1 +1,4 @@
1
- export {};
1
+ import { addPaymentHandler as _addPaymentHandler } from '../paymentHandler.js';
2
+ export * from '../paymentHelpMenuItem.js';
3
+ /** @internal For `blocks.template.tsx`. */
4
+ export const addPaymentHandler = _addPaymentHandler;