Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d7e5737a0 | |||
| 305e3b7ef2 | |||
| 03721cb18d | |||
| 773a6e2c81 | |||
| 2f13ac100f | |||
| a10782490f | |||
| 6ad91123f2 | |||
| aa7458fe37 |
@@ -71,7 +71,7 @@ jobs:
|
||||
commit: "chore: Update version for release"
|
||||
title: "chore: Update version for release"
|
||||
publish: pnpm run changeset:release
|
||||
createGithubReleases: true
|
||||
createGithubReleases: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
@@ -27,6 +27,7 @@ export type EnqueueRunExecutionV2Options = {
|
||||
runAt?: Date;
|
||||
resumeTaskId?: string;
|
||||
isRetry?: boolean;
|
||||
skipRetrying?: boolean;
|
||||
};
|
||||
|
||||
export async function enqueueRunExecutionV2(
|
||||
@@ -47,6 +48,7 @@ export async function enqueueRunExecutionV2(
|
||||
tx,
|
||||
runAt: options.runAt,
|
||||
jobKey: `job_run:${run.id}`,
|
||||
maxAttempts: options.skipRetrying ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -195,12 +195,13 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
|
||||
): Promise<GraphileJob> {
|
||||
const task = this.#tasks[identifier];
|
||||
|
||||
const optionsWithoutTx = omit(options ?? {}, ["tx"]);
|
||||
const optionsWithoutTx = removeUndefinedKeys(omit(options ?? {}, ["tx"]));
|
||||
const taskWithoutJobKey = omit(task, ["jobKey"]);
|
||||
|
||||
// Make sure options passed in to enqueue take precedence over task options
|
||||
const spec = {
|
||||
...optionsWithoutTx,
|
||||
...taskWithoutJobKey,
|
||||
...optionsWithoutTx,
|
||||
};
|
||||
|
||||
if (typeof task.queueName === "function") {
|
||||
@@ -437,3 +438,12 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
|
||||
logger.debug(`[worker][${this.#name}] ${message}`, args);
|
||||
}
|
||||
}
|
||||
|
||||
function removeUndefinedKeys<T extends object>(obj: T): T {
|
||||
for (let key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key) && obj[key] === undefined) {
|
||||
delete obj[key];
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@ export async function action({ request }: ActionArgs) {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
title: body.type,
|
||||
content: body,
|
||||
content: {
|
||||
...body,
|
||||
example: { id: body.type, name: body.type, icon: "stripe", payload: body.data.object },
|
||||
},
|
||||
readOnly: true,
|
||||
}),
|
||||
});
|
||||
|
||||
+6
@@ -1,4 +1,5 @@
|
||||
import { ActionArgs, LoaderArgs, json } from "@remix-run/server-runtime";
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
import { z } from "zod";
|
||||
import { PrismaClient, prisma } from "~/db.server";
|
||||
import { logger } from "~/services/logger.server";
|
||||
@@ -99,6 +100,9 @@ export class TriggerEndpointIndexHookService {
|
||||
slug: endpointSlug,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
environment: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!endpoint) {
|
||||
@@ -122,6 +126,8 @@ export class TriggerEndpointIndexHookService {
|
||||
},
|
||||
{
|
||||
runAt: new Date(Date.now() + 5000),
|
||||
maxAttempts:
|
||||
endpoint.environment.type === RuntimeEnvironmentType.DEVELOPMENT ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,10 @@ export class EndpointApiError extends Error {
|
||||
}
|
||||
|
||||
export class EndpointApi {
|
||||
constructor(private apiKey: string, private url: string) {}
|
||||
constructor(
|
||||
private apiKey: string,
|
||||
private url: string
|
||||
) {}
|
||||
|
||||
async ping(endpointId: string): Promise<PongResponse> {
|
||||
const response = await safeFetch(this.url, {
|
||||
|
||||
@@ -4,6 +4,7 @@ import { AuthenticatedEnvironment } from "../apiAuth.server";
|
||||
import { EndpointApi } from "../endpointApi.server";
|
||||
import { workerQueue } from "../worker.server";
|
||||
import { env } from "~/env.server";
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
|
||||
const indexingHookIdentifier = customAlphabet("0123456789abcdefghijklmnopqrstuvxyz", 10);
|
||||
|
||||
@@ -51,6 +52,9 @@ export class CreateEndpointService {
|
||||
slug: id,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
environment: true,
|
||||
},
|
||||
create: {
|
||||
environment: {
|
||||
connect: {
|
||||
@@ -83,7 +87,11 @@ export class CreateEndpointService {
|
||||
id: endpoint.id,
|
||||
source: "INTERNAL",
|
||||
},
|
||||
{ tx }
|
||||
{
|
||||
tx,
|
||||
maxAttempts:
|
||||
endpoint.environment.type === RuntimeEnvironmentType.DEVELOPMENT ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
|
||||
return endpoint;
|
||||
|
||||
@@ -5,6 +5,7 @@ import { AuthenticatedEnvironment } from "../apiAuth.server";
|
||||
import { workerQueue } from "../worker.server";
|
||||
import { CreateEndpointError } from "./createEndpoint.server";
|
||||
import { EndpointApi } from "../endpointApi.server";
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
|
||||
const indexingHookIdentifier = customAlphabet("0123456789abcdefghijklmnopqrstuvxyz", 10);
|
||||
|
||||
@@ -35,6 +36,9 @@ export class ValidateCreateEndpointService {
|
||||
slug: validationResult.endpointId,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
environment: true,
|
||||
},
|
||||
create: {
|
||||
environment: {
|
||||
connect: {
|
||||
@@ -67,7 +71,11 @@ export class ValidateCreateEndpointService {
|
||||
id: endpoint.id,
|
||||
source: "INTERNAL",
|
||||
},
|
||||
{ tx }
|
||||
{
|
||||
tx,
|
||||
maxAttempts:
|
||||
endpoint.environment.type === RuntimeEnvironmentType.DEVELOPMENT ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
|
||||
return endpoint;
|
||||
|
||||
@@ -7,7 +7,10 @@ import { logger } from "../logger.server";
|
||||
export class IngestSendEvent {
|
||||
#prismaClient: PrismaClientOrTransaction;
|
||||
|
||||
constructor(prismaClient: PrismaClientOrTransaction = prisma, private deliverEvents = true) {
|
||||
constructor(
|
||||
prismaClient: PrismaClientOrTransaction = prisma,
|
||||
private deliverEvents = true
|
||||
) {
|
||||
this.#prismaClient = prismaClient;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
import { $transaction, Prisma, PrismaClient, prisma } from "~/db.server";
|
||||
import { enqueueRunExecutionV2 } from "~/models/jobRunExecution.server";
|
||||
|
||||
@@ -16,6 +17,9 @@ export class ContinueRunService {
|
||||
async (tx) => {
|
||||
const run = await tx.jobRun.findUniqueOrThrow({
|
||||
where: { id: runId },
|
||||
include: {
|
||||
environment: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!RESUMABLE_STATUSES.includes(run.status)) {
|
||||
@@ -35,7 +39,9 @@ export class ContinueRunService {
|
||||
},
|
||||
});
|
||||
|
||||
await enqueueRunExecutionV2(run, tx);
|
||||
await enqueueRunExecutionV2(run, tx, {
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
},
|
||||
{ timeout: 10000 }
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
RunJobSuccess,
|
||||
RunSourceContextSchema,
|
||||
} from "@trigger.dev/core";
|
||||
import type { Task } from "@trigger.dev/database";
|
||||
import { RuntimeEnvironmentType, type Task } from "@trigger.dev/database";
|
||||
import { generateErrorMessage } from "zod-error";
|
||||
import { eventRecordToApiJson } from "~/api.server";
|
||||
import { $transaction, PrismaClient, PrismaClientOrTransaction, prisma } from "~/db.server";
|
||||
@@ -135,7 +135,9 @@ export class PerformRunExecutionV2Service {
|
||||
},
|
||||
});
|
||||
|
||||
await enqueueRunExecutionV2(run, tx);
|
||||
await enqueueRunExecutionV2(run, tx, {
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -337,6 +339,7 @@ export class PerformRunExecutionV2Service {
|
||||
runAt: data.task.delayUntil ?? undefined,
|
||||
resumeTaskId: data.task.id,
|
||||
isRetry,
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -409,6 +412,7 @@ export class PerformRunExecutionV2Service {
|
||||
runAt: data.retryAt,
|
||||
resumeTaskId: data.task.id,
|
||||
isRetry,
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -464,7 +468,9 @@ export class PerformRunExecutionV2Service {
|
||||
},
|
||||
});
|
||||
|
||||
await enqueueRunExecutionV2(run, tx);
|
||||
await enqueueRunExecutionV2(run, tx, {
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import type { ConnectionType, Integration, IntegrationConnection } from "@trigger.dev/database";
|
||||
import {
|
||||
RuntimeEnvironmentType,
|
||||
type ConnectionType,
|
||||
type Integration,
|
||||
type IntegrationConnection,
|
||||
} from "@trigger.dev/database";
|
||||
import type { PrismaClient, PrismaClientOrTransaction } from "~/db.server";
|
||||
import { prisma } from "~/db.server";
|
||||
import { enqueueRunExecutionV2 } from "~/models/jobRunExecution.server";
|
||||
@@ -83,7 +88,9 @@ export class StartRunService {
|
||||
|
||||
const updatedRun = await updateRun();
|
||||
|
||||
await enqueueRunExecutionV2(updatedRun, this.#prismaClient);
|
||||
await enqueueRunExecutionV2(updatedRun, this.#prismaClient, {
|
||||
skipRetrying: run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
}
|
||||
|
||||
async #handleMissingConnections(id: string, runConnectionsByKey: RunConnectionsByKey) {
|
||||
@@ -140,6 +147,7 @@ async function findRun(tx: PrismaClientOrTransaction, id: string) {
|
||||
where: { id },
|
||||
include: {
|
||||
queue: true,
|
||||
environment: true,
|
||||
version: {
|
||||
include: {
|
||||
integrations: {
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { PrismaClient } from "~/db.server";
|
||||
import { prisma } from "~/db.server";
|
||||
import { workerQueue } from "../worker.server";
|
||||
import { requestUrl } from "~/utils/requestUrl.server";
|
||||
import { RuntimeEnvironmentType } from "@trigger.dev/database";
|
||||
|
||||
export class HandleHttpSourceService {
|
||||
#prismaClient: PrismaClient;
|
||||
@@ -55,6 +56,8 @@ export class HandleHttpSourceService {
|
||||
{
|
||||
queueName: `endpoint-${triggerSource.endpointId}`,
|
||||
tx,
|
||||
maxAttempts:
|
||||
triggerSource.environment.type === RuntimeEnvironmentType.DEVELOPMENT ? 1 : undefined,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { env } from "process";
|
||||
import { Run } from "~/presenters/RunPresenter.server";
|
||||
import {
|
||||
FetchOperationSchema,
|
||||
FetchRequestInit,
|
||||
@@ -6,7 +8,7 @@ import {
|
||||
RedactString,
|
||||
calculateRetryAt,
|
||||
} from "@trigger.dev/core";
|
||||
import type { Task } from "@trigger.dev/database";
|
||||
import { RuntimeEnvironmentType, type Task } from "@trigger.dev/database";
|
||||
import { $transaction, PrismaClient, PrismaClientOrTransaction, prisma } from "~/db.server";
|
||||
import { enqueueRunExecutionV2 } from "~/models/jobRunExecution.server";
|
||||
import { formatUnknownError } from "~/utils/formatErrors.server";
|
||||
@@ -244,7 +246,9 @@ export class PerformTaskOperationService {
|
||||
}
|
||||
|
||||
async #resumeRunExecution(task: NonNullable<FoundTask>, prisma: PrismaClientOrTransaction) {
|
||||
await enqueueRunExecutionV2(task.run, prisma);
|
||||
await enqueueRunExecutionV2(task.run, prisma, {
|
||||
skipRetrying: task.run.environment.type === RuntimeEnvironmentType.DEVELOPMENT,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,6 +285,7 @@ async function findTask(prisma: PrismaClient, id: string) {
|
||||
attempts: true,
|
||||
run: {
|
||||
include: {
|
||||
environment: true,
|
||||
queue: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -9,11 +9,11 @@ title: Stripe
|
||||
<CodeGroup>
|
||||
|
||||
```bash npm
|
||||
npm install @trigger.dev/stripe@latest
|
||||
npm add @trigger.dev/stripe@latest
|
||||
```
|
||||
|
||||
```bash pnpm
|
||||
pnpm install @trigger.dev/stripe@latest
|
||||
pnpm add @trigger.dev/stripe@latest
|
||||
```
|
||||
|
||||
```bash yarn
|
||||
@@ -83,48 +83,87 @@ client.defineJob({
|
||||
|
||||
Available triggers are listed below:
|
||||
|
||||
| Function Name | Events | Description | Aggregate Version |
|
||||
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | ------------------------ |
|
||||
| `onCharge` | `charge.succeeded`, `charge.failed`, `charge.captured`, `charge.refunded`, `charge.updated` | Triggered on all charge events | ✔️ |
|
||||
| `onChargeSucceeded` | `charge.succeeded` | Triggered on charge succeeded events | `onCharge` |
|
||||
| `onChargeFailed` | `charge.failed` | Triggered on charge failed events | `onCharge` |
|
||||
| `onChargeCaptured` | `charge.captured` | Triggered on charge captured events | `onCharge` |
|
||||
| `onChargeRefunded` | `charge.refunded` | Triggered on charge refunded events | `onCharge` |
|
||||
| `onChargeUpdated` | `charge.updated` | Triggered on charge updated events | `onCharge` |
|
||||
| `onProduct` | `product.created`, `product.updated`, `product.deleted` | Triggered on all product events | ✔️ |
|
||||
| `onProductCreated` | `product.created` | Triggered on product created events | `onProduct` |
|
||||
| `onProductUpdated` | `product.updated` | Triggered on product updated events | `onProduct` |
|
||||
| `onProductDeleted` | `product.deleted` | Triggered on product deleted events | `onProduct` |
|
||||
| `onPrice` | `price.created`, `price.updated`, `price.deleted` | Triggered on all price events | ✔️ |
|
||||
| `onPriceCreated` | `price.created` | Triggered on price created events | `onPrice` |
|
||||
| `onPriceUpdated` | `price.updated` | Triggered on price updated events | `onPrice` |
|
||||
| `onPriceDeleted` | `price.deleted` | Triggered on price deleted events | `onPrice` |
|
||||
| `onCheckoutSession` | `checkout.session.completed`, `checkout.session.async_payment_succeeded`, `checkout.session.async_payment_failed`, `checkout.session.expired` | Triggered on all checkout session events | ✔️ |
|
||||
| `onCheckoutSessionCompleted` | `checkout.session.completed` | Triggered on checkout session completed events | `onCheckoutSession` |
|
||||
| `onCheckoutSessionExpired` | `checkout.session.expired` | Triggered on checkout session expired events | `onCheckoutSession` |
|
||||
| `onCustomerSubscription` | `customer.subscription.created`, `customer.subscription.updated`, `customer.subscription.deleted`, `customer.subscription.paused`, `customer.subscription.pending_updated_applied`, `customer.subscription.pending_update_expired`, `customer.subscription.resumed` | Triggered on all customer subscription events | ✔️ |
|
||||
| `onCustomerSubscriptionCreated` | `customer.subscription.created` | Triggered on customer subscription created events | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionUpdated` | `customer.subscription.updated` | Triggered on customer subscription updated events | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionDeleted` | `customer.subscription.deleted` | Triggered on customer subscription deleted events | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionPaused` | `customer.subscription.paused` | Triggered on customer subscription paused events | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionPending` | `customer.subscription.pending_updated_applied`, `customer.subscription.pending_update_expired` | Triggered on customer subscription pending events | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionResumed` | `customer.subscription.resumed` | Triggered on customer subscription resumed events | `onCustomerSubscription` |
|
||||
| `onCustomer` | `customer.created`, `customer.updated`, `customer.deleted` | Triggered on all customer events | ✔️ |
|
||||
| `onCustomerCreated` | `customer.created` | Triggered on customer created events | `onCustomer` |
|
||||
| `onCustomerUpdated` | `customer.updated` | Triggered on customer updated events | `onCustomer` |
|
||||
| `onCustomerDeleted` | `customer.deleted` | Triggered on customer deleted events | `onCustomer` |
|
||||
| `onExternalAccount` | `account.external_account.created`, `account.external_account.updated`, `account.external_account.deleted` | Triggered on all external account events | ✔️ |
|
||||
| `onExternalAccountCreated` | `account.external_account.created` | Triggered on external account created events | `onExternalAccount` |
|
||||
| `onExternalAccountUpdated` | `account.external_account.updated` | Triggered on external account updated events | `onExternalAccount` |
|
||||
| `onExternalAccountDeleted` | `account.external_account.deleted` | Triggered on external account deleted events | `onExternalAccount` |
|
||||
| `onPerson` | `account.person.created`, `account.person.updated`, `account.person.deleted` | Triggered on all person events | ✔️ |
|
||||
| `onPersonCreated` | `account.person.created` | Triggered on person created events | `onPerson` |
|
||||
| `onPersonUpdated` | `account.person.updated` | Triggered on person updated events | `onPerson` |
|
||||
| `onPersonDeleted` | `account.person.deleted` | Triggered on person deleted events | `onPerson` |
|
||||
| `onAccountUpdated` | `account.updated` | Triggered on account updated events | N/A |
|
||||
| Function Name | Payload Object | Events | Aggregate Version |
|
||||
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
|
||||
| `onCharge` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.succeeded`, `charge.failed`, `charge.captured`, `charge.refunded`, `charge.updated` | ✔️ |
|
||||
| `onChargeSucceeded` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.succeeded` | `onCharge` |
|
||||
| `onChargeFailed` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.failed` | `onCharge` |
|
||||
| `onChargeCaptured` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.captured` | `onCharge` |
|
||||
| `onChargeRefunded` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.refunded` | `onCharge` |
|
||||
| `onChargeUpdated` | [Charge](https://stripe.com/docs/api/events/types#charge_object) | `charge.updated` | `onCharge` |
|
||||
| `onProduct` | [Product](https://stripe.com/docs/api/events/types#product_object) | `product.created`, `product.updated`, `product.deleted` | ✔️ |
|
||||
| `onProductCreated` | [Product](https://stripe.com/docs/api/events/types#product_object) | `product.created` | `onProduct` |
|
||||
| `onProductUpdated` | [Product](https://stripe.com/docs/api/events/types#product_object) | `product.updated` | `onProduct` |
|
||||
| `onProductDeleted` | [Product](https://stripe.com/docs/api/events/types#product_object) | `product.deleted` | `onProduct` |
|
||||
| `onPrice` | [Price](https://stripe.com/docs/api/events/types#price_object) | `price.created`, `price.updated`, `price.deleted` | ✔️ |
|
||||
| `onPriceCreated` | [Price](https://stripe.com/docs/api/events/types#price_object) | `price.created` | `onPrice` |
|
||||
| `onPriceUpdated` | [Price](https://stripe.com/docs/api/events/types#price_object) | `price.updated` | `onPrice` |
|
||||
| `onPriceDeleted` | [Price](https://stripe.com/docs/api/events/types#price_object) | `price.deleted` | `onPrice` |
|
||||
| `onCheckoutSession` | [CheckoutSession](https://stripe.com/docs/api/events/types#checkout_session_object) | `checkout.session.completed`, `checkout.session.async_payment_succeeded`, `checkout.session.async_payment_failed`, `checkout.session.expired` | ✔️ |
|
||||
| `onCheckoutSessionCompleted` | [CheckoutSession](https://stripe.com/docs/api/events/types#checkout_session_object) | `checkout.session.completed` | `onCheckoutSession` |
|
||||
| `onCheckoutSessionExpired` | [CheckoutSession](https://stripe.com/docs/api/events/types#checkout_session_object) | `checkout.session.expired` | `onCheckoutSession` |
|
||||
| `onCustomerSubscription` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.created`, `customer.subscription.updated`, `customer.subscription.deleted`, `customer.subscription.paused`, `customer.subscription.pending_updated_applied`, `customer.subscription.pending_update_expired`, `customer.subscription.resumed` | ✔️ |
|
||||
| `onCustomerSubscriptionCreated` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.created` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionUpdated` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.updated` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionDeleted` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.deleted` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionPaused` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.paused` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionPending` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.pending_updated_applied`, `customer.subscription.pending_update_expired` | `onCustomerSubscription` |
|
||||
| `onCustomerSubscriptionResumed` | [Subscription](https://stripe.com/docs/api/events/types#subscription_object) | `customer.subscription.resumed` | `onCustomerSubscription` |
|
||||
| `onCustomer` | [Customer](https://stripe.com/docs/api/events/types#customer_object) | `customer.created`, `customer.updated`, `customer.deleted` | ✔️ |
|
||||
| `onCustomerCreated` | [Customer](https://stripe.com/docs/api/events/types#customer_object) | `customer.created` | `onCustomer` |
|
||||
| `onCustomerUpdated` | [Customer](https://stripe.com/docs/api/events/types#customer_object) | `customer.updated` | `onCustomer` |
|
||||
| `onCustomerDeleted` | [Customer](https://stripe.com/docs/api/events/types#customer_object) | `customer.deleted` | `onCustomer` |
|
||||
| `onExternalAccount` | [Card](https://stripe.com/docs/api/events/types#account_card_object) or [Bank Account](https://stripe.com/docs/api/events/types#account_bank_account_object) | `account.external_account.created`, `account.external_account.updated`, `account.external_account.deleted` | ✔️ |
|
||||
| `onExternalAccountCreated` | [Card](https://stripe.com/docs/api/events/types#account_card_object) or [Bank Account](https://stripe.com/docs/api/events/types#account_bank_account_object) | `account.external_account.created` | `onExternalAccount` |
|
||||
| `onExternalAccountUpdated` | [Card](https://stripe.com/docs/api/events/types#account_card_object) or [Bank Account](https://stripe.com/docs/api/events/types#account_bank_account_object) | `account.external_account.updated` | `onExternalAccount` |
|
||||
| `onExternalAccountDeleted` | [Card](https://stripe.com/docs/api/events/types#account_card_object) or [Bank Account](https://stripe.com/docs/api/events/types#account_bank_account_object) | `account.external_account.deleted` | `onExternalAccount` |
|
||||
| `onPerson` | [Person](https://stripe.com/docs/api/events/types#person_object) | `account.person.created`, `account.person.updated`, `account.person.deleted` | ✔️ |
|
||||
| `onPersonCreated` | [Person](https://stripe.com/docs/api/events/types#person_object) | `account.person.created` | `onPerson` |
|
||||
| `onPersonUpdated` | [Person](https://stripe.com/docs/api/events/types#person_object) | `account.person.updated` | `onPerson` |
|
||||
| `onPersonDeleted` | [Person](https://stripe.com/docs/api/events/types#person_object) | `account.person.deleted` | `onPerson` |
|
||||
| `onAccountUpdated` | [Account](https://stripe.com/docs/api/events/types#account_object) | `account.updated` | N/A |
|
||||
| `onPaymentIntent` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.created`, `payment_intent.succeeded`, `payment_intent.payment_failed`, `payment_intent.canceled`, `payment_intent.processing`, `payment_intent.amount_capturable_updated`, `payment_intent.requires_action`, `payment_intent.partially_funded` | ✔️ |
|
||||
| `onPaymentIntentCreated` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.created` | `onPaymentIntent` |
|
||||
| `onPaymentIntentSucceeded` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.succeeded` | `onPaymentIntent` |
|
||||
| `onPaymentIntentPaymentFailed` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.payment_failed` | `onPaymentIntent` |
|
||||
| `onPaymentIntentCanceled` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.canceled` | `onPaymentIntent` |
|
||||
| `onPaymentIntentProcessing` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.processing` | `onPaymentIntent` |
|
||||
| `onPaymentIntentRequiresAction` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.requires_action` | `onPaymentIntent` |
|
||||
| `onPaymentIntentAmountCapturableUpdated` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.amount_capturable_updated` | `onPaymentIntent` |
|
||||
| `onPaymentIntentPartiallyFunded` | [PaymentIntent](https://stripe.com/docs/api/events/types#payment_intent_object) | `payment_intent.partially_funded` | `onPaymentIntent` |
|
||||
| `onPayout` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.created`, `payout.updated`, `payout.canceled`, `payout.paid`, `payout.failed`, `payout.reconciliation_completed` | ✔️ |
|
||||
| `onPayoutCreated` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.created` | `onPayout` |
|
||||
| `onPayoutUpdated` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.updated` | `onPayout` |
|
||||
| `onPayoutCanceled` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.canceled` | `onPayout` |
|
||||
| `onPayoutPaid` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.paid` | `onPayout` |
|
||||
| `onPayoutFailed` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.failed` | `onPayout` |
|
||||
| `onPayoutReconciliationCompleted` | [Payout](https://stripe.com/docs/api/events/types#payout_object) | `payout.reconciliation_completed` | `onPayout` |
|
||||
|
||||
If there are any triggers missing that you'd like to see added, please [open a new GitHub Issue](https://github.com/triggerdotdev/trigger.dev/issues/new)
|
||||
|
||||
### Filtering
|
||||
|
||||
All the Stripe triggers take an optional `filter` parameter that allows you to only run the job when the filter matches the event payload:
|
||||
|
||||
```ts
|
||||
// Only trigger when the currency is USD
|
||||
client.defineJob({
|
||||
id: "stripe-on-subscription-created",
|
||||
name: "Stripe On Subscription Created",
|
||||
version: "0.1.0",
|
||||
trigger: stripe.onCustomerSubscriptionCreated({
|
||||
filter: {
|
||||
currency: ["usd"],
|
||||
},
|
||||
}),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.logger.info("ctx", { ctx });
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Check out our [Event Filter docs](/documentation/guides/event-filter) for more information on how to use the filter.
|
||||
|
||||
## Tasks
|
||||
|
||||
You can make reliable calls to the Stripe API inside of jobs using the exposed stripe tasks:
|
||||
|
||||
@@ -186,4 +186,14 @@ client.defineJob({
|
||||
},
|
||||
});
|
||||
|
||||
client.defineJob({
|
||||
id: "stripe-on-charge",
|
||||
name: "Stripe On Charge",
|
||||
version: "0.1.0",
|
||||
trigger: stripe.onCharge(),
|
||||
run: async (payload, io, ctx) => {
|
||||
await io.logger.info("ctx", { ctx });
|
||||
},
|
||||
});
|
||||
|
||||
createExpressServer(client);
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @trigger.dev/github
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/integration-kit@2.0.14`
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/github",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "The official GitHub integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -29,8 +29,8 @@
|
||||
"@octokit/request": "^6.2.5",
|
||||
"@octokit/request-error": "^4.0.1",
|
||||
"@octokit/webhooks": "^10.4.0",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"octokit": "^2.0.14",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @trigger.dev/slack
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/integration-kit@2.0.14`
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/openai",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "The official OpenAI integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -25,8 +25,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"openai": "^4.2.0",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.13"
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.8.0"
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @trigger.dev/plain
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/integration-kit@2.0.14`
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/plain",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "The official Plain.com integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -24,8 +24,8 @@
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@team-plain/typescript-sdk": "^2.7.0"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @trigger.dev/resend
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/integration-kit@2.0.14`
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/resend",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "The official Resend.com integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -24,8 +24,8 @@
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"resend": "^0.9.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @trigger.dev/sendgrid
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/integration-kit@2.0.14`
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/sendgrid",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev integration for @sendgrid/mail",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -26,8 +26,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@sendgrid/mail": "^7.7.0",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.13"
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.8.0"
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/slack
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/slack",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "The official Slack integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@slack/web-api": "^6.8.1",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @trigger.dev/stripe
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Added additional triggers for PaymentIntent and Payout events ([`a1078249`](https://github.com/triggerdotdev/trigger.dev/commit/a10782490fd2764fde40beff4331da89a57e1f16))
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/integration-kit@2.0.14`
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/stripe",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev integration for stripe",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -26,8 +26,8 @@
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"stripe": "^12.14.0",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
import type { EventSpecification } from "@trigger.dev/sdk";
|
||||
import {
|
||||
amountCapturablePaymentIntentExample,
|
||||
cancelledPaymentIntentExample,
|
||||
cancelledSubscriptionExample,
|
||||
capturedChargeExample,
|
||||
checkoutSessionExample,
|
||||
createdCustomerExample,
|
||||
createdPaymentIntentExample,
|
||||
customerSubscriptionExample,
|
||||
deletedCustomerExample,
|
||||
failedChargeExample,
|
||||
failedPaymentIntentExample,
|
||||
pausedSubscriptionExample,
|
||||
refundedChargeExample,
|
||||
succeededChargeExample,
|
||||
succeededPaymentIntentExample,
|
||||
updatedAccountExample,
|
||||
updatedSubscriptionExample,
|
||||
} from "./examples";
|
||||
import {
|
||||
@@ -13,6 +25,8 @@ import {
|
||||
OnCustomerEvent,
|
||||
OnCustomerSubscription,
|
||||
OnExternalAccountEvent,
|
||||
OnPaymentIntentEvent,
|
||||
OnPayoutEvent,
|
||||
OnPersonEvent,
|
||||
OnPriceEvent,
|
||||
OnProductEvent,
|
||||
@@ -467,7 +481,7 @@ export const onAccountUpdated: EventSpecification<OnAccountEvent> = {
|
||||
title: "On Account Updated",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [updatedAccountExample],
|
||||
parsePayload: (payload) => payload as OnAccountEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Account ID", text: payload.id },
|
||||
@@ -480,7 +494,7 @@ export const onCustomer: EventSpecification<OnCustomerEvent> = {
|
||||
title: "On Customer Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [createdCustomerExample],
|
||||
parsePayload: (payload) => payload as OnCustomerEvent,
|
||||
runProperties: (payload) => [{ label: "Customer ID", text: payload.id }],
|
||||
};
|
||||
@@ -490,7 +504,7 @@ export const onCustomerCreated: EventSpecification<OnCustomerEvent> = {
|
||||
title: "On Customer Created",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [createdCustomerExample],
|
||||
parsePayload: (payload) => payload as OnCustomerEvent,
|
||||
runProperties: (payload) => [{ label: "Customer ID", text: payload.id }],
|
||||
};
|
||||
@@ -500,7 +514,7 @@ export const onCustomerDeleted: EventSpecification<OnCustomerEvent> = {
|
||||
title: "On Customer Deleted",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [deletedCustomerExample],
|
||||
parsePayload: (payload) => payload as OnCustomerEvent,
|
||||
runProperties: (payload) => [{ label: "Customer ID", text: payload.id }],
|
||||
};
|
||||
@@ -510,7 +524,7 @@ export const onCustomerUpdated: EventSpecification<OnCustomerEvent> = {
|
||||
title: "On Customer Updated",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [createdCustomerExample],
|
||||
parsePayload: (payload) => payload as OnCustomerEvent,
|
||||
runProperties: (payload) => [{ label: "Customer ID", text: payload.id }],
|
||||
};
|
||||
@@ -528,7 +542,12 @@ export const onCharge: EventSpecification<OnChargeEvent> = {
|
||||
title: "On Charge Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [
|
||||
capturedChargeExample,
|
||||
succeededChargeExample,
|
||||
failedChargeExample,
|
||||
refundedChargeExample,
|
||||
],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
@@ -538,7 +557,7 @@ export const onChargeCaptured: EventSpecification<OnChargeEvent> = {
|
||||
title: "On Charge Captured",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [capturedChargeExample],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
@@ -558,7 +577,7 @@ export const onChargeFailed: EventSpecification<OnChargeEvent> = {
|
||||
title: "On Charge Failed",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [failedChargeExample],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
@@ -578,7 +597,7 @@ export const onChargeRefunded: EventSpecification<OnChargeEvent> = {
|
||||
title: "On Charge Refunded",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [refundedChargeExample],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
@@ -588,7 +607,7 @@ export const onChargeSucceeded: EventSpecification<OnChargeEvent> = {
|
||||
title: "On Charge Succeeded",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
examples: [succeededChargeExample],
|
||||
parsePayload: (payload) => payload as OnChargeEvent,
|
||||
runProperties: (payload) => [{ label: "Charge ID", text: payload.id }],
|
||||
};
|
||||
@@ -710,3 +729,206 @@ export const onPersonUpdated: EventSpecification<OnPersonEvent> = {
|
||||
{ label: "Account", text: payload.account },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPaymentIntent: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: [
|
||||
"payment_intent.created",
|
||||
"payment_intent.succeeded",
|
||||
"payment_intent.canceled",
|
||||
"payment_intent.processing",
|
||||
"payment_intent.requires_action",
|
||||
"payment_intent.amount_capturable_updated",
|
||||
"payment_intent.payment_failed",
|
||||
"payment_intent.partially_funded",
|
||||
],
|
||||
title: "On Payment Intent Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [
|
||||
createdPaymentIntentExample,
|
||||
succeededPaymentIntentExample,
|
||||
cancelledPaymentIntentExample,
|
||||
amountCapturablePaymentIntentExample,
|
||||
failedPaymentIntentExample,
|
||||
],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentCreated: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.created",
|
||||
title: "On Payment Intent Created",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [createdPaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentSucceeded: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.succeeded",
|
||||
title: "On Payment Intent Succeeded",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [succeededPaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentCanceled: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.canceled",
|
||||
title: "On Payment Intent Canceled",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [cancelledPaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentProcessing: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.processing",
|
||||
title: "On Payment Intent Processing",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentRequiresAction: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.requires_action",
|
||||
title: "On Payment Intent Requires Action",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentAmountCapturableUpdated: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.amount_capturable_updated",
|
||||
title: "On Payment Intent Amount Capturable Updated",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [amountCapturablePaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentPaymentFailed: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.payment_failed",
|
||||
title: "On Payment Intent Payment Failed",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [failedPaymentIntentExample],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPaymentIntentPartiallyFunded: EventSpecification<OnPaymentIntentEvent> = {
|
||||
name: "payment_intent.partially_funded",
|
||||
title: "On Payment Intent Partially Funded",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPaymentIntentEvent,
|
||||
runProperties: (payload) => [{ label: "Payment Intent ID", text: payload.id }],
|
||||
};
|
||||
|
||||
export const onPayout: EventSpecification<OnPayoutEvent> = {
|
||||
name: [
|
||||
"payout.canceled",
|
||||
"payout.created",
|
||||
"payout.failed",
|
||||
"payout.paid",
|
||||
"payout.reconciliation_completed",
|
||||
"payout.updated",
|
||||
],
|
||||
title: "On Payout Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutCancelled: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.canceled",
|
||||
title: "On Payout Cancelled Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutCreated: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.created",
|
||||
title: "On Payout Created Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutFailed: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.failed",
|
||||
title: "On Payout Failed Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutPaid: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.paid",
|
||||
title: "On Payout Paid Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutReconciliationCompleted: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.reconciliation_completed",
|
||||
title: "On Payout Reconciliation Completed Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
export const onPayoutUpdated: EventSpecification<OnPayoutEvent> = {
|
||||
name: "payout.updated",
|
||||
title: "On Payout Updated Event",
|
||||
source: "stripe.com",
|
||||
icon: "stripe",
|
||||
examples: [],
|
||||
parsePayload: (payload) => payload as OnPayoutEvent,
|
||||
runProperties: (payload) => [
|
||||
{ label: "Payout ID", text: payload.id },
|
||||
{ label: "Amount", text: `${payload.amount} ${payload.currency}` },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -698,3 +698,932 @@ export const updatedSubscriptionExample = {
|
||||
trial_start: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const updatedAccountExample = {
|
||||
id: "test_account",
|
||||
name: "Updated Account",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "acct_1Nk2DXINGsstqbEy",
|
||||
object: "account",
|
||||
business_profile: {
|
||||
mcc: null,
|
||||
name: null,
|
||||
support_address: null,
|
||||
support_email: null,
|
||||
support_phone: null,
|
||||
support_url: null,
|
||||
url: null,
|
||||
product_description: null,
|
||||
},
|
||||
capabilities: {},
|
||||
charges_enabled: false,
|
||||
controller: {
|
||||
type: "application",
|
||||
is_controller: true,
|
||||
},
|
||||
country: "GB",
|
||||
default_currency: "gbp",
|
||||
details_submitted: false,
|
||||
email: null,
|
||||
payouts_enabled: false,
|
||||
settings: {
|
||||
bacs_debit_payments: {},
|
||||
branding: {
|
||||
icon: null,
|
||||
logo: null,
|
||||
primary_color: null,
|
||||
secondary_color: null,
|
||||
},
|
||||
card_issuing: {
|
||||
tos_acceptance: {
|
||||
date: null,
|
||||
ip: null,
|
||||
},
|
||||
},
|
||||
card_payments: {
|
||||
statement_descriptor_prefix: null,
|
||||
statement_descriptor_prefix_kanji: null,
|
||||
statement_descriptor_prefix_kana: null,
|
||||
decline_on: {
|
||||
avs_failure: false,
|
||||
cvc_failure: false,
|
||||
},
|
||||
},
|
||||
dashboard: {
|
||||
display_name: null,
|
||||
timezone: "Etc/UTC",
|
||||
},
|
||||
payments: {
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_kana: null,
|
||||
statement_descriptor_kanji: null,
|
||||
},
|
||||
sepa_debit_payments: {},
|
||||
payouts: {
|
||||
debit_negative_balances: true,
|
||||
schedule: {
|
||||
delay_days: 7,
|
||||
interval: "daily",
|
||||
},
|
||||
statement_descriptor: null,
|
||||
},
|
||||
},
|
||||
type: "standard",
|
||||
business_type: null,
|
||||
created: 1693216724,
|
||||
external_accounts: {
|
||||
object: "list",
|
||||
data: [],
|
||||
has_more: false,
|
||||
total_count: 0,
|
||||
url: "/v1/accounts/acct_1Nk2DXINGsstqbEy/external_accounts",
|
||||
},
|
||||
future_requirements: {
|
||||
alternatives: [],
|
||||
current_deadline: null,
|
||||
currently_due: [],
|
||||
disabled_reason: null,
|
||||
errors: [],
|
||||
eventually_due: [],
|
||||
past_due: [],
|
||||
pending_verification: [],
|
||||
},
|
||||
metadata: {
|
||||
foo: "bar",
|
||||
},
|
||||
requirements: {
|
||||
alternatives: [],
|
||||
current_deadline: null,
|
||||
currently_due: [
|
||||
"business_profile.product_description",
|
||||
"business_profile.support_phone",
|
||||
"business_profile.url",
|
||||
"external_account",
|
||||
"tos_acceptance.date",
|
||||
"tos_acceptance.ip",
|
||||
],
|
||||
disabled_reason: "requirements.past_due",
|
||||
errors: [],
|
||||
eventually_due: [
|
||||
"business_profile.product_description",
|
||||
"business_profile.support_phone",
|
||||
"business_profile.url",
|
||||
"external_account",
|
||||
"tos_acceptance.date",
|
||||
"tos_acceptance.ip",
|
||||
],
|
||||
past_due: ["external_account", "tos_acceptance.date", "tos_acceptance.ip"],
|
||||
pending_verification: [],
|
||||
},
|
||||
tos_acceptance: {
|
||||
date: null,
|
||||
ip: null,
|
||||
user_agent: null,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const createdCustomerExample = {
|
||||
id: "created_customer",
|
||||
name: "Created Customer",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "cus_OX6SuD19Ej1AwM",
|
||||
object: "customer",
|
||||
address: null,
|
||||
balance: 0,
|
||||
created: 1693216865,
|
||||
currency: null,
|
||||
default_source: null,
|
||||
delinquent: false,
|
||||
description: "(created by Stripe CLI)",
|
||||
discount: null,
|
||||
email: null,
|
||||
invoice_prefix: "02F47541",
|
||||
invoice_settings: {
|
||||
custom_fields: null,
|
||||
default_payment_method: null,
|
||||
footer: null,
|
||||
rendering_options: null,
|
||||
},
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
name: null,
|
||||
phone: null,
|
||||
preferred_locales: [],
|
||||
shipping: null,
|
||||
tax_exempt: "none",
|
||||
test_clock: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const deletedCustomerExample = {
|
||||
id: "deleted_customer",
|
||||
name: "Deleted Customer",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "cus_OX6UWArTxl2eGx",
|
||||
object: "customer",
|
||||
address: null,
|
||||
balance: 0,
|
||||
created: 1693216947,
|
||||
currency: null,
|
||||
default_source: null,
|
||||
delinquent: false,
|
||||
description: "(created by Stripe CLI)",
|
||||
discount: null,
|
||||
email: null,
|
||||
invoice_prefix: "2761E4C9",
|
||||
invoice_settings: {
|
||||
custom_fields: null,
|
||||
default_payment_method: null,
|
||||
footer: null,
|
||||
rendering_options: null,
|
||||
},
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
name: null,
|
||||
phone: null,
|
||||
preferred_locales: [],
|
||||
shipping: null,
|
||||
tax_exempt: "none",
|
||||
test_clock: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const capturedChargeExample = {
|
||||
id: "charge.captured",
|
||||
name: "charge.captured",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "ch_3Nk2IZI0XSgju2ur1KjXKcEP",
|
||||
object: "charge",
|
||||
amount: 2000,
|
||||
amount_captured: 2000,
|
||||
amount_refunded: 0,
|
||||
application: null,
|
||||
application_fee: null,
|
||||
application_fee_amount: null,
|
||||
balance_transaction: "txn_3Nk2IZI0XSgju2ur1yBd2FPs",
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
calculated_statement_descriptor: "WWW.TRIGGER.DEV",
|
||||
captured: true,
|
||||
created: 1693217035,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
destination: null,
|
||||
dispute: null,
|
||||
disputed: false,
|
||||
failure_balance_transaction: null,
|
||||
failure_code: null,
|
||||
failure_message: null,
|
||||
fraud_details: {},
|
||||
invoice: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
on_behalf_of: null,
|
||||
order: null,
|
||||
outcome: {
|
||||
network_status: "approved_by_network",
|
||||
reason: null,
|
||||
risk_level: "normal",
|
||||
risk_score: 23,
|
||||
seller_message: "Payment complete.",
|
||||
type: "authorized",
|
||||
},
|
||||
paid: true,
|
||||
payment_intent: "pi_3Nk2IZI0XSgju2ur1c5PRXzB",
|
||||
payment_method: "pm_1Nk2IZI0XSgju2urQoHr945x",
|
||||
payment_method_details: {
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "w6qgKDLO5EbIJ5VZ",
|
||||
funding: "credit",
|
||||
installments: null,
|
||||
last4: "4242",
|
||||
mandate: null,
|
||||
network: "visa",
|
||||
network_token: {
|
||||
used: false,
|
||||
},
|
||||
three_d_secure: null,
|
||||
wallet: null,
|
||||
},
|
||||
type: "card",
|
||||
},
|
||||
receipt_email: null,
|
||||
receipt_number: null,
|
||||
receipt_url:
|
||||
"https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTVJtRzRJMFhTZ2p1MnVyKI3isacGMgaiHlW3-3o6LBbtHkEOlE2XK3_d2h9msrs3bTJvZi8DcqHrvcQrwxPHm8rP3LA2i5wTqA7Y",
|
||||
refunded: false,
|
||||
review: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
source_transfer: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "succeeded",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const succeededChargeExample = {
|
||||
id: "charge.succeeded",
|
||||
name: "charge.succeeded",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "ch_3Nk2MlI0XSgju2ur0Zcv519e",
|
||||
object: "charge",
|
||||
amount: 2000,
|
||||
amount_captured: 0,
|
||||
amount_refunded: 0,
|
||||
application: null,
|
||||
application_fee: null,
|
||||
application_fee_amount: null,
|
||||
balance_transaction: null,
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
calculated_statement_descriptor: "WWW.TRIGGER.DEV",
|
||||
captured: false,
|
||||
created: 1693217296,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
destination: null,
|
||||
dispute: null,
|
||||
disputed: false,
|
||||
failure_balance_transaction: null,
|
||||
failure_code: null,
|
||||
failure_message: null,
|
||||
fraud_details: {},
|
||||
invoice: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
on_behalf_of: null,
|
||||
order: null,
|
||||
outcome: {
|
||||
network_status: "approved_by_network",
|
||||
reason: null,
|
||||
risk_level: "normal",
|
||||
risk_score: 3,
|
||||
seller_message: "Payment complete.",
|
||||
type: "authorized",
|
||||
},
|
||||
paid: true,
|
||||
payment_intent: "pi_3Nk2MlI0XSgju2ur0p8h6qIg",
|
||||
payment_method: "pm_1Nk2MlI0XSgju2urdy1jOUTb",
|
||||
payment_method_details: {
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "w6qgKDLO5EbIJ5VZ",
|
||||
funding: "credit",
|
||||
installments: null,
|
||||
last4: "4242",
|
||||
mandate: null,
|
||||
network: "visa",
|
||||
network_token: {
|
||||
used: false,
|
||||
},
|
||||
three_d_secure: null,
|
||||
wallet: null,
|
||||
},
|
||||
type: "card",
|
||||
},
|
||||
receipt_email: null,
|
||||
receipt_number: null,
|
||||
receipt_url:
|
||||
"https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTVJtRzRJMFhTZ2p1MnVyKJDksacGMgYAj-PAr_s6LBapIJAZx3QBJGs7up7CDkowPkzJbOD1CzDvmilNbsloUF9ovZ3sWPq6F5SN",
|
||||
refunded: false,
|
||||
review: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
source_transfer: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "succeeded",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const failedChargeExample = {
|
||||
id: "charge.failed",
|
||||
name: "charge.failed",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "ch_3Nk2OVI0XSgju2ur09WGXz58",
|
||||
object: "charge",
|
||||
amount: 100,
|
||||
amount_captured: 0,
|
||||
amount_refunded: 0,
|
||||
application: null,
|
||||
application_fee: null,
|
||||
application_fee_amount: null,
|
||||
balance_transaction: null,
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
calculated_statement_descriptor: "WWW.TRIGGER.DEV",
|
||||
captured: false,
|
||||
created: 1693217403,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
destination: null,
|
||||
dispute: null,
|
||||
disputed: false,
|
||||
failure_balance_transaction: null,
|
||||
failure_code: "card_declined",
|
||||
failure_message: "Your card was declined.",
|
||||
fraud_details: {},
|
||||
invoice: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
on_behalf_of: null,
|
||||
order: null,
|
||||
outcome: {
|
||||
network_status: "declined_by_network",
|
||||
reason: "generic_decline",
|
||||
risk_level: "normal",
|
||||
risk_score: 10,
|
||||
seller_message: "The bank did not return any further details with this decline.",
|
||||
type: "issuer_declined",
|
||||
},
|
||||
paid: false,
|
||||
payment_intent: "pi_3Nk2OVI0XSgju2ur0HYvM3Zu",
|
||||
payment_method: "pm_1Nk2OVI0XSgju2uri9io5fc0",
|
||||
payment_method_details: {
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "LvNwBVtV2ETBNH8a",
|
||||
funding: "credit",
|
||||
installments: null,
|
||||
last4: "0002",
|
||||
mandate: null,
|
||||
network: "visa",
|
||||
network_token: {
|
||||
used: false,
|
||||
},
|
||||
three_d_secure: null,
|
||||
wallet: null,
|
||||
},
|
||||
type: "card",
|
||||
},
|
||||
receipt_email: null,
|
||||
receipt_number: null,
|
||||
receipt_url: null,
|
||||
refunded: false,
|
||||
review: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
source_transfer: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "failed",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const refundedChargeExample = {
|
||||
id: "charge.refunded",
|
||||
name: "charge.refunded",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "ch_3Nk2PLI0XSgju2ur1DqK0bOn",
|
||||
object: "charge",
|
||||
amount: 100,
|
||||
amount_captured: 100,
|
||||
amount_refunded: 100,
|
||||
application: null,
|
||||
application_fee: null,
|
||||
application_fee_amount: null,
|
||||
balance_transaction: "txn_3Nk2PLI0XSgju2ur18SfGzBU",
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
calculated_statement_descriptor: "WWW.TRIGGER.DEV",
|
||||
captured: true,
|
||||
created: 1693217456,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
destination: null,
|
||||
dispute: null,
|
||||
disputed: false,
|
||||
failure_balance_transaction: null,
|
||||
failure_code: null,
|
||||
failure_message: null,
|
||||
fraud_details: {},
|
||||
invoice: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
on_behalf_of: null,
|
||||
order: null,
|
||||
outcome: {
|
||||
network_status: "approved_by_network",
|
||||
reason: null,
|
||||
risk_level: "normal",
|
||||
risk_score: 50,
|
||||
seller_message: "Payment complete.",
|
||||
type: "authorized",
|
||||
},
|
||||
paid: true,
|
||||
payment_intent: "pi_3Nk2PLI0XSgju2ur1yLml2Ev",
|
||||
payment_method: "pm_1Nk2PLI0XSgju2urkxIUAHNK",
|
||||
payment_method_details: {
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "w6qgKDLO5EbIJ5VZ",
|
||||
funding: "credit",
|
||||
installments: null,
|
||||
last4: "4242",
|
||||
mandate: null,
|
||||
network: "visa",
|
||||
network_token: {
|
||||
used: false,
|
||||
},
|
||||
three_d_secure: null,
|
||||
wallet: null,
|
||||
},
|
||||
type: "card",
|
||||
},
|
||||
receipt_email: null,
|
||||
receipt_number: null,
|
||||
receipt_url:
|
||||
"https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTVJtRzRJMFhTZ2p1MnVyKLLlsacGMgbTw8sUtqQ6LBZlhILTcNiKqiXYypfyG6CAcLzUmgE7d6GU9FnnRWNQy6-jhF7lW9GCj7qY",
|
||||
refunded: true,
|
||||
review: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
source_transfer: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "succeeded",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const createdPaymentIntentExample = {
|
||||
id: "payment_intent.created",
|
||||
name: "payment_intent.created",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk2yoI0XSgju2ur14qyhbN6",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 0,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 0,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: null,
|
||||
cancellation_reason: null,
|
||||
capture_method: "automatic",
|
||||
client_secret: "pi_3Nk2yoI0XSgju2ur14qyhbN6_secret_gBSFGokLjHKfG8f5FeVYggBls",
|
||||
confirmation_method: "automatic",
|
||||
created: 1693219654,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: null,
|
||||
latest_charge: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: null,
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "requires_payment_method",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const succeededPaymentIntentExample = {
|
||||
id: "payment_intent.succeeded",
|
||||
name: "payment_intent.succeeded",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk30FI0XSgju2ur1OohIT9i",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 0,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 2000,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: null,
|
||||
cancellation_reason: null,
|
||||
capture_method: "automatic",
|
||||
client_secret: "pi_3Nk30FI0XSgju2ur1OohIT9i_secret_VPcrQS7qSyPZ4GL7BfQRA1X2y",
|
||||
confirmation_method: "automatic",
|
||||
created: 1693219743,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: null,
|
||||
latest_charge: "ch_3Nk30FI0XSgju2ur150Nf8Jf",
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: "pm_1Nk30FI0XSgju2urEXQYKJsw",
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: {
|
||||
address: {
|
||||
city: "San Francisco",
|
||||
country: "US",
|
||||
line1: "510 Townsend St",
|
||||
line2: null,
|
||||
postal_code: "94103",
|
||||
state: "CA",
|
||||
},
|
||||
carrier: null,
|
||||
name: "Jenny Rosen",
|
||||
phone: null,
|
||||
tracking_number: null,
|
||||
},
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "succeeded",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const cancelledPaymentIntentExample = {
|
||||
id: "payment_intent.canceled",
|
||||
name: "payment_intent.canceled",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk316I0XSgju2ur0WYHIexr",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 0,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 0,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: 1693219796,
|
||||
cancellation_reason: "requested_by_customer",
|
||||
capture_method: "automatic",
|
||||
client_secret: "pi_3Nk316I0XSgju2ur0WYHIexr_secret_NWXEzMmLe3IXZIW0HahXUXo9w",
|
||||
confirmation_method: "automatic",
|
||||
created: 1693219796,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: null,
|
||||
latest_charge: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: null,
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "canceled",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const amountCapturablePaymentIntentExample = {
|
||||
id: "payment_intent.amount_capturable_updated",
|
||||
name: "payment_intent.amount_capturable_updated",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk32UI0XSgju2ur0mIrhcYD",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 2000,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 0,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: null,
|
||||
cancellation_reason: null,
|
||||
capture_method: "manual",
|
||||
client_secret: "pi_3Nk32UI0XSgju2ur0mIrhcYD_secret_JyfSHNompZV9sipG3wBgfWf1s",
|
||||
confirmation_method: "manual",
|
||||
created: 1693219882,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: null,
|
||||
latest_charge: "ch_3Nk32UI0XSgju2ur0k1SMSZ4",
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: "pm_1Nk32UI0XSgju2uriPepd9pr",
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "requires_capture",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
export const failedPaymentIntentExample = {
|
||||
id: "payment_intent.payment_failed",
|
||||
name: "payment_intent.payment_failed",
|
||||
icon: "stripe",
|
||||
payload: {
|
||||
id: "pi_3Nk341I0XSgju2ur1ckiktWk",
|
||||
object: "payment_intent",
|
||||
amount: 2000,
|
||||
amount_capturable: 0,
|
||||
amount_details: {
|
||||
tip: {},
|
||||
},
|
||||
amount_received: 0,
|
||||
application: null,
|
||||
application_fee_amount: null,
|
||||
automatic_payment_methods: null,
|
||||
canceled_at: null,
|
||||
cancellation_reason: null,
|
||||
capture_method: "automatic",
|
||||
client_secret: "pi_3Nk341I0XSgju2ur1ckiktWk_secret_3Km19PEIXajFEZRi9qi2VU2d3",
|
||||
confirmation_method: "automatic",
|
||||
created: 1693219977,
|
||||
currency: "usd",
|
||||
customer: null,
|
||||
description: "(created by Stripe CLI)",
|
||||
invoice: null,
|
||||
last_payment_error: {
|
||||
charge: "ch_3Nk341I0XSgju2ur1UZC5yvb",
|
||||
code: "card_declined",
|
||||
decline_code: "generic_decline",
|
||||
doc_url: "https://stripe.com/docs/error-codes/card-declined",
|
||||
message: "Your card was declined.",
|
||||
payment_method: {
|
||||
id: "pm_1Nk341I0XSgju2uraNBls6mm",
|
||||
object: "payment_method",
|
||||
billing_details: {
|
||||
address: {
|
||||
city: null,
|
||||
country: null,
|
||||
line1: null,
|
||||
line2: null,
|
||||
postal_code: null,
|
||||
state: null,
|
||||
},
|
||||
email: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
},
|
||||
card: {
|
||||
brand: "visa",
|
||||
checks: {
|
||||
address_line1_check: null,
|
||||
address_postal_code_check: null,
|
||||
cvc_check: null,
|
||||
},
|
||||
country: "US",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
fingerprint: "LvNwBVtV2ETBNH8a",
|
||||
funding: "credit",
|
||||
generated_from: null,
|
||||
last4: "0002",
|
||||
networks: {
|
||||
available: ["visa"],
|
||||
preferred: null,
|
||||
},
|
||||
three_d_secure_usage: {
|
||||
supported: true,
|
||||
},
|
||||
wallet: null,
|
||||
},
|
||||
created: 1693219977,
|
||||
customer: null,
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
type: "card",
|
||||
},
|
||||
type: "card_error",
|
||||
},
|
||||
latest_charge: "ch_3Nk341I0XSgju2ur1UZC5yvb",
|
||||
livemode: false,
|
||||
metadata: {},
|
||||
next_action: null,
|
||||
on_behalf_of: null,
|
||||
payment_method: null,
|
||||
payment_method_options: {
|
||||
card: {
|
||||
installments: null,
|
||||
mandate_options: null,
|
||||
network: null,
|
||||
request_three_d_secure: "automatic",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card"],
|
||||
processing: null,
|
||||
receipt_email: null,
|
||||
review: null,
|
||||
setup_future_usage: null,
|
||||
shipping: null,
|
||||
source: null,
|
||||
statement_descriptor: null,
|
||||
statement_descriptor_suffix: null,
|
||||
status: "requires_payment_method",
|
||||
transfer_data: null,
|
||||
transfer_group: null,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -621,6 +621,218 @@ export class Stripe implements StripeIntegration {
|
||||
onPersonUpdated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPersonUpdated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs on any payment_intent.* event. Accepts an optional array of events to filter on. By default it will listen to all payment_intent.* events.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* stripe.onPaymentIntent({ events: ["payment_intent.created", "payment_intent.succeeded"] })
|
||||
* ```
|
||||
*
|
||||
* You can detect the event name in your job by using the `ctx.event.name` property:
|
||||
*
|
||||
* ```ts
|
||||
* client.defineJob({
|
||||
* id: "stripe-example",
|
||||
* name: "Stripe Example",
|
||||
* version: "0.1.0",
|
||||
* trigger: stripe.onPaymentIntent({ events: ["payment_intent.created", "payment_intent.succeeded"] }),
|
||||
* run: async (payload, io, ctx) => {
|
||||
* console.log(ctx.event.name); // "payment_intent.created" or "payment_intent.succeeded"
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
onPaymentIntent(
|
||||
params?: TriggerParams & {
|
||||
events?: Array<
|
||||
| "payment_intent.created"
|
||||
| "payment_intent.succeeded"
|
||||
| "payment_intent.canceled"
|
||||
| "payment_intent.processing"
|
||||
| "payment_intent.requires_action"
|
||||
| "payment_intent.amount_capturable_updated"
|
||||
| "payment_intent.payment_failed"
|
||||
| "payment_intent.partially_funded"
|
||||
>;
|
||||
}
|
||||
) {
|
||||
const event = {
|
||||
...events.onPaymentIntent,
|
||||
name: params?.events ?? events.onPaymentIntent.name,
|
||||
};
|
||||
|
||||
return createTrigger(this.source, event, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a new PaymentIntent is created..
|
||||
* */
|
||||
onPaymentIntentCreated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPaymentIntentCreated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent has successfully completed payment.
|
||||
* */
|
||||
onPaymentIntentSucceeded(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentSucceeded,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent is canceled.
|
||||
* */
|
||||
onPaymentIntentCancelled(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPaymentIntentCanceled, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent has started processing.
|
||||
* */
|
||||
onPaymentIntentProcessing(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentProcessing,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent transitions to requires_action state
|
||||
* */
|
||||
onPaymentIntentRequiresAction(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentRequiresAction,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent has funds to be captured. Check the amount_capturable property on the PaymentIntent to determine the amount that can be captured. You may capture the PaymentIntent with an amount_to_capture value up to the specified amount. [Learn more about capturing PaymentIntents](https://stripe.com/docs/api/payment_intents/capture)
|
||||
* */
|
||||
onPaymentIntentAmountCapturableUpdated(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentAmountCapturableUpdated,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when a PaymentIntent has failed the attempt to create a payment method or a payment.
|
||||
* */
|
||||
onPaymentIntentPaymentFailed(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentPaymentFailed,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs when funds are applied to a customer_balance PaymentIntent and the ‘amount_remaining’ changes.
|
||||
* */
|
||||
onPaymentIntentPartiallyFunded(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPaymentIntentPartiallyFunded,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs on any payout.* event. Accepts an optional array of events to filter on. By default it will listen to all payout.* events.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* stripe.onPayout({ events: ["payout.created", "payout.paid"] })
|
||||
* ```
|
||||
*
|
||||
* You can detect the event name in your job by using the `ctx.event.name` property:
|
||||
*
|
||||
* ```ts
|
||||
* client.defineJob({
|
||||
* id: "stripe-example",
|
||||
* name: "Stripe Example",
|
||||
* version: "0.1.0",
|
||||
* trigger: stripe.onPayout({ events: ["payout.created", "payout.paid"] }),
|
||||
* run: async (payload, io, ctx) => {
|
||||
* console.log(ctx.event.name); // "payout.created" or "payout.paid"
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
onPayout(
|
||||
params?: TriggerParams & {
|
||||
events?: Array<
|
||||
| "payout.canceled"
|
||||
| "payout.created"
|
||||
| "payout.failed"
|
||||
| "payout.paid"
|
||||
| "payout.reconciliation_completed"
|
||||
| "payout.updated"
|
||||
>;
|
||||
}
|
||||
) {
|
||||
const event = {
|
||||
...events.onPayout,
|
||||
name: params?.events ?? events.onPayout.name,
|
||||
};
|
||||
|
||||
return createTrigger(this.source, event, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout is created.
|
||||
* */
|
||||
onPayoutCreated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutCreated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout is updated.
|
||||
* */
|
||||
onPayoutUpdated(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutUpdated, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout is canceled.
|
||||
* */
|
||||
onPayoutCanceled(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutCancelled, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout attempt fails.
|
||||
* */
|
||||
onPayoutFailed(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutFailed, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever a payout is expected to be available in the destination account. If the payout fails, a `payout.failed` notification is also sent, at a later time.
|
||||
* */
|
||||
onPayoutPaid(params?: TriggerParams) {
|
||||
return createTrigger(this.source, events.onPayoutPaid, params ?? { connect: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Occurs whenever balance transactions paid out in an automatic payout can be queried.
|
||||
* */
|
||||
onPayoutReconciliationCompleted(params?: TriggerParams) {
|
||||
return createTrigger(
|
||||
this.source,
|
||||
events.onPayoutReconciliationCompleted,
|
||||
params ?? { connect: false }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export type TriggerParams = {
|
||||
|
||||
@@ -81,3 +81,8 @@ export type OnExternalAccountEvent =
|
||||
ExtractWebhookPayload<Stripe.DiscriminatedEvent.AccountExternalAccountEvent>;
|
||||
|
||||
export type OnPersonEvent = ExtractWebhookPayload<Stripe.DiscriminatedEvent.PersonEvent>;
|
||||
|
||||
export type OnPaymentIntentEvent =
|
||||
ExtractWebhookPayload<Stripe.DiscriminatedEvent.PaymentIntentEvent>;
|
||||
|
||||
export type OnPayoutEvent = ExtractWebhookPayload<Stripe.DiscriminatedEvent.PayoutEvent>;
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @trigger.dev/supabase
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/integration-kit@2.0.14`
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/supabase",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev integration for @supabase/supabase-js",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -26,8 +26,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@supabase/supabase-js": "^2.26.0",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"supabase-management-js": "^0.1.4",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @trigger.dev/typeform
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/integration-kit@2.0.14`
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/typeform",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "The official Typeform integration for Trigger.dev",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -26,8 +26,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@typeform/api-client": "^1.8.0",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/integration-kit": "workspace:^2.0.14",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/astro
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@trigger.dev/astro",
|
||||
"description": "An Astro-native integration for Trigger.dev background jobs platform",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"type": "module",
|
||||
"main": "main.js",
|
||||
"scripts": {},
|
||||
"peerDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"astro": "^2.10.7"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# create-trigger
|
||||
|
||||
## 2.0.14
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/cli",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "The Trigger.dev CLI",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# internal-platform
|
||||
|
||||
## 2.0.14
|
||||
|
||||
## 2.0.13
|
||||
|
||||
## 2.0.12
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/core",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "Core code used across the Trigger.dev SDK and platform",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @trigger.dev/eslint-plugin
|
||||
|
||||
## 2.0.14
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/eslint-plugin",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "ESLint plugin with trigger.dev best practices",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/express
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/express",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "Official Express adapter for Trigger.dev",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
@@ -19,7 +19,7 @@
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"@trigger.dev/tsconfig": "workspace:*",
|
||||
"@types/debug": "^4.1.7",
|
||||
"@types/express": "^4.17.13",
|
||||
@@ -33,7 +33,7 @@
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13"
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/web-fetch": "^4.3.5",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @trigger.dev/integration-kit
|
||||
|
||||
## 2.0.14
|
||||
|
||||
## 2.0.13
|
||||
|
||||
## 2.0.12
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/integration-kit",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev Integration Kit has helpers to make creating integrations easier",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/nextjs
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/sdk@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/nextjs",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev Next.js integration",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
@@ -33,7 +33,7 @@
|
||||
"build:tsup": "tsup"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@trigger.dev/sdk": "workspace:^2.0.13",
|
||||
"@trigger.dev/sdk": "workspace:^2.0.14",
|
||||
"next": ">=12.0.0 <14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/react
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/react",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "Trigger.dev React SDK",
|
||||
"license": "MIT",
|
||||
"types": "dist/index.d.ts",
|
||||
@@ -27,7 +27,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "5.0.0-beta.2",
|
||||
"@trigger.dev/core": "workspace:^2.0.13",
|
||||
"@trigger.dev/core": "workspace:^2.0.14",
|
||||
"debug": "^4.3.4",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @trigger.dev/sdk
|
||||
|
||||
## 2.0.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies:
|
||||
- `@trigger.dev/core@2.0.14`
|
||||
|
||||
## 2.0.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@trigger.dev/sdk",
|
||||
"version": "2.0.13",
|
||||
"version": "2.0.14",
|
||||
"description": "trigger.dev Node.JS SDK",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
@@ -25,7 +25,7 @@
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trigger.dev/core": "workspace:^2.0.13",
|
||||
"@trigger.dev/core": "workspace:^2.0.14",
|
||||
"chalk": "^5.2.0",
|
||||
"cronstrue": "^2.21.0",
|
||||
"debug": "^4.3.4",
|
||||
|
||||
Generated
+20
-20
@@ -616,8 +616,8 @@ importers:
|
||||
'@octokit/types': ^9.2.3
|
||||
'@octokit/webhooks': ^10.4.0
|
||||
'@octokit/webhooks-types': ^6.10.0
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
octokit: ^2.0.14
|
||||
@@ -642,8 +642,8 @@ importers:
|
||||
|
||||
integrations/openai:
|
||||
specifiers:
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
openai: ^4.2.0
|
||||
@@ -662,8 +662,8 @@ importers:
|
||||
integrations/plain:
|
||||
specifiers:
|
||||
'@team-plain/typescript-sdk': ^2.7.0
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
rimraf: ^3.0.2
|
||||
@@ -680,8 +680,8 @@ importers:
|
||||
|
||||
integrations/resend:
|
||||
specifiers:
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
resend: ^0.9.1
|
||||
@@ -700,8 +700,8 @@ importers:
|
||||
integrations/sendgrid:
|
||||
specifiers:
|
||||
'@sendgrid/mail': ^7.7.0
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@types/node': 16.x
|
||||
rimraf: ^3.0.2
|
||||
tsup: 7.1.x
|
||||
@@ -719,7 +719,7 @@ importers:
|
||||
integrations/slack:
|
||||
specifiers:
|
||||
'@slack/web-api': ^6.8.1
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/node': '18'
|
||||
rimraf: ^3.0.2
|
||||
@@ -737,8 +737,8 @@ importers:
|
||||
|
||||
integrations/stripe:
|
||||
specifiers:
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@types/node': 16.x
|
||||
rimraf: ^3.0.2
|
||||
stripe: ^12.14.0
|
||||
@@ -761,8 +761,8 @@ importers:
|
||||
integrations/supabase:
|
||||
specifiers:
|
||||
'@supabase/supabase-js': ^2.26.0
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@types/node': 18.x
|
||||
rimraf: ^3.0.2
|
||||
supabase-management-js: ^0.1.4
|
||||
@@ -783,8 +783,8 @@ importers:
|
||||
|
||||
integrations/typeform:
|
||||
specifiers:
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/integration-kit': workspace:^2.0.14
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@typeform/api-client': ^1.8.0
|
||||
'@types/node': 16.x
|
||||
rimraf: ^3.0.2
|
||||
@@ -989,7 +989,7 @@ importers:
|
||||
packages/express:
|
||||
specifiers:
|
||||
'@remix-run/web-fetch': ^4.3.5
|
||||
'@trigger.dev/sdk': workspace:^2.0.13
|
||||
'@trigger.dev/sdk': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/debug': ^4.1.7
|
||||
'@types/express': ^4.17.13
|
||||
@@ -1058,7 +1058,7 @@ importers:
|
||||
packages/react:
|
||||
specifiers:
|
||||
'@tanstack/react-query': 5.0.0-beta.2
|
||||
'@trigger.dev/core': workspace:^2.0.13
|
||||
'@trigger.dev/core': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/debug': ^4.1.7
|
||||
'@types/react': 18.2.17
|
||||
@@ -1088,7 +1088,7 @@ importers:
|
||||
|
||||
packages/trigger-sdk:
|
||||
specifiers:
|
||||
'@trigger.dev/core': workspace:^2.0.13
|
||||
'@trigger.dev/core': workspace:^2.0.14
|
||||
'@trigger.dev/tsconfig': workspace:*
|
||||
'@types/debug': ^4.1.7
|
||||
'@types/node': '18'
|
||||
|
||||
Reference in New Issue
Block a user