@xyo-network/rebilly-payment-card-authorization-plugin 3.2.0-rc.1 → 3.2.0-rc.2

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.
@@ -116,11 +116,11 @@ var RebillyPaymentCardAuthorizationSentinel = class extends AbstractSentinel {
116
116
  const response = await axios.post(this.tokenEndpoint, data);
117
117
  assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`);
118
118
  const { id } = response.data;
119
- const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress]);
119
+ const $sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress]);
120
120
  results.push({
121
121
  id,
122
122
  schema: RebillyPaymentAuthorizationTokenSchema,
123
- sources
123
+ $sources
124
124
  });
125
125
  } catch (error) {
126
126
  this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Sentinel.ts","../../src/util/toTokenRequest.ts"],"sourcesContent":["export const RebillyPaymentCardAuthorizationSentinelSchema = 'network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly'\nexport type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema\n","import type { RebillyApiDomainSettings } from '@xyo-network/rebilly-payment-payload-plugin'\nimport type { SentinelConfig } from '@xyo-network/sentinel-model'\n\nimport { RebillyPaymentCardAuthorizationSentinelSchema } from './Schema.ts'\n\nexport const RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`\nexport type RebillyPaymentCardAuthorizationSentinelConfigSchema = typeof RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n/*\n * The Rebilly Payment Card Authorization Sentinel Config\n */\nexport type RebillyPaymentCardAuthorizationSentinelConfig = SentinelConfig<{\n /**\n * The config schema\n */\n schema: RebillyPaymentCardAuthorizationSentinelConfigSchema\n}> &\nPartial<RebillyApiDomainSettings>\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isBillingAddress, isPaymentCard } from '@xyo-network/payment-payload-plugins'\nimport type { RebillyPaymentAuthorizationToken } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { RebillyPaymentAuthorizationTokenSchema } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { AbstractSentinel } from '@xyo-network/sentinel-abstract'\nimport type { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model'\nimport type { AxiosRequestConfig } from 'axios'\nimport { HttpStatusCode } from 'axios'\n\nimport type { CreateTokenResponse } from './Api/index.ts'\nimport { RebillyPaymentCardAuthorizationSentinelConfigSchema } from './Config.ts'\nimport type { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts'\nimport { toTokenRequest } from './util/index.ts'\n\nconst removePrefix = (str: string, prefix: string) => {\n const regex = new RegExp(`^${prefix}`)\n return str.replace(regex, '')\n}\n\nconst moduleName = 'RebillyPaymentCardAuthorizationSentinel'\nexport class RebillyPaymentCardAuthorizationSentinel<\n TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema]\n static override defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n protected _apiRoot: string | undefined = undefined\n protected _domain: string | undefined = undefined\n protected _headers: AxiosRequestConfig['headers'] | undefined = undefined\n protected _organizationId: string | undefined = undefined\n protected _publishableApiKey: string | undefined = undefined\n protected _tokenEndpoint: string | undefined = undefined\n\n /**\n * The Rebilly Organization API root endpoint\n */\n protected get apiRoot() {\n if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`\n return this._apiRoot\n }\n\n /**\n * The Rebilly domain\n */\n protected get domain() {\n if (!this._domain) this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`)\n return this._domain\n }\n\n /**\n * The headers to be included in the request for each request\n */\n protected get headers(): AxiosRequestConfig['headers'] {\n if (!this._headers) this._headers = { Authorization: this.publishableApiKey }\n return this._headers\n }\n\n /**\n * True if the environment is sandbox (testing), false otherwise\n */\n protected get isSandboxEnvironment(): boolean {\n return this.domain.includes('sandbox')\n }\n\n /**\n * The Rebilly organization ID\n */\n protected get organizationId() {\n if (!this._organizationId)\n this._organizationId = removePrefix(\n assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),\n 'org_',\n )\n return this._organizationId\n }\n\n /**\n * The Rebilly Publishable API key\n */\n protected get publishableApiKey(): string {\n if (!this._publishableApiKey)\n this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`)\n return this._publishableApiKey\n }\n\n /**\n * The Rebilly Organization token creation endpoint\n */\n protected get tokenEndpoint() {\n if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`\n return this._tokenEndpoint\n }\n\n override async reportHandler(payloads?: Payload[]): Promise<Payload[]> {\n await this.started('throw')\n const results: WithSources<RebillyPaymentAuthorizationToken>[] = []\n // Verify necessary inputs and if nothing meets our criteria, bail early\n if (!payloads || payloads.length === 0) return results\n const paymentCard = payloads?.find(isPaymentCard)\n if (!paymentCard) return results\n const billingAddress = payloads?.find(isBillingAddress)\n if (!billingAddress) return results\n const axios = new AxiosJson({ headers: this.headers })\n try {\n const data = toTokenRequest(paymentCard, billingAddress)\n const response = await axios.post<CreateTokenResponse>(this.tokenEndpoint, data)\n assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`)\n const { id } = response.data\n const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])\n results.push({\n id, schema: RebillyPaymentAuthorizationTokenSchema, sources,\n })\n } catch (error) {\n this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`)\n }\n return results\n }\n}\n","import type { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins'\n\nimport type { CreatePaymentTokenRequest } from '../Api/index.ts'\n\n/**\n * Converts a payment card and billing address to a token request\n * @param paymentCard The payment card\n * @param billingAddress The billing address\n * @returns The token request\n */\nexport const toTokenRequest = (paymentCard: PaymentCard, billingAddress: BillingAddress): CreatePaymentTokenRequest => {\n const {\n cvv, expMonth, expYear, cardNumber,\n } = paymentCard\n // NOTE: We are destructuring all but the schema and passing it along to the billingAddress. This\n // is to allow for missing fields to be omitted rather than set to undefined and for any new fields\n // that might be added later to be automatically picked up on. It is fine to pass this along since\n // the user is supplying this data about themselves.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { schema: _, ...fields } = billingAddress\n return {\n billingAddress: { ...fields },\n method: 'payment-card',\n paymentInstrument: {\n cvv, expMonth, expYear, pan: cardNumber,\n },\n }\n}\n"],"mappings":";AAAO,IAAM,gDAAgD;;;ACKtD,IAAM,sDAAsD,GAAG,6CAA6C;;;ACLnH,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB,qBAAqB;AAEhD,SAAS,8CAA8C;AACvD,SAAS,wBAAwB;AAGjC,SAAS,sBAAsB;;;ACAxB,IAAM,iBAAiB,CAAC,aAA0B,mBAA8D;AACrH,QAAM;AAAA,IACJ;AAAA,IAAK;AAAA,IAAU;AAAA,IAAS;AAAA,EAC1B,IAAI;AAMJ,QAAM,EAAE,QAAQ,GAAG,GAAG,OAAO,IAAI;AACjC,SAAO;AAAA,IACL,gBAAgB,EAAE,GAAG,OAAO;AAAA,IAC5B,QAAQ;AAAA,IACR,mBAAmB;AAAA,MACjB;AAAA,MAAK;AAAA,MAAU;AAAA,MAAS,KAAK;AAAA,IAC/B;AAAA,EACF;AACF;;;ADVA,I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qB,SAAS,KAAK,OAAO,mBAAmB,MAAM,GAAG,UAAU,uCAAuC;AAC9H,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,IAAc,gBAAgB;AAC5B,QAAI,CAAC,KAAK,eAAgB,MAAK,iBAAiB,GAAG,KAAK,OAAO;AAC/D,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAe,cAAc,UAA0C;AACrE,UAAM,KAAK,QAAQ,OAAO;AAC1B,UAAM,UAA2D,CAAC;AAElE,QAAI,CAAC,YAAY,SAAS,WAAW,EAAG,QAAO;AAC/C,UAAM,cAAc,UAAU,KAAK,aAAa;AAChD,QAAI,CAAC,YAAa,QAAO;AACzB,UAAM,iBAAiB,UAAU,KAAK,gBAAgB;AACtD,QAAI,CAAC,eAAgB,QAAO;AAC5B,UAAM,QAAQ,IAAI,UAAU,EAAE,SAAS,KAAK,QAAQ,CAAC;AACrD,QAAI;AACF,YAAM,OAAO,eAAe,aAAa,cAAc;AACvD,YAAM,WAAW,MAAM,MAAM,KAA0B,KAAK,eAAe,IAAI;AAC/E,eAAS,SAAS,WAAW,eAAe,SAAS,MAAM,oCAAoC,SAAS,MAAM,EAAE;AAChH,YAAM,EAAE,GAAG,IAAI,SAAS;AACxB,YAAM,UAAU,MAAM,eAAe,WAAW,CAAC,aAAa,cAAc,CAAC;AAC7E,cAAQ,KAAK;AAAA,QACX;AAAA,QAAI,QAAQ;AAAA,QAAwC;AAAA,MACtD,CAAC;AAAA,IACH,SAAS,OAAO;AACd,WAAK,QAAQ,QAAQ,GAAG,UAAU,mCAAmC,KAAK,EAAE;AAAA,IAC9E;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Sentinel.ts","../../src/util/toTokenRequest.ts"],"sourcesContent":["export const RebillyPaymentCardAuthorizationSentinelSchema = 'network.xyo.sentinel.payments.payment.instrument.card.authorization.rebilly'\nexport type RebillyPaymentCardAuthorizationSentinelSchema = typeof RebillyPaymentCardAuthorizationSentinelSchema\n","import type { RebillyApiDomainSettings } from '@xyo-network/rebilly-payment-payload-plugin'\nimport type { SentinelConfig } from '@xyo-network/sentinel-model'\n\nimport { RebillyPaymentCardAuthorizationSentinelSchema } from './Schema.ts'\n\nexport const RebillyPaymentCardAuthorizationSentinelConfigSchema = `${RebillyPaymentCardAuthorizationSentinelSchema}.config`\nexport type RebillyPaymentCardAuthorizationSentinelConfigSchema = typeof RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n/*\n * The Rebilly Payment Card Authorization Sentinel Config\n */\nexport type RebillyPaymentCardAuthorizationSentinelConfig = SentinelConfig<{\n /**\n * The config schema\n */\n schema: RebillyPaymentCardAuthorizationSentinelConfigSchema\n}> &\nPartial<RebillyApiDomainSettings>\n","import { assertEx } from '@xylabs/assert'\nimport { AxiosJson } from '@xylabs/axios'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isBillingAddress, isPaymentCard } from '@xyo-network/payment-payload-plugins'\nimport type { RebillyPaymentAuthorizationToken } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { RebillyPaymentAuthorizationTokenSchema } from '@xyo-network/rebilly-payment-payload-plugin'\nimport { AbstractSentinel } from '@xyo-network/sentinel-abstract'\nimport type { SentinelInstance, SentinelModuleEventData } from '@xyo-network/sentinel-model'\nimport type { AxiosRequestConfig } from 'axios'\nimport { HttpStatusCode } from 'axios'\n\nimport type { CreateTokenResponse } from './Api/index.ts'\nimport { RebillyPaymentCardAuthorizationSentinelConfigSchema } from './Config.ts'\nimport type { RebillyPaymentCardAuthorizationSentinelParams } from './Params.ts'\nimport { toTokenRequest } from './util/index.ts'\n\nconst removePrefix = (str: string, prefix: string) => {\n const regex = new RegExp(`^${prefix}`)\n return str.replace(regex, '')\n}\n\nconst moduleName = 'RebillyPaymentCardAuthorizationSentinel'\nexport class RebillyPaymentCardAuthorizationSentinel<\n TParams extends RebillyPaymentCardAuthorizationSentinelParams = RebillyPaymentCardAuthorizationSentinelParams,\n TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,\n> extends AbstractSentinel<TParams, TEventData> {\n static override configSchemas = [RebillyPaymentCardAuthorizationSentinelConfigSchema]\n static override defaultConfigSchema = RebillyPaymentCardAuthorizationSentinelConfigSchema\n\n protected _apiRoot: string | undefined = undefined\n protected _domain: string | undefined = undefined\n protected _headers: AxiosRequestConfig['headers'] | undefined = undefined\n protected _organizationId: string | undefined = undefined\n protected _publishableApiKey: string | undefined = undefined\n protected _tokenEndpoint: string | undefined = undefined\n\n /**\n * The Rebilly Organization API root endpoint\n */\n protected get apiRoot() {\n if (!this._apiRoot) this._apiRoot = `${this.domain}/organizations/${this.organizationId}`\n return this._apiRoot\n }\n\n /**\n * The Rebilly domain\n */\n protected get domain() {\n if (!this._domain) this._domain = assertEx(this.params.domain ?? this.config.domain, () => `${moduleName}: Missing domain in params/config`)\n return this._domain\n }\n\n /**\n * The headers to be included in the request for each request\n */\n protected get headers(): AxiosRequestConfig['headers'] {\n if (!this._headers) this._headers = { Authorization: this.publishableApiKey }\n return this._headers\n }\n\n /**\n * True if the environment is sandbox (testing), false otherwise\n */\n protected get isSandboxEnvironment(): boolean {\n return this.domain.includes('sandbox')\n }\n\n /**\n * The Rebilly organization ID\n */\n protected get organizationId() {\n if (!this._organizationId)\n this._organizationId = removePrefix(\n assertEx(this.params.organizationId, () => `${moduleName}: Missing organizationId in params`),\n 'org_',\n )\n return this._organizationId\n }\n\n /**\n * The Rebilly Publishable API key\n */\n protected get publishableApiKey(): string {\n if (!this._publishableApiKey)\n this._publishableApiKey = assertEx(this.params.publishableApiKey, () => `${moduleName}: Missing publishableApiKey in params`)\n return this._publishableApiKey\n }\n\n /**\n * The Rebilly Organization token creation endpoint\n */\n protected get tokenEndpoint() {\n if (!this._tokenEndpoint) this._tokenEndpoint = `${this.apiRoot}/tokens`\n return this._tokenEndpoint\n }\n\n override async reportHandler(payloads?: Payload[]): Promise<Payload[]> {\n await this.started('throw')\n const results: WithSources<RebillyPaymentAuthorizationToken>[] = []\n // Verify necessary inputs and if nothing meets our criteria, bail early\n if (!payloads || payloads.length === 0) return results\n const paymentCard = payloads?.find(isPaymentCard)\n if (!paymentCard) return results\n const billingAddress = payloads?.find(isBillingAddress)\n if (!billingAddress) return results\n const axios = new AxiosJson({ headers: this.headers })\n try {\n const data = toTokenRequest(paymentCard, billingAddress)\n const response = await axios.post<CreateTokenResponse>(this.tokenEndpoint, data)\n assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`)\n const { id } = response.data\n const $sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])\n results.push({\n id, schema: RebillyPaymentAuthorizationTokenSchema, $sources,\n })\n } catch (error) {\n this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`)\n }\n return results\n }\n}\n","import type { BillingAddress, PaymentCard } from '@xyo-network/payment-payload-plugins'\n\nimport type { CreatePaymentTokenRequest } from '../Api/index.ts'\n\n/**\n * Converts a payment card and billing address to a token request\n * @param paymentCard The payment card\n * @param billingAddress The billing address\n * @returns The token request\n */\nexport const toTokenRequest = (paymentCard: PaymentCard, billingAddress: BillingAddress): CreatePaymentTokenRequest => {\n const {\n cvv, expMonth, expYear, cardNumber,\n } = paymentCard\n // NOTE: We are destructuring all but the schema and passing it along to the billingAddress. This\n // is to allow for missing fields to be omitted rather than set to undefined and for any new fields\n // that might be added later to be automatically picked up on. It is fine to pass this along since\n // the user is supplying this data about themselves.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { schema: _, ...fields } = billingAddress\n return {\n billingAddress: { ...fields },\n method: 'payment-card',\n paymentInstrument: {\n cvv, expMonth, expYear, pan: cardNumber,\n },\n }\n}\n"],"mappings":";AAAO,IAAM,gDAAgD;;;ACKtD,IAAM,sDAAsD,GAAG,6CAA6C;;;ACLnH,SAAS,gBAAgB;AACzB,SAA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M,EAAE,GAAG,IAAI,SAAS;AACxB,YAAM,WAAW,MAAM,eAAe,WAAW,CAAC,aAAa,cAAc,CAAC;AAC9E,cAAQ,KAAK;AAAA,QACX;AAAA,QAAI,QAAQ;AAAA,QAAwC;AAAA,MACtD,CAAC;AAAA,IACH,SAAS,OAAO;AACd,WAAK,QAAQ,QAAQ,GAAG,UAAU,mCAAmC,KAAK,EAAE;AAAA,IAC9E;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/rebilly-payment-card-authorization-plugin",
3
- "version": "3.2.0-rc.1",
3
+ "version": "3.2.0-rc.2",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -29,22 +29,22 @@
29
29
  "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/assert": "^4.4.12",
33
- "@xylabs/axios": "^4.4.12",
34
- "@xyo-network/module-model": "^3.6.0-rc.1",
35
- "@xyo-network/payload-builder": "^3.6.0-rc.1",
36
- "@xyo-network/payload-model": "^3.6.0-rc.1",
37
- "@xyo-network/payment-payload-plugins": "^3.2.0-rc.1",
38
- "@xyo-network/rebilly-payment-payload-plugin": "^3.2.0-rc.1",
39
- "@xyo-network/sentinel-abstract": "^3.6.0-rc.1",
40
- "@xyo-network/sentinel-model": "^3.6.0-rc.1",
32
+ "@xylabs/assert": "^4.4.24",
33
+ "@xylabs/axios": "^4.4.24",
34
+ "@xyo-network/module-model": "^3.6.0-rc.11",
35
+ "@xyo-network/payload-builder": "^3.6.0-rc.11",
36
+ "@xyo-network/payload-model": "^3.6.0-rc.11",
37
+ "@xyo-network/payment-payload-plugins": "^3.2.0-rc.2",
38
+ "@xyo-network/rebilly-payment-payload-plugin": "^3.2.0-rc.2",
39
+ "@xyo-network/sentinel-abstract": "^3.6.0-rc.11",
40
+ "@xyo-network/sentinel-model": "^3.6.0-rc.11",
41
41
  "axios": "^1.7.9"
42
42
  },
