@payloadcms/plugin-stripe 3.18.0-canary.707517e → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/createNewInStripe.d.ts.map +1 -1
- package/dist/hooks/createNewInStripe.js +4 -5
- package/dist/hooks/createNewInStripe.js.map +1 -1
- package/dist/hooks/deleteFromStripe.d.ts.map +1 -1
- package/dist/hooks/deleteFromStripe.js +4 -5
- package/dist/hooks/deleteFromStripe.js.map +1 -1
- package/dist/hooks/syncExistingWithStripe.d.ts.map +1 -1
- package/dist/hooks/syncExistingWithStripe.js +4 -5
- package/dist/hooks/syncExistingWithStripe.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -46
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNewInStripe.d.ts","sourceRoot":"","sources":["../../src/hooks/createNewInStripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAK7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"createNewInStripe.d.ts","sourceRoot":"","sources":["../../src/hooks/createNewInStripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAK7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIrD,KAAK,4BAA4B,GAAG;IAClC,UAAU,EAAE,gBAAgB,CAAA;CAC7B,GAAG,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;AAEnE,MAAM,MAAM,oCAAoC,GAAG,CACjD,IAAI,EAAE;IACJ,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,YAAY,CAAC,EAAE,kBAAkB,CAAA;CAClC,GAAG,4BAA4B,KAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;AAE1B,eAAO,MAAM,iBAAiB,EAAE,oCA0H/B,CAAA"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { APIError } from 'payload';
|
|
2
2
|
import Stripe from 'stripe';
|
|
3
3
|
import { deepen } from '../utilities/deepen.js';
|
|
4
|
-
const stripeSecretKey = process.env.STRIPE_SECRET_KEY;
|
|
5
|
-
// api version can only be the latest, stripe recommends ts ignoring it
|
|
6
|
-
const stripe = new Stripe(stripeSecretKey || '', {
|
|
7
|
-
apiVersion: '2022-08-01'
|
|
8
|
-
});
|
|
9
4
|
export const createNewInStripe = async (args)=>{
|
|
10
5
|
const { collection, data, operation, pluginConfig, req } = args;
|
|
11
6
|
const { logs, sync } = pluginConfig || {};
|
|
@@ -35,6 +30,10 @@ export const createNewInStripe = async (args)=>{
|
|
|
35
30
|
return acc;
|
|
36
31
|
}, {});
|
|
37
32
|
syncedFields = deepen(syncedFields);
|
|
33
|
+
// api version can only be the latest, stripe recommends ts ignoring it
|
|
34
|
+
const stripe = new Stripe(pluginConfig.stripeSecretKey || '', {
|
|
35
|
+
apiVersion: '2022-08-01'
|
|
36
|
+
});
|
|
38
37
|
if (operation === 'update') {
|
|
39
38
|
if (logs) {
|
|
40
39
|
payload.logger.info(`A '${collectionSlug}' document has changed in Payload with ID: '${data?.id}', syncing with Stripe...`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/createNewInStripe.ts"],"sourcesContent":["import type { CollectionBeforeValidateHook, CollectionConfig } from 'payload'\n\nimport { APIError } from 'payload'\nimport Stripe from 'stripe'\n\nimport type { StripePluginConfig } from '../types.js'\n\nimport { deepen } from '../utilities/deepen.js'\n\
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/createNewInStripe.ts"],"sourcesContent":["import type { CollectionBeforeValidateHook, CollectionConfig } from 'payload'\n\nimport { APIError } from 'payload'\nimport Stripe from 'stripe'\n\nimport type { StripePluginConfig } from '../types.js'\n\nimport { deepen } from '../utilities/deepen.js'\n\ntype HookArgsWithCustomCollection = {\n collection: CollectionConfig\n} & Omit<Parameters<CollectionBeforeValidateHook>[0], 'collection'>\n\nexport type CollectionBeforeValidateHookWithArgs = (\n args: {\n collection?: CollectionConfig\n pluginConfig?: StripePluginConfig\n } & HookArgsWithCustomCollection,\n) => Promise<Partial<any>>\n\nexport const createNewInStripe: CollectionBeforeValidateHookWithArgs = async (args) => {\n const { collection, data, operation, pluginConfig, req } = args\n\n const { logs, sync } = pluginConfig || {}\n\n const payload = req?.payload\n\n const dataRef = data || {}\n\n if (process.env.NODE_ENV === 'test') {\n dataRef.stripeID = 'test'\n return dataRef\n }\n\n if (payload) {\n if (data?.skipSync) {\n if (logs) {\n payload.logger.info(`Bypassing collection-level hooks.`)\n }\n } else {\n // initialize as 'false' so that all Payload admin events sync to Stripe\n // then conditionally set to 'true' to for events that originate from webhooks\n // this will prevent webhook events from triggering an unnecessary sync / infinite loop\n dataRef.skipSync = false\n\n const { slug: collectionSlug } = collection || {}\n const syncConfig = sync?.find((conf) => conf.collection === collectionSlug)\n\n if (syncConfig) {\n // combine all fields of this object and match their respective values within the document\n let syncedFields = syncConfig.fields.reduce(\n (acc, field) => {\n const { fieldPath, stripeProperty } = field\n\n acc[stripeProperty] = dataRef[fieldPath]\n return acc\n },\n {} as Record<string, any>,\n )\n\n syncedFields = deepen(syncedFields)\n\n // api version can only be the latest, stripe recommends ts ignoring it\n const stripe = new Stripe(pluginConfig.stripeSecretKey || '', { apiVersion: '2022-08-01' })\n\n if (operation === 'update') {\n if (logs) {\n payload.logger.info(\n `A '${collectionSlug}' document has changed in Payload with ID: '${data?.id}', syncing with Stripe...`,\n )\n }\n\n // NOTE: the Stripe document will be created in the \"afterChange\" hook, so create a new stripe document here if no stripeID exists\n if (!dataRef.stripeID) {\n try {\n // NOTE: Typed as \"any\" because the \"create\" method is not standard across all Stripe resources\n const stripeResource = await stripe?.[syncConfig.stripeResourceType]?.create(\n // @ts-expect-error\n syncedFields,\n )\n\n if (logs) {\n payload.logger.info(\n `✅ Successfully created new '${syncConfig.stripeResourceType}' resource in Stripe with ID: '${stripeResource.id}'.`,\n )\n }\n\n dataRef.stripeID = stripeResource.id\n\n // NOTE: this is to prevent sync in the \"afterChange\" hook\n dataRef.skipSync = true\n } catch (error: unknown) {\n const msg = error instanceof Error ? error.message : error\n if (logs) {\n payload.logger.error(`- Error creating Stripe document: ${msg}`)\n }\n }\n }\n }\n\n if (operation === 'create') {\n if (logs) {\n payload.logger.info(\n `A new '${collectionSlug}' document was created in Payload with ID: '${data?.id}', syncing with Stripe...`,\n )\n }\n\n try {\n if (logs) {\n payload.logger.info(\n `- Creating new '${syncConfig.stripeResourceType}' resource in Stripe...`,\n )\n }\n\n // NOTE: Typed as \"any\" because the \"create\" method is not standard across all Stripe resources\n const stripeResource = await stripe?.[syncConfig.stripeResourceType]?.create(\n // @ts-expect-error\n syncedFields,\n )\n\n if (logs) {\n payload.logger.info(\n `✅ Successfully created new '${syncConfig.stripeResourceType}' resource in Stripe with ID: '${stripeResource.id}'.`,\n )\n }\n\n dataRef.stripeID = stripeResource.id\n\n // IMPORTANT: this is to prevent sync in the \"afterChange\" hook\n dataRef.skipSync = true\n } catch (error: unknown) {\n const msg = error instanceof Error ? error.message : error\n throw new APIError(\n `Failed to create new '${syncConfig.stripeResourceType}' resource in Stripe: ${msg}`,\n )\n }\n }\n }\n }\n }\n\n return dataRef\n}\n"],"names":["APIError","Stripe","deepen","createNewInStripe","args","collection","data","operation","pluginConfig","req","logs","sync","payload","dataRef","process","env","NODE_ENV","stripeID","skipSync","logger","info","slug","collectionSlug","syncConfig","find","conf","syncedFields","fields","reduce","acc","field","fieldPath","stripeProperty","stripe","stripeSecretKey","apiVersion","id","stripeResource","stripeResourceType","create","error","msg","Error","message"],"mappings":"AAEA,SAASA,QAAQ,QAAQ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+BAA+B,EAAED,eAAeD,EAAE,CAAC,EAAE,CAAC;wBAEvH;wBAEAvB,QAAQI,QAAQ,GAAGoB,eAAeD,EAAE;wBAEpC,+DAA+D;wBAC/DvB,QAAQK,QAAQ,GAAG;oBACrB,EAAE,OAAOsB,OAAgB;wBACvB,MAAMC,MAAMD,iBAAiBE,QAAQF,MAAMG,OAAO,GAAGH;wBACrD,MAAM,IAAIxC,SACR,CAAC,sBAAsB,EAAEuB,WAAWe,kBAAkB,CAAC,sBAAsB,EAAEG,KAAK;oBAExF;gBACF;YACF;QACF;IACF;IAEA,OAAO5B;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteFromStripe.d.ts","sourceRoot":"","sources":["../../src/hooks/deleteFromStripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAK1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"deleteFromStripe.d.ts","sourceRoot":"","sources":["../../src/hooks/deleteFromStripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAK1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD,KAAK,4BAA4B,GAAG;IAClC,UAAU,EAAE,gBAAgB,CAAA;CAC7B,GAAG,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;AAEhE,MAAM,MAAM,iCAAiC,GAAG,CAC9C,IAAI,EAAE;IACJ,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,YAAY,CAAC,EAAE,kBAAkB,CAAA;CAClC,GAAG,4BAA4B,KAC7B,OAAO,CAAC,IAAI,CAAC,CAAA;AAElB,eAAO,MAAM,gBAAgB,EAAE,iCAgD9B,CAAA"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { APIError } from 'payload';
|
|
2
2
|
import Stripe from 'stripe';
|
|
3
|
-
const stripeSecretKey = process.env.STRIPE_SECRET_KEY;
|
|
4
|
-
// api version can only be the latest, stripe recommends ts ignoring it
|
|
5
|
-
const stripe = new Stripe(stripeSecretKey || '', {
|
|
6
|
-
apiVersion: '2022-08-01'
|
|
7
|
-
});
|
|
8
3
|
export const deleteFromStripe = async (args)=>{
|
|
9
4
|
const { collection, doc, pluginConfig, req } = args;
|
|
10
5
|
const { logs, sync } = pluginConfig || {};
|
|
@@ -20,6 +15,10 @@ export const deleteFromStripe = async (args)=>{
|
|
|
20
15
|
const syncConfig = sync?.find((conf)=>conf.collection === collectionSlug);
|
|
21
16
|
if (syncConfig) {
|
|
22
17
|
try {
|
|
18
|
+
// api version can only be the latest, stripe recommends ts ignoring it
|
|
19
|
+
const stripe = new Stripe(pluginConfig.stripeSecretKey || '', {
|
|
20
|
+
apiVersion: '2022-08-01'
|
|
21
|
+
});
|
|
23
22
|
const found = await stripe?.[syncConfig.stripeResourceType]?.retrieve(doc.stripeID);
|
|
24
23
|
if (found) {
|
|
25
24
|
await stripe?.[syncConfig.stripeResourceType]?.del(doc.stripeID);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/deleteFromStripe.ts"],"sourcesContent":["import type { CollectionAfterDeleteHook, CollectionConfig } from 'payload'\n\nimport { APIError } from 'payload'\nimport Stripe from 'stripe'\n\nimport type { StripePluginConfig } from '../types.js'\n\
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/deleteFromStripe.ts"],"sourcesContent":["import type { CollectionAfterDeleteHook, CollectionConfig } from 'payload'\n\nimport { APIError } from 'payload'\nimport Stripe from 'stripe'\n\nimport type { StripePluginConfig } from '../types.js'\n\ntype HookArgsWithCustomCollection = {\n collection: CollectionConfig\n} & Omit<Parameters<CollectionAfterDeleteHook>[0], 'collection'>\n\nexport type CollectionAfterDeleteHookWithArgs = (\n args: {\n collection?: CollectionConfig\n pluginConfig?: StripePluginConfig\n } & HookArgsWithCustomCollection,\n) => Promise<void>\n\nexport const deleteFromStripe: CollectionAfterDeleteHookWithArgs = async (args) => {\n const { collection, doc, pluginConfig, req } = args\n\n const { logs, sync } = pluginConfig || {}\n\n const { payload } = req\n const { slug: collectionSlug } = collection || {}\n\n if (logs) {\n payload.logger.info(\n `Document with ID: '${doc?.id}' in collection: '${collectionSlug}' has been deleted, deleting from Stripe...`,\n )\n }\n\n if (process.env.NODE_ENV !== 'test') {\n if (logs) {\n payload.logger.info(`- Deleting Stripe document with ID: '${doc.stripeID}'...`)\n }\n\n const syncConfig = sync?.find((conf) => conf.collection === collectionSlug)\n\n if (syncConfig) {\n try {\n // api version can only be the latest, stripe recommends ts ignoring it\n const stripe = new Stripe(pluginConfig.stripeSecretKey || '', { apiVersion: '2022-08-01' })\n\n const found = await stripe?.[syncConfig.stripeResourceType]?.retrieve(doc.stripeID)\n\n if (found) {\n await stripe?.[syncConfig.stripeResourceType]?.del(doc.stripeID)\n if (logs) {\n payload.logger.info(\n `✅ Successfully deleted Stripe document with ID: '${doc.stripeID}'.`,\n )\n }\n } else {\n if (logs) {\n payload.logger.info(\n `- Stripe document with ID: '${doc.stripeID}' not found, skipping...`,\n )\n }\n }\n } catch (error: unknown) {\n const msg = error instanceof Error ? error.message : error\n throw new APIError(`Failed to delete Stripe document with ID: '${doc.stripeID}': ${msg}`)\n }\n }\n }\n}\n"],"names":["APIError","Stripe","deleteFromStripe","args","collection","doc","pluginConfig","req","logs","sync","payload","slug","collectionSlug","logger","info","id","process","env","NODE_ENV","stripeID","syncConfig","find","conf","stripe","stripeSecretKey","apiVersion","found","stripeResourceType","retrieve","del","error","msg","Error","message"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,UAAS;AAClC,OAAOC,YAAY,SAAQ;AAe3B,OAAO,MAAMC,mBAAsD,OAAOC;IACxE,MAAM,EAAEC,UAAU,E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AAMG,OAAO,GAAGH;gBACrD,MAAM,IAAI9B,SAAS,CAAC,2CAA2C,EAAEK,IAAIc,QAAQ,CAAC,GAAG,EAAEY,KAAK;YAC1F;QACF;IACF;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncExistingWithStripe.d.ts","sourceRoot":"","sources":["../../src/hooks/syncExistingWithStripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAK3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"syncExistingWithStripe.d.ts","sourceRoot":"","sources":["../../src/hooks/syncExistingWithStripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAK3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIrD,KAAK,4BAA4B,GAAG;IAClC,UAAU,EAAE,gBAAgB,CAAA;CAC7B,GAAG,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;AAEjE,MAAM,MAAM,kCAAkC,GAAG,CAC/C,IAAI,EAAE;IACJ,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,YAAY,CAAC,EAAE,kBAAkB,CAAA;CAClC,GAAG,4BAA4B,KAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;AAE1B,eAAO,MAAM,sBAAsB,EAAE,kCAwEpC,CAAA"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { APIError } from 'payload';
|
|
2
2
|
import Stripe from 'stripe';
|
|
3
3
|
import { deepen } from '../utilities/deepen.js';
|
|
4
|
-
const stripeSecretKey = process.env.STRIPE_SECRET_KEY;
|
|
5
|
-
// api version can only be the latest, stripe recommends ts ignoring it
|
|
6
|
-
const stripe = new Stripe(stripeSecretKey || '', {
|
|
7
|
-
apiVersion: '2022-08-01'
|
|
8
|
-
});
|
|
9
4
|
export const syncExistingWithStripe = async (args)=>{
|
|
10
5
|
const { collection, data, operation, originalDoc, pluginConfig, req } = args;
|
|
11
6
|
const { logs, sync } = pluginConfig || {};
|
|
@@ -35,6 +30,10 @@ export const syncExistingWithStripe = async (args)=>{
|
|
|
35
30
|
payload.logger.info(`- Syncing to Stripe resource with ID: '${data.stripeID}'...`);
|
|
36
31
|
}
|
|
37
32
|
try {
|
|
33
|
+
// api version can only be the latest, stripe recommends ts ignoring it
|
|
34
|
+
const stripe = new Stripe(pluginConfig.stripeSecretKey || '', {
|
|
35
|
+
apiVersion: '2022-08-01'
|
|
36
|
+
});
|
|
38
37
|
const stripeResource = await stripe?.[syncConfig?.stripeResourceType]?.update(data.stripeID, syncedFields);
|
|
39
38
|
if (logs) {
|
|
40
39
|
payload.logger.info(`✅ Successfully synced Stripe resource with ID: '${stripeResource.id}'.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/syncExistingWithStripe.ts"],"sourcesContent":["import type { CollectionBeforeChangeHook, CollectionConfig } from 'payload'\n\nimport { APIError } from 'payload'\nimport Stripe from 'stripe'\n\nimport type { StripePluginConfig } from '../types.js'\n\nimport { deepen } from '../utilities/deepen.js'\n\
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/syncExistingWithStripe.ts"],"sourcesContent":["import type { CollectionBeforeChangeHook, CollectionConfig } from 'payload'\n\nimport { APIError } from 'payload'\nimport Stripe from 'stripe'\n\nimport type { StripePluginConfig } from '../types.js'\n\nimport { deepen } from '../utilities/deepen.js'\n\ntype HookArgsWithCustomCollection = {\n collection: CollectionConfig\n} & Omit<Parameters<CollectionBeforeChangeHook>[0], 'collection'>\n\nexport type CollectionBeforeChangeHookWithArgs = (\n args: {\n collection?: CollectionConfig\n pluginConfig?: StripePluginConfig\n } & HookArgsWithCustomCollection,\n) => Promise<Partial<any>>\n\nexport const syncExistingWithStripe: CollectionBeforeChangeHookWithArgs = async (args) => {\n const { collection, data, operation, originalDoc, pluginConfig, req } = args\n\n const { logs, sync } = pluginConfig || {}\n\n const { payload } = req\n\n const { slug: collectionSlug } = collection || {}\n\n if (process.env.NODE_ENV !== 'test' && !data.skipSync) {\n const syncConfig = sync?.find((conf) => conf.collection === collectionSlug)\n\n if (syncConfig) {\n if (operation === 'update') {\n // combine all fields of this object and match their respective values within the document\n let syncedFields = syncConfig.fields.reduce(\n (acc, field) => {\n const { fieldPath, stripeProperty } = field\n\n acc[stripeProperty] = data[fieldPath]\n return acc\n },\n {} as Record<string, any>,\n )\n\n syncedFields = deepen(syncedFields)\n\n if (logs) {\n payload.logger.info(\n `A '${collectionSlug}' document has changed in Payload with ID: '${originalDoc?._id}', syncing with Stripe...`,\n )\n }\n\n if (!data.stripeID) {\n // NOTE: the \"beforeValidate\" hook populates this\n if (logs) {\n payload.logger.error(`- There is no Stripe ID for this document, skipping.`)\n }\n } else {\n if (logs) {\n payload.logger.info(`- Syncing to Stripe resource with ID: '${data.stripeID}'...`)\n }\n\n try {\n // api version can only be the latest, stripe recommends ts ignoring it\n const stripe = new Stripe(pluginConfig.stripeSecretKey || '', {\n apiVersion: '2022-08-01',\n })\n\n const stripeResource = await stripe?.[syncConfig?.stripeResourceType]?.update(\n data.stripeID,\n syncedFields,\n )\n\n if (logs) {\n payload.logger.info(\n `✅ Successfully synced Stripe resource with ID: '${stripeResource.id}'.`,\n )\n }\n } catch (error: unknown) {\n const msg = error instanceof Error ? error.message : error\n throw new APIError(`Failed to sync document with ID: '${data.id}' to Stripe: ${msg}`)\n }\n }\n }\n }\n }\n\n // Set back to 'false' so that all changes continue to sync to Stripe, see note in './createNewInStripe.ts'\n data.skipSync = false\n\n return data\n}\n"],"names":["APIError","Stripe","deepen","syncExistingWithStripe","args","collection","data","operation","originalDoc","pluginConfig","req","logs","sync","payload","slug","collectionSlug","process","env","NODE_ENV","skipSync","syncConfig","find","conf","syncedFields","fields","reduce","acc","field","fieldPath","stripeProperty","logger","info","_id","stripeID","error","stripe","stripeSecretKey","apiVersion","stripeResource","stripeResourceType","update","id","msg","Error","message"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,UAAS;AAClC,OAAOC,YAAY,SAAQ;AAI3B,SAASC,MAAM,QAAQ,yBAAwB;AAa/C,OAAO,MAAMC,yBAA6D,OAAOC;IAC/E,MAAM,EAAEC,UAAU,EAAEC,IAAI,EAAEC,SAAS,EAAEC,WAAW,EAAEC,YAAY,EAAEC,GAAG,EAAE,GAAGN;IAExE,MAAM,EAAEO,IAAI,EAAEC,IAAI,EAAE,GAAGH,gBAAgB,CAAC;IAExC,MAAM,EAAEI,OAAO,EAAE,GAAGH;IAEpB,MAAM,EAAEI,MAAMC,cAAc,EAAE,GAAGV,cAAc,CAAC;IAEhD,IAAIW,QAAQC,GAAG,CAACC,QAAQ,KAAK,UAAU,CAACZ,KAAKa,QAAQ,EAAE;QACrD,MAAMC,aAAaR,MAAMS,KAAK,CAACC,OAASA,KAAKjB,UAAU,KAAKU;QAE5D,IAAIK,YAAY;YACd,IAAIb,cAAc,UAAU;gBAC1B,0FAA0F;gBAC1F,IAAIgB,eAAeH,WAAWI,MAAM,CAACC,MAAM,CACzC,CAACC,KAAKC;oBACJ,MAAM,EAAEC,SAAS,EAAEC,cAAc,EAAE,GAAGF;oBAEtCD,GAAG,CAACG,eAAe,GAAGvB,IAAI,CAACsB,UAAU;oBACrC,OAAOF;gBACT,GACA,CAAC;gBAGHH,eAAerB,OAAOqB;gBAEtB,IAAIZ,MAAM;oBACRE,QAAQiB,MAAM,CAACC,IAAI,CACjB,CAAC,GAAG,EAAEhB,eAAe,4CAA4C,EAAEP,aAAawB,IAAI,yBAAyB,CAAC;gBAElH;gBAEA,IAAI,CAAC1B,KAAK2B,QAAQ,EAAE;oBAClB,iDAAiD;oBACjD,IAAItB,MAAM;wBACRE,QAAQiB,MAAM,CAACI,KAAK,CAAC,CAAC,oDAAoD,CAAC;oBAC7E;gBACF,OAAO;oBACL,IAAIvB,MAAM;wBACRE,QAAQiB,MAAM,CAACC,IAAI,CAAC,CAAC,uCAAuC,EAAEzB,KAAK2B,QAAQ,CAAC,IAAI,CAAC;oBACnF;oBAEA,IAAI;wBACF,uEAAuE;wBACvE,MAAME,SAAS,IAAIlC,OAAOQ,aAAa2B,eAAe,IAAI,IAAI;4BAC5DC,YAAY;wBACd;wBAEA,MAAMC,iBAAiB,MAAMH,QAAQ,CAACf,YAAYmB,mBAAmB,EAAEC,OACrElC,KAAK2B,QAAQ,EACbV;wBAGF,IAAIZ,MAAM;4BACRE,QAAQiB,MAAM,CAACC,IAAI,CACjB,CAAC,gDAAgD,EAAEO,eAAeG,EAAE,CAAC,EAAE,CAAC;wBAE5E;oBACF,EAAE,OAAOP,OAAgB;wBACvB,MAAMQ,MAAMR,iBAAiBS,QAAQT,MAAMU,OAAO,GAAGV;wBACrD,MAAM,IAAIlC,SAAS,CAAC,kCAAkC,EAAEM,KAAKmC,EAAE,CAAC,aAAa,EAAEC,KAAK;oBACtF;gBACF;YACF;QACF;IACF;IAEA,2GAA2G;IAC3GpC,KAAKa,QAAQ,GAAG;IAEhB,OAAOb;AACT,EAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,SAAS,CAAA;AAE/C,OAAO,KAAK,EAA+B,kBAAkB,EAAE,MAAM,YAAY,CAAA;AASjF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,eAAO,MAAM,YAAY,yBACA,kBAAkB,cAChC,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,SAAS,CAAA;AAE/C,OAAO,KAAK,EAA+B,kBAAkB,EAAE,MAAM,YAAY,CAAA;AASjF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,eAAO,MAAM,YAAY,yBACA,kBAAkB,cAChC,MAAM,KAAG,MAiGjB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -44,53 +44,48 @@ export const stripePlugin = (incomingStripeConfig)=>(config)=>{
|
|
|
44
44
|
path: '/stripe/rest'
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
for (const collection of collections){
|
|
48
|
+
const { hooks: existingHooks } = collection;
|
|
49
|
+
const syncConfig = pluginConfig.sync?.find((sync)=>sync.collection === collection.slug);
|
|
50
|
+
if (!syncConfig) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const fields = getFields({
|
|
54
|
+
collection,
|
|
55
|
+
pluginConfig,
|
|
56
|
+
syncConfig
|
|
57
|
+
});
|
|
58
|
+
collection.fields = fields;
|
|
59
|
+
if (!collection.hooks) {
|
|
60
|
+
collection.hooks = {};
|
|
61
|
+
}
|
|
62
|
+
collection.hooks.afterDelete = [
|
|
63
|
+
...existingHooks?.afterDelete || [],
|
|
64
|
+
(args)=>deleteFromStripe({
|
|
65
|
+
...args,
|
|
54
66
|
collection,
|
|
55
|
-
pluginConfig
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})
|
|
78
|
-
],
|
|
79
|
-
beforeValidate: [
|
|
80
|
-
...existingHooks?.beforeValidate || [],
|
|
81
|
-
(args)=>createNewInStripe({
|
|
82
|
-
...args,
|
|
83
|
-
collection,
|
|
84
|
-
pluginConfig
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
return collection;
|
|
91
|
-
}),
|
|
92
|
-
endpoints
|
|
93
|
-
};
|
|
67
|
+
pluginConfig
|
|
68
|
+
})
|
|
69
|
+
];
|
|
70
|
+
collection.hooks.beforeChange = [
|
|
71
|
+
...existingHooks?.beforeChange || [],
|
|
72
|
+
(args)=>syncExistingWithStripe({
|
|
73
|
+
...args,
|
|
74
|
+
collection,
|
|
75
|
+
pluginConfig
|
|
76
|
+
})
|
|
77
|
+
];
|
|
78
|
+
collection.hooks.beforeValidate = [
|
|
79
|
+
...existingHooks?.beforeValidate || [],
|
|
80
|
+
(args)=>createNewInStripe({
|
|
81
|
+
...args,
|
|
82
|
+
collection,
|
|
83
|
+
pluginConfig
|
|
84
|
+
})
|
|
85
|
+
];
|
|
86
|
+
}
|
|
87
|
+
config.endpoints = endpoints;
|
|
88
|
+
return config;
|
|
94
89
|
};
|
|
95
90
|
|
|
96
91
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config, Endpoint } from 'payload'\n\nimport type { SanitizedStripePluginConfig, StripePluginConfig } from './types.js'\n\nimport { getFields } from './fields/getFields.js'\nimport { createNewInStripe } from './hooks/createNewInStripe.js'\nimport { deleteFromStripe } from './hooks/deleteFromStripe.js'\nimport { syncExistingWithStripe } from './hooks/syncExistingWithStripe.js'\nimport { stripeREST } from './routes/rest.js'\nimport { stripeWebhooks } from './routes/webhooks.js'\n\nexport { stripeProxy } from './utilities/stripeProxy.js'\n\nexport const stripePlugin =\n (incomingStripeConfig: StripePluginConfig) =>\n (config: Config): Config => {\n const { collections } = config\n\n // set config defaults here\n const pluginConfig: SanitizedStripePluginConfig = {\n ...incomingStripeConfig,\n rest: incomingStripeConfig?.rest ?? false,\n sync: incomingStripeConfig?.sync || [],\n }\n\n // NOTE: env variables are never passed to the client, but we need to know if `stripeSecretKey` is a test key\n // unfortunately we must set the 'isTestKey' property on the config instead of using the following code:\n // const isTestKey = stripeConfig.stripeSecretKey?.startsWith('sk_test_');\n\n const endpoints: Endpoint[] = [\n ...(config?.endpoints || []),\n {\n handler: async (req) => {\n const res = await stripeWebhooks({\n config,\n pluginConfig,\n req,\n })\n\n return res\n },\n method: 'post',\n path: '/stripe/webhooks',\n },\n ]\n\n if (incomingStripeConfig?.rest) {\n endpoints.push({\n handler: async (req) => {\n const res = await stripeREST({\n pluginConfig,\n req,\n })\n\n return res\n },\n method: 'post' as Endpoint['method'],\n path: '/stripe/rest',\n })\n }\n\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config, Endpoint } from 'payload'\n\nimport type { SanitizedStripePluginConfig, StripePluginConfig } from './types.js'\n\nimport { getFields } from './fields/getFields.js'\nimport { createNewInStripe } from './hooks/createNewInStripe.js'\nimport { deleteFromStripe } from './hooks/deleteFromStripe.js'\nimport { syncExistingWithStripe } from './hooks/syncExistingWithStripe.js'\nimport { stripeREST } from './routes/rest.js'\nimport { stripeWebhooks } from './routes/webhooks.js'\n\nexport { stripeProxy } from './utilities/stripeProxy.js'\n\nexport const stripePlugin =\n (incomingStripeConfig: StripePluginConfig) =>\n (config: Config): Config => {\n const { collections } = config\n\n // set config defaults here\n const pluginConfig: SanitizedStripePluginConfig = {\n ...incomingStripeConfig,\n rest: incomingStripeConfig?.rest ?? false,\n sync: incomingStripeConfig?.sync || [],\n }\n\n // NOTE: env variables are never passed to the client, but we need to know if `stripeSecretKey` is a test key\n // unfortunately we must set the 'isTestKey' property on the config instead of using the following code:\n // const isTestKey = stripeConfig.stripeSecretKey?.startsWith('sk_test_');\n\n const endpoints: Endpoint[] = [\n ...(config?.endpoints || []),\n {\n handler: async (req) => {\n const res = await stripeWebhooks({\n config,\n pluginConfig,\n req,\n })\n\n return res\n },\n method: 'post',\n path: '/stripe/webhooks',\n },\n ]\n\n if (incomingStripeConfig?.rest) {\n endpoints.push({\n handler: async (req) => {\n const res = await stripeREST({\n pluginConfig,\n req,\n })\n\n return res\n },\n method: 'post' as Endpoint['method'],\n path: '/stripe/rest',\n })\n }\n\n for (const collection of collections) {\n const { hooks: existingHooks } = collection\n\n const syncConfig = pluginConfig.sync?.find((sync) => sync.collection === collection.slug)\n\n if (!syncConfig) {\n continue\n }\n const fields = getFields({\n collection,\n pluginConfig,\n syncConfig,\n })\n collection.fields = fields\n\n if (!collection.hooks) {\n collection.hooks = {}\n }\n\n collection.hooks.afterDelete = [\n ...(existingHooks?.afterDelete || []),\n (args) =>\n deleteFromStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ]\n collection.hooks.beforeChange = [\n ...(existingHooks?.beforeChange || []),\n (args) =>\n syncExistingWithStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ]\n collection.hooks.beforeValidate = [\n ...(existingHooks?.beforeValidate || []),\n (args) =>\n createNewInStripe({\n ...args,\n collection,\n pluginConfig,\n }),\n ]\n }\n\n config.endpoints = endpoints\n\n return config\n }\n"],"names":["getFields","createNewInStripe","deleteFromStripe","syncExistingWithStripe","stripeREST","stripeWebhooks","stripeProxy","stripePlugin","incomingStripeConfig","config","collections","pluginConfig","rest","sync","endpoints","handler","req","res","method","path","push","collection","hooks","existingHooks","syncConfig","find","slug","fields","afterDelete","args","beforeChange","beforeValidate"],"mappings":"AAIA,SAASA,SAAS,QAAQ,wBAAuB;AACjD,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,sBAAsB,QAAQ,oCAAmC;AAC1E,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,cAAc,QAAQ,uBAAsB;AAErD,SAASC,WAAW,QAAQ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ACrC,CAACD,OACC1B,uBAAuB;wBACrB,GAAG0B,IAAI;wBACPR;wBACAV;oBACF;aACH;YACDU,WAAWC,KAAK,CAACS,cAAc,GAAG;mBAC5BR,eAAeQ,kBAAkB,EAAE;gBACvC,CAACF,OACC5B,kBAAkB;wBAChB,GAAG4B,IAAI;wBACPR;wBACAV;oBACF;aACH;QACH;QAEAF,OAAOK,SAAS,GAAGA;QAEnB,OAAOL;IACT,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-stripe",
|
|
3
|
-
"version": "3.18.0
|
|
3
|
+
"version": "3.18.0",
|
|
4
4
|
"description": "Stripe plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -54,20 +54,20 @@
|
|
|
54
54
|
"lodash.get": "^4.4.2",
|
|
55
55
|
"stripe": "^10.2.0",
|
|
56
56
|
"uuid": "10.0.0",
|
|
57
|
-
"@payloadcms/translations": "3.18.0
|
|
58
|
-
"@payloadcms/ui": "3.18.0
|
|
57
|
+
"@payloadcms/translations": "3.18.0",
|
|
58
|
+
"@payloadcms/ui": "3.18.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/lodash.get": "^4.4.7",
|
|
62
62
|
"@types/react": "19.0.1",
|
|
63
63
|
"@types/react-dom": "19.0.1",
|
|
64
64
|
"@types/uuid": "10.0.0",
|
|
65
|
+
"@payloadcms/next": "3.18.0",
|
|
65
66
|
"@payloadcms/eslint-config": "3.9.0",
|
|
66
|
-
"payload": "3.18.0
|
|
67
|
-
"@payloadcms/next": "3.18.0-canary.707517e"
|
|
67
|
+
"payload": "3.18.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"payload": "3.18.0
|
|
70
|
+
"payload": "3.18.0"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"registry": "https://registry.npmjs.org/"
|