@activepieces/piece-stripe 0.6.9 → 0.6.10

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.
Files changed (137) hide show
  1. package/package.json +7 -13
  2. package/src/index.js +26 -127
  3. package/src/index.d.ts +0 -3
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/cancel-subscription.d.ts +0 -5
  7. package/src/lib/actions/cancel-subscription.d.ts.map +0 -1
  8. package/src/lib/actions/cancel-subscription.js +0 -42
  9. package/src/lib/actions/cancel-subscription.js.map +0 -1
  10. package/src/lib/actions/create-customer.d.ts +0 -12
  11. package/src/lib/actions/create-customer.d.ts.map +0 -1
  12. package/src/lib/actions/create-customer.js +0 -91
  13. package/src/lib/actions/create-customer.js.map +0 -1
  14. package/src/lib/actions/create-invoice.d.ts +0 -6
  15. package/src/lib/actions/create-invoice.d.ts.map +0 -1
  16. package/src/lib/actions/create-invoice.js +0 -59
  17. package/src/lib/actions/create-invoice.js.map +0 -1
  18. package/src/lib/actions/create-payment-intent.d.ts +0 -11
  19. package/src/lib/actions/create-payment-intent.d.ts.map +0 -1
  20. package/src/lib/actions/create-payment-intent.js +0 -113
  21. package/src/lib/actions/create-payment-intent.js.map +0 -1
  22. package/src/lib/actions/create-payment-link.d.ts +0 -9
  23. package/src/lib/actions/create-payment-link.d.ts.map +0 -1
  24. package/src/lib/actions/create-payment-link.js +0 -97
  25. package/src/lib/actions/create-payment-link.js.map +0 -1
  26. package/src/lib/actions/create-price.d.ts +0 -8
  27. package/src/lib/actions/create-price.d.ts.map +0 -1
  28. package/src/lib/actions/create-price.js +0 -97
  29. package/src/lib/actions/create-price.js.map +0 -1
  30. package/src/lib/actions/create-product.d.ts +0 -9
  31. package/src/lib/actions/create-product.d.ts.map +0 -1
  32. package/src/lib/actions/create-product.js +0 -89
  33. package/src/lib/actions/create-product.js.map +0 -1
  34. package/src/lib/actions/create-refund.d.ts +0 -7
  35. package/src/lib/actions/create-refund.d.ts.map +0 -1
  36. package/src/lib/actions/create-refund.js +0 -77
  37. package/src/lib/actions/create-refund.js.map +0 -1
  38. package/src/lib/actions/create-subscription.d.ts +0 -10
  39. package/src/lib/actions/create-subscription.d.ts.map +0 -1
  40. package/src/lib/actions/create-subscription.js +0 -110
  41. package/src/lib/actions/create-subscription.js.map +0 -1
  42. package/src/lib/actions/deactivate-payment-link.d.ts +0 -4
  43. package/src/lib/actions/deactivate-payment-link.d.ts.map +0 -1
  44. package/src/lib/actions/deactivate-payment-link.js +0 -31
  45. package/src/lib/actions/deactivate-payment-link.js.map +0 -1
  46. package/src/lib/actions/find-invoice.d.ts +0 -4
  47. package/src/lib/actions/find-invoice.d.ts.map +0 -1
  48. package/src/lib/actions/find-invoice.js +0 -37
  49. package/src/lib/actions/find-invoice.js.map +0 -1
  50. package/src/lib/actions/retrieve-customer.d.ts +0 -4
  51. package/src/lib/actions/retrieve-customer.d.ts.map +0 -1
  52. package/src/lib/actions/retrieve-customer.js +0 -42
  53. package/src/lib/actions/retrieve-customer.js.map +0 -1
  54. package/src/lib/actions/retrieve-invoice.d.ts +0 -4
  55. package/src/lib/actions/retrieve-invoice.d.ts.map +0 -1
  56. package/src/lib/actions/retrieve-invoice.js +0 -37
  57. package/src/lib/actions/retrieve-invoice.js.map +0 -1
  58. package/src/lib/actions/retrieve-payment-intent.d.ts +0 -4
  59. package/src/lib/actions/retrieve-payment-intent.d.ts.map +0 -1
  60. package/src/lib/actions/retrieve-payment-intent.js +0 -37
  61. package/src/lib/actions/retrieve-payment-intent.js.map +0 -1
  62. package/src/lib/actions/retrieve-payout.d.ts +0 -4
  63. package/src/lib/actions/retrieve-payout.d.ts.map +0 -1
  64. package/src/lib/actions/retrieve-payout.js +0 -37
  65. package/src/lib/actions/retrieve-payout.js.map +0 -1
  66. package/src/lib/actions/search-customer.d.ts +0 -4
  67. package/src/lib/actions/search-customer.d.ts.map +0 -1
  68. package/src/lib/actions/search-customer.js +0 -47
  69. package/src/lib/actions/search-customer.js.map +0 -1
  70. package/src/lib/actions/search-subscriptions.d.ts +0 -11
  71. package/src/lib/actions/search-subscriptions.d.ts.map +0 -1
  72. package/src/lib/actions/search-subscriptions.js +0 -199
  73. package/src/lib/actions/search-subscriptions.js.map +0 -1
  74. package/src/lib/actions/update-customer.d.ts +0 -13
  75. package/src/lib/actions/update-customer.d.ts.map +0 -1
  76. package/src/lib/actions/update-customer.js +0 -100
  77. package/src/lib/actions/update-customer.js.map +0 -1
  78. package/src/lib/common/index.d.ts +0 -18
  79. package/src/lib/common/index.d.ts.map +0 -1
  80. package/src/lib/common/index.js +0 -405
  81. package/src/lib/common/index.js.map +0 -1
  82. package/src/lib/common/types.d.ts +0 -59
  83. package/src/lib/common/types.d.ts.map +0 -1
  84. package/src/lib/common/types.js +0 -3
  85. package/src/lib/common/types.js.map +0 -1
  86. package/src/lib/trigger/canceled-subscription.d.ts +0 -11
  87. package/src/lib/trigger/canceled-subscription.d.ts.map +0 -1
  88. package/src/lib/trigger/canceled-subscription.js +0 -116
  89. package/src/lib/trigger/canceled-subscription.js.map +0 -1
  90. package/src/lib/trigger/checkout-session-completed.d.ts +0 -11
  91. package/src/lib/trigger/checkout-session-completed.d.ts.map +0 -1
  92. package/src/lib/trigger/checkout-session-completed.js +0 -94
  93. package/src/lib/trigger/checkout-session-completed.js.map +0 -1
  94. package/src/lib/trigger/invoice-payment-failed.d.ts +0 -11
  95. package/src/lib/trigger/invoice-payment-failed.d.ts.map +0 -1
  96. package/src/lib/trigger/invoice-payment-failed.js +0 -104
  97. package/src/lib/trigger/invoice-payment-failed.js.map +0 -1
  98. package/src/lib/trigger/new-charge.d.ts +0 -3
  99. package/src/lib/trigger/new-charge.d.ts.map +0 -1
  100. package/src/lib/trigger/new-charge.js +0 -99
  101. package/src/lib/trigger/new-charge.js.map +0 -1
  102. package/src/lib/trigger/new-customer.d.ts +0 -3
  103. package/src/lib/trigger/new-customer.d.ts.map +0 -1
  104. package/src/lib/trigger/new-customer.js +0 -94
  105. package/src/lib/trigger/new-customer.js.map +0 -1
  106. package/src/lib/trigger/new-dispute.d.ts +0 -15
  107. package/src/lib/trigger/new-dispute.d.ts.map +0 -1
  108. package/src/lib/trigger/new-dispute.js +0 -102
  109. package/src/lib/trigger/new-dispute.js.map +0 -1
  110. package/src/lib/trigger/new-invoice.d.ts +0 -19
  111. package/src/lib/trigger/new-invoice.d.ts.map +0 -1
  112. package/src/lib/trigger/new-invoice.js +0 -117
  113. package/src/lib/trigger/new-invoice.js.map +0 -1
  114. package/src/lib/trigger/new-payment-link.d.ts +0 -3
  115. package/src/lib/trigger/new-payment-link.d.ts.map +0 -1
  116. package/src/lib/trigger/new-payment-link.js +0 -79
  117. package/src/lib/trigger/new-payment-link.js.map +0 -1
  118. package/src/lib/trigger/new-payment.d.ts +0 -3
  119. package/src/lib/trigger/new-payment.d.ts.map +0 -1
  120. package/src/lib/trigger/new-payment.js +0 -161
  121. package/src/lib/trigger/new-payment.js.map +0 -1
  122. package/src/lib/trigger/new-refund.d.ts +0 -15
  123. package/src/lib/trigger/new-refund.d.ts.map +0 -1
  124. package/src/lib/trigger/new-refund.js +0 -94
  125. package/src/lib/trigger/new-refund.js.map +0 -1
  126. package/src/lib/trigger/new-subscription.d.ts +0 -3
  127. package/src/lib/trigger/new-subscription.d.ts.map +0 -1
  128. package/src/lib/trigger/new-subscription.js +0 -200
  129. package/src/lib/trigger/new-subscription.js.map +0 -1
  130. package/src/lib/trigger/payment-failed.d.ts +0 -3
  131. package/src/lib/trigger/payment-failed.d.ts.map +0 -1
  132. package/src/lib/trigger/payment-failed.js +0 -207
  133. package/src/lib/trigger/payment-failed.js.map +0 -1
  134. package/src/lib/trigger/updated-subscription.d.ts +0 -15
  135. package/src/lib/trigger/updated-subscription.d.ts.map +0 -1
  136. package/src/lib/trigger/updated-subscription.js +0 -130
  137. package/src/lib/trigger/updated-subscription.js.map +0 -1