43
43
  "devDependencies": {
44
- "@xylabs/ts-scripts-yarn3": "^4.2.4",
45
- "@xylabs/tsconfig": "^4.2.4",
46
- "@xylabs/vitest-extended": "^4.4.12",
47
- "@xyo-network/boundwitness-model": "^3.6.0-rc.1",
44
+ "@xylabs/ts-scripts-yarn3": "^4.2.6",
45
+ "@xylabs/tsconfig": "^4.2.6",
46
+ "@xylabs/vitest-extended": "^4.4.24",
47
+ "@xyo-network/boundwitness-model": "^3.6.0-rc.11",
48
48
  "typescript": "^5.7.2",
49
49
  "vitest": "^2.1.8"
50
50
  },
package/src/Sentinel.ts CHANGED
@@ -110,9 +110,9 @@ export class RebillyPaymentCardAuthorizationSentinel<
110
110
  const response = await axios.post<CreateTokenResponse>(this.tokenEndpoint, data)
111
111
  assertEx(response.status === HttpStatusCode.Created, () => `Failed to tokenize payment card: ${response.status}`)
112
112
  const { id } = response.data
113
- const sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])
113
+ const $sources = await PayloadBuilder.dataHashes([paymentCard, billingAddress])
114
114
  results.push({
115
- id, schema: RebillyPaymentAuthorizationTokenSchema, sources,
115
+ id, schema: RebillyPaymentAuthorizationTokenSchema, $sources,
116
116
  })
117
117
  } catch (error) {
118
118
  this.logger?.error?.(`${moduleName}: Error creating payment token: ${error}`)
package/xy.config.ts CHANGED
@@ -7,5 +7,4 @@ const config: XyTsupConfig = {
7
7
  },
8
8
  }
9
9
 
10
- // eslint-disable-next-line import-x/no-default-export
11
10
  export default config