@activepieces/piece-stripe 0.5.13 → 0.5.15
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/package.json +3 -4
- package/src/i18n/translation.json +0 -1
- package/src/index.js +55 -1
- package/src/index.js.map +1 -1
- package/src/lib/actions/cancel-subscription.d.ts +4 -0
- package/src/lib/actions/cancel-subscription.js +37 -0
- package/src/lib/actions/cancel-subscription.js.map +1 -0
- package/src/lib/actions/create-payment-intent.d.ts +10 -0
- package/src/lib/actions/create-payment-intent.js +108 -0
- package/src/lib/actions/create-payment-intent.js.map +1 -0
- package/src/lib/actions/create-payment-link.d.ts +8 -0
- package/src/lib/actions/create-payment-link.js +92 -0
- package/src/lib/actions/create-payment-link.js.map +1 -0
- package/src/lib/actions/create-price.d.ts +7 -0
- package/src/lib/actions/create-price.js +92 -0
- package/src/lib/actions/create-price.js.map +1 -0
- package/src/lib/actions/create-product.d.ts +8 -0
- package/src/lib/actions/create-product.js +84 -0
- package/src/lib/actions/create-product.js.map +1 -0
- package/src/lib/actions/create-refund.d.ts +6 -0
- package/src/lib/actions/create-refund.js +72 -0
- package/src/lib/actions/create-refund.js.map +1 -0
- package/src/lib/actions/create-subscription.d.ts +9 -0
- package/src/lib/actions/create-subscription.js +105 -0
- package/src/lib/actions/create-subscription.js.map +1 -0
- package/src/lib/actions/deactivate-payment-link.d.ts +3 -0
- package/src/lib/actions/deactivate-payment-link.js +26 -0
- package/src/lib/actions/deactivate-payment-link.js.map +1 -0
- package/src/lib/actions/find-invoice.d.ts +3 -0
- package/src/lib/actions/find-invoice.js +32 -0
- package/src/lib/actions/find-invoice.js.map +1 -0
- package/src/lib/actions/retrieve-invoice.d.ts +3 -0
- package/src/lib/actions/retrieve-invoice.js +32 -0
- package/src/lib/actions/retrieve-invoice.js.map +1 -0
- package/src/lib/actions/retrieve-payment-intent.d.ts +3 -0
- package/src/lib/actions/retrieve-payment-intent.js +32 -0
- package/src/lib/actions/retrieve-payment-intent.js.map +1 -0
- package/src/lib/actions/retrieve-payout.d.ts +3 -0
- package/src/lib/actions/retrieve-payout.js +32 -0
- package/src/lib/actions/retrieve-payout.js.map +1 -0
- package/src/lib/actions/update-customer.d.ts +12 -0
- package/src/lib/actions/update-customer.js +95 -0
- package/src/lib/actions/update-customer.js.map +1 -0
- package/src/lib/common/index.d.ts +10 -0
- package/src/lib/common/index.js +360 -7
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/common/types.d.ts +58 -0
- package/src/lib/common/types.js +3 -0
- package/src/lib/common/types.js.map +1 -0
- package/src/lib/trigger/canceled-subscription.d.ts +8 -0
- package/src/lib/trigger/canceled-subscription.js +113 -0
- package/src/lib/trigger/canceled-subscription.js.map +1 -0
- package/src/lib/trigger/checkout-session-completed.d.ts +8 -0
- package/src/lib/trigger/checkout-session-completed.js +91 -0
- package/src/lib/trigger/checkout-session-completed.js.map +1 -0
- package/src/lib/trigger/invoice-payment-failed.d.ts +8 -0
- package/src/lib/trigger/invoice-payment-failed.js +101 -0
- package/src/lib/trigger/invoice-payment-failed.js.map +1 -0
- package/src/lib/trigger/new-charge.d.ts +2 -0
- package/src/lib/trigger/new-charge.js +94 -0
- package/src/lib/trigger/new-charge.js.map +1 -0
- package/src/lib/trigger/new-customer.js +20 -0
- package/src/lib/trigger/new-customer.js.map +1 -1
- package/src/lib/trigger/new-dispute.d.ts +11 -0
- package/src/lib/trigger/new-dispute.js +98 -0
- package/src/lib/trigger/new-dispute.js.map +1 -0
- package/src/lib/trigger/new-invoice.d.ts +14 -0
- package/src/lib/trigger/new-invoice.js +114 -0
- package/src/lib/trigger/new-invoice.js.map +1 -0
- package/src/lib/trigger/new-payment-link.d.ts +2 -0
- package/src/lib/trigger/new-payment-link.js +76 -0
- package/src/lib/trigger/new-payment-link.js.map +1 -0
- package/src/lib/trigger/new-payment.js +21 -0
- package/src/lib/trigger/new-payment.js.map +1 -1
- package/src/lib/trigger/new-refund.d.ts +11 -0
- package/src/lib/trigger/new-refund.js +91 -0
- package/src/lib/trigger/new-refund.js.map +1 -0
- package/src/lib/trigger/new-subscription.js +20 -0
- package/src/lib/trigger/new-subscription.js.map +1 -1
- package/src/lib/trigger/payment-failed.js +21 -0
- package/src/lib/trigger/payment-failed.js.map +1 -1
- package/src/lib/trigger/updated-subscription.d.ts +11 -0
- package/src/lib/trigger/updated-subscription.js +127 -0
- package/src/lib/trigger/updated-subscription.js.map +1 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripeCreateRefund = 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.stripeCreateRefund = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'create_refund',
|
|
11
|
+
auth: __1.stripeAuth,
|
|
12
|
+
displayName: 'Create a Refund',
|
|
13
|
+
description: 'Create a full or partial refund for a payment.',
|
|
14
|
+
props: {
|
|
15
|
+
payment_intent: common_1.stripeCommon.paymentIntent,
|
|
16
|
+
amount: pieces_framework_1.Property.Number({
|
|
17
|
+
displayName: 'Amount',
|
|
18
|
+
description: 'The amount to refund (e.g., 12.99). If left blank, a full refund will be issued.',
|
|
19
|
+
required: false,
|
|
20
|
+
}),
|
|
21
|
+
reason: pieces_framework_1.Property.StaticDropdown({
|
|
22
|
+
displayName: 'Reason',
|
|
23
|
+
description: 'An optional reason for the refund.',
|
|
24
|
+
required: false,
|
|
25
|
+
options: {
|
|
26
|
+
options: [
|
|
27
|
+
{ label: 'Duplicate', value: 'duplicate' },
|
|
28
|
+
{ label: 'Fraudulent', value: 'fraudulent' },
|
|
29
|
+
{ label: 'Requested by Customer', value: 'requested_by_customer' },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
metadata: pieces_framework_1.Property.Json({
|
|
34
|
+
displayName: 'Metadata',
|
|
35
|
+
description: 'A set of key-value pairs to store additional information about the refund.',
|
|
36
|
+
required: false,
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
run(context) {
|
|
40
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const { payment_intent, amount, reason, metadata } = context.propsValue;
|
|
42
|
+
const body = {
|
|
43
|
+
payment_intent: payment_intent,
|
|
44
|
+
};
|
|
45
|
+
if (amount !== undefined && amount !== null) {
|
|
46
|
+
body.amount = Math.round(amount * 100);
|
|
47
|
+
}
|
|
48
|
+
if (reason) {
|
|
49
|
+
body.reason = reason;
|
|
50
|
+
}
|
|
51
|
+
if (metadata && typeof metadata === 'object') {
|
|
52
|
+
Object.keys(metadata).forEach((key) => {
|
|
53
|
+
body[`metadata[${key}]`] = metadata[key];
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
57
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
58
|
+
url: `${common_1.stripeCommon.baseUrl}/refunds`,
|
|
59
|
+
authentication: {
|
|
60
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
61
|
+
token: context.auth,
|
|
62
|
+
},
|
|
63
|
+
headers: {
|
|
64
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
65
|
+
},
|
|
66
|
+
body: body,
|
|
67
|
+
});
|
|
68
|
+
return response.body;
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=create-refund.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-refund.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/stripe/src/lib/actions/create-refund.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,6BAAmC;AACn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C;gBACX,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YACvB,CAAC;YACD,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;gBAC7C,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;oBACpC,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,GAAI,QAAmC,CAAC,GAAG,CAAC,CAAC;gBACvE,CAAC,CAAC,CAAC;YACL,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,qBAAY,CAAC,OAAO,UAAU;gBACtC,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI;iBACpB;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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const stripeCreateSubscription: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
customer: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
items: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
4
|
+
collection_method: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
5
|
+
days_until_due: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
6
|
+
trial_period_days: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
7
|
+
default_payment_method: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
metadata: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripeCreateSubscription = 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.stripeCreateSubscription = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'create_subscription',
|
|
11
|
+
auth: __1.stripeAuth,
|
|
12
|
+
displayName: 'Create Subscription',
|
|
13
|
+
description: 'Start a subscription for a customer with specified items/prices.',
|
|
14
|
+
props: {
|
|
15
|
+
customer: common_1.stripeCommon.customer,
|
|
16
|
+
items: pieces_framework_1.Property.Array({
|
|
17
|
+
displayName: 'Subscription Items',
|
|
18
|
+
description: 'A list of prices to subscribe the customer to.',
|
|
19
|
+
required: true,
|
|
20
|
+
properties: {
|
|
21
|
+
price: pieces_framework_1.Property.ShortText({
|
|
22
|
+
displayName: 'Price ID',
|
|
23
|
+
description: 'The ID of the price object (e.g., price_...). You can find this in your Stripe Dashboard under Products.',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
quantity: pieces_framework_1.Property.Number({
|
|
27
|
+
displayName: 'Quantity',
|
|
28
|
+
description: 'The number of units of this price to subscribe to. Defaults to 1.',
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
collection_method: pieces_framework_1.Property.StaticDropdown({
|
|
34
|
+
displayName: 'Collection Method',
|
|
35
|
+
description: "How to collect payment. 'charge_automatically' will try to bill the default payment method. 'send_invoice' will email an invoice.",
|
|
36
|
+
required: false,
|
|
37
|
+
options: {
|
|
38
|
+
options: [
|
|
39
|
+
{ label: 'Charge Automatically', value: 'charge_automatically' },
|
|
40
|
+
{ label: 'Send Invoice', value: 'send_invoice' },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
days_until_due: pieces_framework_1.Property.Number({
|
|
45
|
+
displayName: 'Days Until Due',
|
|
46
|
+
description: "Number of days before an invoice is due. Required if Collection Method is 'Send Invoice'.",
|
|
47
|
+
required: false,
|
|
48
|
+
}),
|
|
49
|
+
trial_period_days: pieces_framework_1.Property.Number({
|
|
50
|
+
displayName: 'Trial Period (Days)',
|
|
51
|
+
description: 'Integer representing the number of trial days the customer receives before the subscription bills for the first time.',
|
|
52
|
+
required: false,
|
|
53
|
+
}),
|
|
54
|
+
default_payment_method: pieces_framework_1.Property.ShortText({
|
|
55
|
+
displayName: 'Default Payment Method ID',
|
|
56
|
+
description: 'ID of the default payment method for the subscription (e.g., `pm_...`).',
|
|
57
|
+
required: false,
|
|
58
|
+
}),
|
|
59
|
+
metadata: pieces_framework_1.Property.Json({
|
|
60
|
+
displayName: 'Metadata',
|
|
61
|
+
required: false,
|
|
62
|
+
}),
|
|
63
|
+
},
|
|
64
|
+
run(context) {
|
|
65
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const { customer, items, collection_method, days_until_due, trial_period_days, default_payment_method, metadata, } = context.propsValue;
|
|
67
|
+
const body = {
|
|
68
|
+
customer,
|
|
69
|
+
collection_method,
|
|
70
|
+
days_until_due,
|
|
71
|
+
trial_period_days,
|
|
72
|
+
default_payment_method,
|
|
73
|
+
metadata,
|
|
74
|
+
};
|
|
75
|
+
Object.keys(body).forEach((key) => {
|
|
76
|
+
if (body[key] === undefined || body[key] === null) {
|
|
77
|
+
delete body[key];
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
if (items && Array.isArray(items)) {
|
|
81
|
+
items.forEach((item, index) => {
|
|
82
|
+
const typedItem = item;
|
|
83
|
+
body[`items[${index}][price]`] = typedItem.price;
|
|
84
|
+
if (typedItem.quantity) {
|
|
85
|
+
body[`items[${index}][quantity]`] = typedItem.quantity;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
90
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
91
|
+
url: `${common_1.stripeCommon.baseUrl}/subscriptions`,
|
|
92
|
+
authentication: {
|
|
93
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
94
|
+
token: context.auth,
|
|
95
|
+
},
|
|
96
|
+
headers: {
|
|
97
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
98
|
+
},
|
|
99
|
+
body: body,
|
|
100
|
+
});
|
|
101
|
+
return response.body;
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=create-subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-subscription.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/stripe/src/lib/actions/create-subscription.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,6BAAmC;AACnC,sCAAyC;AAE5B,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,kEAAkE;IACpE,KAAK,EAAE;QACL,QAAQ,EAAE,qBAAY,CAAC,QAAQ;QAC/B,KAAK,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACpB,WAAW,EAAE,oBAAoB;YACjC,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;oBACxB,WAAW,EAAE,UAAU;oBACvB,WAAW,EACT,0GAA0G;oBAC5G,QAAQ,EAAE,IAAI;iBACf,CAAC;gBACF,QAAQ,EAAE,2BAAQ,CA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|
|
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.stripeDeactivatePaymentLink = (0, pieces_framework_1.createAction)({
|
|
9
|
+
name: 'deactivate_payment_link',
|
|
10
|
+
auth: __1.stripeAuth,
|
|
11
|
+
displayName: 'Deactivate Payment Link',
|
|
12
|
+
description: 'Disable or deactivate a Payment Link so it can no longer be used.',
|
|
13
|
+
props: {
|
|
14
|
+
payment_link_id: common_1.stripeCommon.paymentLink,
|
|
15
|
+
},
|
|
16
|
+
run(context) {
|
|
17
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const { payment_link_id } = context.propsValue;
|
|
19
|
+
const client = (0, common_1.getClient)(context.auth);
|
|
20
|
+
return yield client.paymentLinks.update(payment_link_id, {
|
|
21
|
+
active: false,
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=deactivate-payment-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deactivate-payment-link.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/stripe/src/lib/actions/deactivate-payment-link.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,6BAAmC;AACnC,sCAAoD;AAEvC,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACtD,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,yBAAyB;IACtC,WAAW,EACT,mEAAmE;IACrE,KAAK,EAAE;QACL,eAAe,EAAE,qBAAY,CAAC,WAAW;KAC1C;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC/C,MAAM,MAAM,GAAG,IAAA,kBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACvC,OAAO,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,eAAe,EAAE;gBACvD,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripeFindInvoice = 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.stripeFindInvoice = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'find_invoice',
|
|
11
|
+
auth: __1.stripeAuth,
|
|
12
|
+
displayName: 'Find Invoice',
|
|
13
|
+
description: 'Finds an invoice by its unique ID.',
|
|
14
|
+
props: {
|
|
15
|
+
invoice_id: common_1.stripeCommon.invoice,
|
|
16
|
+
},
|
|
17
|
+
run(context) {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const { invoice_id } = context.propsValue;
|
|
20
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
21
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
22
|
+
url: `${common_1.stripeCommon.baseUrl}/invoices/${invoice_id}`,
|
|
23
|
+
authentication: {
|
|
24
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
25
|
+
token: context.auth,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return response.body;
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=find-invoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-invoice.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/stripe/src/lib/actions/find-invoice.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAIqC;AACrC,6BAAmC;AACnC,sCAAyC;AAE5B,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE;QACL,UAAU,EAAE,qBAAY,CAAC,OAAO;KACjC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE1C,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAY,CAAC,OAAO,aAAa,UAAU,EAAE;gBACrD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI;iBACpB;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripeRetrieveInvoice = 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.stripeRetrieveInvoice = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'retrieve_invoice',
|
|
11
|
+
auth: __1.stripeAuth,
|
|
12
|
+
displayName: 'Retrieve an Invoice',
|
|
13
|
+
description: 'Retrieves the details of an existing invoice by its ID.',
|
|
14
|
+
props: {
|
|
15
|
+
invoice_id: common_1.stripeCommon.invoice,
|
|
16
|
+
},
|
|
17
|
+
run(context) {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const { invoice_id } = context.propsValue;
|
|
20
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
21
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
22
|
+
url: `${common_1.stripeCommon.baseUrl}/invoices/${invoice_id}`,
|
|
23
|
+
authentication: {
|
|
24
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
25
|
+
token: context.auth,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return response.body;
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=retrieve-invoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieve-invoice.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/stripe/src/lib/actions/retrieve-invoice.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAIqC;AACrC,6BAAmC;AACnC,sCAAyC;AAE5B,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,yDAAyD;IACtE,KAAK,EAAE;QACL,UAAU,EAAE,qBAAY,CAAC,OAAO;KACjC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE1C,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAY,CAAC,OAAO,aAAa,UAAU,EAAE;gBACrD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI;iBACpB;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripeRetrievePaymentIntent = 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.stripeRetrievePaymentIntent = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'retrieve_payment_intent',
|
|
11
|
+
auth: __1.stripeAuth,
|
|
12
|
+
displayName: 'Find Payment (by Payment Intent ID)',
|
|
13
|
+
description: 'Retrieves the details of a payment by its unique Payment Intent ID.',
|
|
14
|
+
props: {
|
|
15
|
+
payment_intent_id: common_1.stripeCommon.paymentIntent,
|
|
16
|
+
},
|
|
17
|
+
run(context) {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const { payment_intent_id } = context.propsValue;
|
|
20
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
21
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
22
|
+
url: `${common_1.stripeCommon.baseUrl}/payment_intents/${payment_intent_id}`,
|
|
23
|
+
authentication: {
|
|
24
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
25
|
+
token: context.auth,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return response.body;
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=retrieve-payment-intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieve-payment-intent.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/stripe/src/lib/actions/retrieve-payment-intent.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAIqC;AACrC,6BAAmC;AACnC,sCAAyC;AAE5B,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACtD,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,qCAAqC;IAClD,WAAW,EACT,qEAAqE;IACvE,KAAK,EAAE;QACL,iBAAiB,EAAE,qBAAY,CAAC,aAAa;KAC9C;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEjD,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAY,CAAC,OAAO,oBAAoB,iBAAiB,EAAE;gBACnE,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI;iBACpB;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripeRetrievePayout = 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.stripeRetrievePayout = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'retrieve_payout',
|
|
11
|
+
auth: __1.stripeAuth,
|
|
12
|
+
displayName: 'Retrieve a Payout',
|
|
13
|
+
description: 'Retrieves the details of an existing payout by its ID.',
|
|
14
|
+
props: {
|
|
15
|
+
payout_id: common_1.stripeCommon.payout,
|
|
16
|
+
},
|
|
17
|
+
run(context) {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const { payout_id } = context.propsValue;
|
|
20
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
21
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
22
|
+
url: `${common_1.stripeCommon.baseUrl}/payouts/${payout_id}`,
|
|
23
|
+
authentication: {
|
|
24
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
25
|
+
token: context.auth,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return response.body;
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=retrieve-payout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieve-payout.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/stripe/src/lib/actions/retrieve-payout.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAIqC;AACrC,6BAAmC;AACnC,sCAAyC;AAE5B,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,wDAAwD;IACrE,KAAK,EAAE;QACL,SAAS,EAAE,qBAAY,CAAC,MAAM;KAC/B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEzC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAY,CAAC,OAAO,YAAY,SAAS,EAAE;gBACnD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI;iBACpB;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const stripeUpdateCustomer: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
customer: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
description: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
6
|
+
phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
line1: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
postal_code: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
city: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
state: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
11
|
+
country: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripeUpdateCustomer = 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.stripeUpdateCustomer = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'update_customer',
|
|
11
|
+
auth: __1.stripeAuth,
|
|
12
|
+
displayName: 'Update Customer',
|
|
13
|
+
description: 'Modify an existing customer’s details.',
|
|
14
|
+
props: {
|
|
15
|
+
customer: common_1.stripeCommon.customer,
|
|
16
|
+
email: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Email',
|
|
18
|
+
required: false,
|
|
19
|
+
}),
|
|
20
|
+
name: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'Name',
|
|
22
|
+
required: false,
|
|
23
|
+
}),
|
|
24
|
+
description: pieces_framework_1.Property.LongText({
|
|
25
|
+
displayName: 'Description',
|
|
26
|
+
required: false,
|
|
27
|
+
}),
|
|
28
|
+
phone: pieces_framework_1.Property.ShortText({
|
|
29
|
+
displayName: 'Phone',
|
|
30
|
+
required: false,
|
|
31
|
+
}),
|
|
32
|
+
line1: pieces_framework_1.Property.ShortText({
|
|
33
|
+
displayName: 'Address Line 1',
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
postal_code: pieces_framework_1.Property.ShortText({
|
|
37
|
+
displayName: 'Postal Code',
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
city: pieces_framework_1.Property.ShortText({
|
|
41
|
+
displayName: 'City',
|
|
42
|
+
required: false,
|
|
43
|
+
}),
|
|
44
|
+
state: pieces_framework_1.Property.ShortText({
|
|
45
|
+
displayName: 'State',
|
|
46
|
+
required: false,
|
|
47
|
+
}),
|
|
48
|
+
country: pieces_framework_1.Property.ShortText({
|
|
49
|
+
displayName: 'Country',
|
|
50
|
+
required: false,
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
53
|
+
run(context) {
|
|
54
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const _a = context.propsValue, { customer } = _a, propsValue = tslib_1.__rest(_a, ["customer"]);
|
|
56
|
+
const body = {};
|
|
57
|
+
if (propsValue.name)
|
|
58
|
+
body.name = propsValue.name;
|
|
59
|
+
if (propsValue.email)
|
|
60
|
+
body.email = propsValue.email;
|
|
61
|
+
if (propsValue.description)
|
|
62
|
+
body.description = propsValue.description;
|
|
63
|
+
if (propsValue.phone)
|
|
64
|
+
body.phone = propsValue.phone;
|
|
65
|
+
const address = {};
|
|
66
|
+
if (propsValue.line1)
|
|
67
|
+
address.line1 = propsValue.line1;
|
|
68
|
+
if (propsValue.city)
|
|
69
|
+
address.city = propsValue.city;
|
|
70
|
+
if (propsValue.state)
|
|
71
|
+
address.state = propsValue.state;
|
|
72
|
+
if (propsValue.postal_code)
|
|
73
|
+
address.postal_code = propsValue.postal_code;
|
|
74
|
+
if (propsValue.country)
|
|
75
|
+
address.country = propsValue.country;
|
|
76
|
+
if (Object.keys(address).length > 0) {
|
|
77
|
+
body.address = address;
|
|
78
|
+
}
|
|
79
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
80
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
81
|
+
url: `https://api.stripe.com/v1/customers/${customer}`,
|
|
82
|
+
authentication: {
|
|
83
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
84
|
+
token: context.auth,
|
|
85
|
+
},
|
|
86
|
+
headers: {
|
|
87
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
88
|
+
},
|
|
89
|
+
body: body,
|
|
90
|
+
});
|
|
91
|
+
return response.body;
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=update-customer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-customer.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/stripe/src/lib/actions/update-customer.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,6BAAmC;AACnC,sCAAyC;AAE5B,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,QAA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C,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
import { Stripe } from 'stripe';
|
|
2
|
+
export declare const getClient: (apiKey: string) => Stripe;
|
|
1
3
|
export declare const stripeCommon: {
|
|
2
4
|
baseUrl: string;
|
|
3
5
|
subscribeWebhook: (eventName: string, webhookUrl: string, apiKey: string) => Promise<{
|
|
4
6
|
id: string;
|
|
5
7
|
}>;
|
|
6
8
|
unsubscribeWebhook: (webhookId: string, apiKey: string) => Promise<import("@activepieces/pieces-common").HttpResponse<any>>;
|
|
9
|
+
invoice: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
10
|
+
customer: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
11
|
+
product: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
12
|
+
price: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
13
|
+
subscription: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
14
|
+
payout: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
15
|
+
paymentIntent: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
16
|
+
paymentLink: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
7
17
|
};
|