package/src/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export declare const stripeAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
- export declare const stripe: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAuCA,eAAO,MAAM,UAAU,mEAuBrB,CAAC;AAEH,eAAO,MAAM,MAAM,mHA6DjB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAIqC;AACrC,qEAAwE;AACxE,iDAAqD;AACrD,mEAAqE;AACrE,iEAAmE;AACnE,uEAAyE;AACzE,mEAAqE;AACrE,6DAA+D;AAC/D,2DAA6D;AAC7D,qEAAuE;AACvE,iEAAmE;AACnE,6EAA+E;AAC/E,yDAA2D;AAC3D,2DAA6D;AAC7D,iFAAkF;AAClF,+EAAiF;AACjF,yDAA2D;AAC3D,2DAA6D;AAC7D,qEAAsE;AACtE,6EAA+E;AAC/E,yFAA0F;AAC1F,mEAAqE;AACrE,+EAAgF;AAChF,iEAAmE;AACnE,6DAA+D;AAC/D,2EAA6E;AAC7E,2EAA6E;AAC7E,qEAAuE;AACvE,mEAAqE;AACrE,+DAAiE;AACjE,2EAA4E;AAC5E,mFAAoF;AACpF,mFAAoF;AACpF,6DAA+D;AAElD,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,gDAAgD;IAC7D,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,qCAAqC;gBAC1C,OAA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AiB;QACjB,oCAAmB;QACnB,wCAAqB;QACrB,4BAAe;QACf,8BAAgB;QAChB,mDAA0B;QAC1B,kDAA0B;QAC1B,4BAAe;QACf,8BAAgB;QAChB,uCAAoB;QACpB,gDAAyB;QACzB,2DAA8B;KAC/B;CACF,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const stripeCancelSubscription: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- subscription: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- cancel_at_period_end: import("@activepieces/pieces-framework").CheckboxProperty<false>;
4
- }>;
5
- //# sourceMappingURL=cancel-subscription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-subscription.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-subscription.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB;;;EAmCnC,CAAC"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeCancelSubscription = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const common_1 = require("../common");
8
- exports.stripeCancelSubscription = (0, pieces_framework_1.createAction)({
9
- name: 'cancel_subscription',
10
- auth: __1.stripeAuth,
11
- displayName: 'Cancel Subscription',
12
- description: 'Cancel an existing subscription, either immediately or at the end of the current billing period.',
13
- audience: 'both',
14
- aiMetadata: {
15
- description: 'Cancels an existing Stripe subscription by its ID, in one of two modes: immediately, or scheduled to end at the close of the current billing period. Use to stop recurring billing for a customer. Effectively idempotent: re-running on an already-canceled subscription leaves it canceled.',
16
- idempotent: true,
17
- },
18
- props: {
19
- subscription: common_1.stripeCommon.subscription,
20
- cancel_at_period_end: pieces_framework_1.Property.Checkbox({
21
- displayName: 'Cancel at Period End',
22
- description: 'If true, the subscription remains active until the end of the current billing period. If false, it cancels immediately.',
23
- required: false,
24
- defaultValue: false,
25
- }),
26
- },
27
- run(context) {
28
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
- const { subscription, cancel_at_period_end } = context.propsValue;
30
- const client = (0, common_1.getClient)(context.auth.secret_text);
31
- if (cancel_at_period_end) {
32
- return yield client.subscriptions.update(subscription, {
33
- cancel_at_period_end: true,
34
- });
35
- }
36
- else {
37
- return yield client.subscriptions.cancel(subscription);
38
- }
39
- });
40
- },
41
- });
42
- //# sourceMappingURL=cancel-subscription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-subscription.js","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-subscription.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAmC;AACnC,sCAAoD;AAEvC,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,kGAAkG;IACpG,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,+RAA+R;QACjS,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,YAAY,EAAE,qBAAY,CAAC,YAAY;QACvC,oBAAoB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtC,WAAW,EAAE,sBAAsB;YACnC,WAAW,EACT,yHAAyH;YAC3H,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAElE,MAAM,MAAM,GAAG,IAAA,kBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAEnD,IAAI,oBAAoB,EAAE,CAAC;gBACzB,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,EAAE;oBACrD,oBAAoB,EAAE,IAAI;iBAC3B,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- export declare const stripeCreateCustomer: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- description: import("@activepieces/pieces-framework").LongTextProperty<false>;
5
- phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- line1: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- postal_code: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- city: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- state: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- country: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- }>;
12
- //# sourceMappingURL=create-customer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-customer.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-customer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;;;;;;;;;EAiF/B,CAAC"}
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeCreateCustomer = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- exports.stripeCreateCustomer = (0, pieces_framework_1.createAction)({
9
- name: 'create_customer',
10
- auth: __1.stripeAuth,
11
- displayName: 'Create Customer',
12
- description: 'Create a customer in stripe',
13
- audience: 'both',
14
- aiMetadata: {
15
- description: 'Creates a new customer record in Stripe from an email and name, with optional contact and address fields. Use when onboarding a new payer before charging, invoicing, or subscribing them. Not idempotent: each call creates a distinct customer even with identical input.',
16
- idempotent: false,
17
- },
18
- props: {
19
- email: pieces_framework_1.Property.ShortText({
20
- displayName: 'Email',
21
- description: undefined,
22
- required: true,
23
- }),
24
- name: pieces_framework_1.Property.ShortText({
25
- displayName: 'Name',
26
- required: true,
27
- }),
28
- description: pieces_framework_1.Property.LongText({
29
- displayName: 'Description',
30
- required: false,
31
- }),
32
- phone: pieces_framework_1.Property.ShortText({
33
- displayName: 'Phone',
34
- required: false,
35
- }),
36
- line1: pieces_framework_1.Property.ShortText({
37
- displayName: 'Address Line 1',
38
- required: false,
39
- }),
40
- postal_code: pieces_framework_1.Property.ShortText({
41
- displayName: 'Postal Code',
42
- required: false,
43
- }),
44
- city: pieces_framework_1.Property.ShortText({
45
- displayName: 'City',
46
- required: false,
47
- }),
48
- state: pieces_framework_1.Property.ShortText({
49
- displayName: 'State',
50
- required: false,
51
- }),
52
- country: pieces_framework_1.Property.ShortText({
53
- displayName: 'Country',
54
- required: false,
55
- }),
56
- },
57
- run(context) {
58
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
- const customer = {
60
- email: context.propsValue.email,
61
- name: context.propsValue.name,
62
- description: context.propsValue.description,
63
- phone: context.propsValue.phone,
64
- address: {
65
- line1: context.propsValue.line1,
66
- postal_code: context.propsValue.postal_code,
67
- city: context.propsValue.city,
68
- state: context.propsValue.state,
69
- country: context.propsValue.country,
70
- },
71
- };
72
- const response = yield pieces_common_1.httpClient.sendRequest({
73
- method: pieces_common_1.HttpMethod.POST,
74
- url: 'https://api.stripe.com/v1/customers',
75
- headers: {
76
- Authorization: 'Bearer ' + context.auth.secret_text,
77
- 'Content-Type': 'application/x-www-form-urlencoded',
78
- },
79
- body: {
80
- email: customer.email,
81
- name: customer.name,
82
- description: customer.description,
83
- phone: customer.phone,
84
- address: customer.address,
85
- },
86
- });
87
- return response.body;
88
- });
89
- },
90
- });
91
- //# sourceMappingURL=create-customer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-customer.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-customer.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,6BAAmC;AAEtB,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,6BAA6B;IAC1C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,6QAA6Q;QAC/Q,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,gBAAgB;YAC7B,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC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KAAA;CACF,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const stripeCreateInvoice: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- customer_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- currency: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- description: import("@activepieces/pieces-framework").LongTextProperty<false>;
5
- }>;
6
- //# sourceMappingURL=create-invoice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-invoice.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-invoice.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;;EAkD9B,CAAC"}
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeCreateInvoice = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- exports.stripeCreateInvoice = (0, pieces_framework_1.createAction)({
9
- name: 'create_invoice',
10
- auth: __1.stripeAuth,
11
- displayName: 'Create Invoice',
12
- description: 'Create an Invoice in stripe',
13
- audience: 'both',
14
- aiMetadata: {
15
- description: 'Creates a draft invoice in Stripe for an existing customer in the given currency. Use to bill a customer for pending invoice items. Requires a valid Stripe customer ID; not idempotent, as each call creates a separate invoice.',
16
- idempotent: false,
17
- },
18
- props: {
19
- customer_id: pieces_framework_1.Property.ShortText({
20
- displayName: 'Customer ID',
21
- description: 'Stripe Customer ID',
22
- required: true,
23
- }),
24
- currency: pieces_framework_1.Property.ShortText({
25
- displayName: 'Currency',
26
- description: 'Currency for the invoice (e.g., USD)',
27
- required: true,
28
- }),
29
- description: pieces_framework_1.Property.LongText({
30
- displayName: 'Description',
31
- description: 'Description for the invoice',
32
- required: false,
33
- }),
34
- },
35
- run(context) {
36
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
37
- const invoice = {
38
- customer: context.propsValue.customer_id,
39
- currency: context.propsValue.currency,
40
- description: context.propsValue.description,
41
- };
42
- const response = yield pieces_common_1.httpClient.sendRequest({
43
- method: pieces_common_1.HttpMethod.POST,
44
- url: 'https://api.stripe.com/v1/invoices',
45
- headers: {
46
- Authorization: 'Bearer ' + context.auth.secret_text,
47
- 'Content-Type': 'application/x-www-form-urlencoded',
48
- },
49
- body: {
50
- customer: invoice.customer,
51
- currency: invoice.currency,
52
- description: invoice.description,
53
- },
54
- });
55
- return response.body;
56
- });
57
- },
58
- });
59
- //# sourceMappingURL=create-invoice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-invoice.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-invoice.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,6BAAmC;AAEtB,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,6BAA6B;IAC1C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,mOAAmO;QACrO,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,OAAO,GAAG;gBACd,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW;gBACxC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;gBACrC,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW;aAC5C,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,oCAAoC;gBACzC,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW;oBACnD,cAAc,EAAE,mCAAmC;iBACpD;gBACD,IAAI,EAAE;oBACJ,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;iBACjC;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- export declare const stripeCreatePaymentIntent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- amount: import("@activepieces/pieces-framework").NumberProperty<true>;
3
- currency: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
4
- customer: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
5
- payment_method: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- confirm: import("@activepieces/pieces-framework").CheckboxProperty<false>;
7
- return_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- description: import("@activepieces/pieces-framework").LongTextProperty<false>;
9
- receipt_email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- }>;
11
- //# sourceMappingURL=create-payment-intent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-payment-intent.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-payment-intent.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,yBAAyB;;;;;;;;;EAwHpC,CAAC"}
@@ -1,113 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeCreatePaymentIntent = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.stripeCreatePaymentIntent = (0, pieces_framework_1.createAction)({
10
- name: 'create_payment_intent',
11
- auth: __1.stripeAuth,
12
- displayName: 'Create Payment (Payment Intent)',
13
- description: 'Creates a new payment intent to start a payment flow.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Creates a Stripe PaymentIntent for a given amount and currency to begin collecting a payment, optionally tied to a customer. Can run in two modes: leave it unconfirmed to obtain a client secret for client-side completion, or set confirm to immediately charge a supplied payment method (which then also requires a return URL). Not idempotent: each call starts a separate payment.',
17
- idempotent: false,
18
- },
19
- props: {
20
- amount: pieces_framework_1.Property.Number({
21
- displayName: 'Amount',
22
- description: 'The amount to charge, in a decimal format (e.g., 10.50 for $10.50).',
23
- required: true,
24
- }),
25
- currency: pieces_framework_1.Property.StaticDropdown({
26
- displayName: 'Currency',
27
- description: 'The three-letter ISO code for the currency.',
28
- required: true,
29
- options: {
30
- options: [
31
- { label: 'US Dollar', value: 'usd' },
32
- { label: 'Euro', value: 'eur' },
33
- { label: 'Pound Sterling', value: 'gbp' },
34
- { label: 'Australian Dollar', value: 'aud' },
35
- { label: 'Canadian Dollar', value: 'cad' },
36
- { label: 'Swiss Franc', value: 'chf' },
37
- { label: 'Chinese Yuan', value: 'cny' },
38
- { label: 'Japanese Yen', value: 'jpy' },
39
- { label: 'Indian Rupee', value: 'inr' },
40
- { label: 'Singapore Dollar', value: 'sgd' },
41
- ],
42
- },
43
- }),
44
- customer: common_1.stripeCommon.customer,
45
- payment_method: pieces_framework_1.Property.ShortText({
46
- displayName: 'Payment Method ID',
47
- description: 'The ID of the Payment Method to attach (e.g., `pm_...`). Required if you want to confirm the payment immediately.',
48
- required: false,
49
- }),
50
- confirm: pieces_framework_1.Property.Checkbox({
51
- displayName: 'Confirm Payment Immediately',
52
- description: 'If true, Stripe will attempt to charge the provided payment method. A `Payment Method ID` is required.',
53
- required: false,
54
- defaultValue: false,
55
- }),
56
- return_url: pieces_framework_1.Property.ShortText({
57
- displayName: 'Return URL',
58
- description: 'The URL to redirect your customer back to after they authenticate their payment. Required when confirming the payment.',
59
- required: false,
60
- }),
61
- description: pieces_framework_1.Property.LongText({
62
- displayName: 'Description',
63
- required: false,
64
- }),
65
- receipt_email: pieces_framework_1.Property.ShortText({
66
- displayName: 'Receipt Email',
67
- description: "The email address to send a receipt to. This will override the customer's email address.",
68
- required: false,
69
- }),
70
- },
71
- run(context) {
72
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
73
- const { amount, currency, customer, payment_method, confirm, return_url, description, receipt_email, } = context.propsValue;
74
- if (confirm && !payment_method) {
75
- throw new Error("A Payment Method ID is required when 'Confirm Payment' is set to true.");
76
- }
77
- if (confirm && !return_url) {
78
- throw new Error("A Return URL is required when 'Confirm Payment' is set to true.");
79
- }
80
- const amountInCents = Math.round(amount * 100);
81
- const body = {
82
- amount: amountInCents,
83
- currency: currency,
84
- };
85
- if (customer)
86
- body.customer = customer;
87
- if (payment_method)
88
- body.payment_method = payment_method;
89
- if (confirm)
90
- body.confirm = confirm;
91
- if (return_url)
92
- body.return_url = return_url;
93
- if (description)
94
- body.description = description;
95
- if (receipt_email)
96
- body.receipt_email = receipt_email;
97
- const response = yield pieces_common_1.httpClient.sendRequest({
98
- method: pieces_common_1.HttpMethod.POST,
99
- url: `${common_1.stripeCommon.baseUrl}/payment_intents`,
100
- authentication: {
101
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
102
- token: context.auth.secret_text,
103
- },
104
- headers: {
105
- 'Content-Type': 'application/x-www-form-urlencoded',
106
- },
107
- body: body,
108
- });
109
- return response.body;
110
- });
111
- },
112
- });
113
- //# sourceMappingURL=create-payment-intent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-payment-intent.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-payment-intent.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,6BAAmC;AACnC,sCAAyC;AAE5B,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE,uDAAuD;IACpE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,4XAA4X;QAC9X,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,qEAAqE;YACvE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAChC,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE;oBACpC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC/B,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE;oBACzC,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC5C,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC1C,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE;oBACtC,EAAE,KAAK,EAAE,cAAc,EAAE,KAA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AAI,CAAC,UAAU,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;YACJ,CAAC;YAED,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;YAE/C,MAAM,IAAI,GAA+B;gBACvC,MAAM,EAAE,aAAa;gBACrB,QAAQ,EAAE,QAAQ;aACnB,CAAC;YAEF,IAAI,QAAQ;gBAAE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACvC,IAAI,cAAc;gBAAE,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;YACzD,IAAI,OAAO;gBAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACpC,IAAI,UAAU;gBAAE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC7C,IAAI,WAAW;gBAAE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;YAChD,IAAI,aAAa;gBAAE,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;YAEtD,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,qBAAY,CAAC,OAAO,kBAAkB;gBAC9C,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;iBAChC;gBACD,OAAO,EAAE;oBACP,cAAc,EAAE,mCAAmC;iBACpD;gBACD,IAAI,EAAE,IAAI;aACX,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare const stripeCreatePaymentLink: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- line_items: import("@activepieces/pieces-framework").ArrayProperty<true>;
3
- after_completion_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
4
- after_completion_redirect_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
- allow_promotion_codes: import("@activepieces/pieces-framework").CheckboxProperty<false>;
6
- billing_address_collection: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
7
- metadata: import("@activepieces/pieces-framework").JsonProperty<false>;
8
- }>;
9
- //# sourceMappingURL=create-payment-link.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-payment-link.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-payment-link.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,uBAAuB;;;;;;;EAsGlC,CAAC"}
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeCreatePaymentLink = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const common_1 = require("../common");
8
- exports.stripeCreatePaymentLink = (0, pieces_framework_1.createAction)({
9
- name: 'create_payment_link',
10
- auth: __1.stripeAuth,
11
- displayName: 'Create Payment Link',
12
- description: 'Creates a shareable, Stripe-hosted payment link for one-time purchases or subscriptions.',
13
- audience: 'both',
14
- aiMetadata: {
15
- description: 'Creates a reusable, Stripe-hosted payment link for the given line items (price IDs and quantities), with optional after-completion redirect, promotion codes, and billing-address collection. Use to generate a shareable checkout URL without building a custom flow. Not idempotent: each call creates a new payment link.',
16
- idempotent: false,
17
- },
18
- props: {
19
- line_items: pieces_framework_1.Property.Array({
20
- displayName: 'Line Items',
21
- description: 'The products and quantities to include in the payment link.',
22
- required: true,
23
- properties: {
24
- price: pieces_framework_1.Property.ShortText({
25
- displayName: 'Price ID',
26
- description: 'The ID of the price object (e.g., price_1J2X3Y4Z...). Find this in your Stripe Dashboard under Products.',
27
- required: true,
28
- }),
29
- quantity: pieces_framework_1.Property.Number({
30
- displayName: 'Quantity',
31
- required: true,
32
- }),
33
- },
34
- }),
35
- after_completion_type: pieces_framework_1.Property.StaticDropdown({
36
- displayName: 'After Completion Behavior',
37
- description: "Controls the behavior after the purchase is complete. Defaults to showing Stripe's hosted confirmation page.",
38
- required: false,
39
- options: {
40
- options: [
41
- { label: 'Show Confirmation Page', value: 'hosted_confirmation' },
42
- { label: 'Redirect to URL', value: 'redirect' },
43
- ],
44
- },
45
- }),
46
- after_completion_redirect_url: pieces_framework_1.Property.ShortText({
47
- displayName: 'Redirect URL',
48
- description: 'The URL to redirect the customer to after a successful purchase. Only used if the behavior is set to "Redirect to URL".',
49
- required: false,
50
- }),
51
- allow_promotion_codes: pieces_framework_1.Property.Checkbox({
52
- displayName: 'Allow Promotion Codes',
53
- description: 'Enables the user to enter a promotion code on the Payment Link page.',
54
- required: false,
55
- }),
56
- billing_address_collection: pieces_framework_1.Property.StaticDropdown({
57
- displayName: 'Billing Address Collection',
58
- description: 'Describes whether Checkout should collect the customer’s billing address.',
59
- required: false,
60
- options: {
61
- options: [
62
- { label: 'Auto', value: 'auto' },
63
- { label: 'Required', value: 'required' },
64
- ],
65
- },
66
- }),
67
- metadata: pieces_framework_1.Property.Json({
68
- displayName: 'Metadata',
69
- required: false,
70
- }),
71
- },
72
- run(context) {
73
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
74
- const client = (0, common_1.getClient)(context.auth.secret_text);
75
- const props = context.propsValue;
76
- const params = {
77
- line_items: props.line_items,
78
- allow_promotion_codes: props.allow_promotion_codes,
79
- billing_address_collection: props.billing_address_collection,
80
- metadata: props.metadata,
81
- };
82
- if (props.after_completion_type) {
83
- params.after_completion = {
84
- type: props.after_completion_type,
85
- };
86
- if (props.after_completion_type === 'redirect' &&
87
- props.after_completion_redirect_url) {
88
- params.after_completion.redirect = {
89
- url: props.after_completion_redirect_url,
90
- };
91
- }
92
- }
93
- return yield client.paymentLinks.create(params);
94
- });
95
- },
96
- });
97
- //# sourceMappingURL=create-payment-link.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-payment-link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ED,OAAO,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- export declare const stripeCreatePrice: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- product: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- unit_amount: import("@activepieces/pieces-framework").NumberProperty<true>;
4
- currency: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
- recurring_interval: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
6
- recurring_interval_count: import("@activepieces/pieces-framework").NumberProperty<false>;
7
- }>;
8
- //# sourceMappingURL=create-price.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-price.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-price.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB;;;;;;EAqG5B,CAAC"}
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeCreatePrice = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.stripeCreatePrice = (0, pieces_framework_1.createAction)({
10
- name: 'create_price',
11
- auth: __1.stripeAuth,
12
- displayName: 'Create Price',
13
- description: 'Create a price (one-time or recurring), associated with a product.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Creates a price for an existing Stripe product, in either one-time or recurring mode depending on the selected billing interval. Use after creating a product to define what to charge before building a subscription or payment link. Requires the product ID; not idempotent, as each call creates a new price.',
17
- idempotent: false,
18
- },
19
- props: {
20
- product: common_1.stripeCommon.product,
21
- unit_amount: pieces_framework_1.Property.Number({
22
- displayName: 'Unit Amount',
23
- description: 'The price amount as a decimal, for example, 25.50 for $25.50.',
24
- required: true,
25
- }),
26
- currency: pieces_framework_1.Property.StaticDropdown({
27
- displayName: 'Currency',
28
- description: 'The three-letter ISO code for the currency.',
29
- required: true,
30
- options: {
31
- options: [
32
- { label: 'US Dollar', value: 'usd' },
33
- { label: 'Euro', value: 'eur' },
34
- { label: 'Pound Sterling', value: 'gbp' },
35
- { label: 'Indian Rupee', value: 'inr' },
36
- { label: 'Australian Dollar', value: 'aud' },
37
- { label: 'Canadian Dollar', value: 'cad' },
38
- { label: 'Swiss Franc', value: 'chf' },
39
- { label: 'Chinese Yuan', value: 'cny' },
40
- { label: 'Japanese Yen', value: 'jpy' },
41
- { label: 'Singapore Dollar', value: 'sgd' },
42
- ],
43
- },
44
- }),
45
- recurring_interval: pieces_framework_1.Property.StaticDropdown({
46
- displayName: 'Billing Interval',
47
- description: "Specify the billing frequency. Select 'One-Time' for a single, non-recurring payment.",
48
- required: true,
49
- defaultValue: 'one_time',
50
- options: {
51
- options: [
52
- { label: 'One-Time', value: 'one_time' },
53
- { label: 'Daily', value: 'day' },
54
- { label: 'Weekly', value: 'week' },
55
- { label: 'Monthly', value: 'month' },
56
- { label: 'Yearly', value: 'year' },
57
- ],
58
- },
59
- }),
60
- recurring_interval_count: pieces_framework_1.Property.Number({
61
- displayName: 'Interval Count',
62
- description: 'The number of intervals between subscription billings (e.g., for billing every 3 months, set Interval to Monthly and Interval Count to 3). Only used for recurring prices.',
63
- required: false,
64
- }),
65
- },
66
- run(context) {
67
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
68
- const { product, unit_amount, currency, recurring_interval, recurring_interval_count, } = context.propsValue;
69
- const unitAmountInCents = Math.round(unit_amount * 100);
70
- const body = {
71
- product: product,
72
- unit_amount: unitAmountInCents,
73
- currency: currency,
74
- };
75
- if (recurring_interval !== 'one_time') {
76
- body['recurring[interval]'] = recurring_interval;
77
- if (recurring_interval_count) {
78
- body['recurring[interval_count]'] = recurring_interval_count;
79
- }
80
- }
81
- const response = yield pieces_common_1.httpClient.sendRequest({
82
- method: pieces_common_1.HttpMethod.POST,
83
- url: `${common_1.stripeCommon.baseUrl}/prices`,
84
- authentication: {
85
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
86
- token: context.auth.secret_text,
87
- },
88
- headers: {
89
- 'Content-Type': 'application/x-www-form-urlencoded',
90
- },
91
- body: body,
92
- });
93
- return response.body;
94
- });
95
- },
96
- });
97
- //# sourceMappingURL=create-price.js.map