@amboras-dev/authorize-net 1.1.6 → 1.2.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/index.d.mts CHANGED
@@ -95,6 +95,55 @@ interface AuthorizeNetAdapterProps {
95
95
  * "Pay now" bar. Call `registerConfirm(null)` on unmount.
96
96
  */
97
97
  registerConfirm?: (fn: (() => Promise<void>) | null) => void;
98
+ /**
99
+ * Saved-payment-method (vault) state, threaded down from the storefront's
100
+ * `useCheckout`. Optional because the checkout page has been passing it for
101
+ * longer than this contract has declared it: older storefront templates -
102
+ * and any template pinned to an earlier version of this package - render the
103
+ * adapter without it, and a required field would break their typecheck on
104
+ * upgrade. Treat `undefined` as "this storefront has no vault UI", not as
105
+ * "saving is off".
106
+ */
107
+ vault?: AuthorizeNetVaultProps;
108
+ }
109
+ /**
110
+ * Saved-payment-method state the storefront checkout threads into the adapter.
111
+ *
112
+ * Field-for-field mirror of the `vault` object on the starter-template
113
+ * storefront's `PaymentProviderComponentProps`; it is restated here for the
114
+ * same zero-storefront-dependency reason as `AuthorizeNetAdapterProps`. Any
115
+ * drift from that shape is a silently broken adapter, so the two must be
116
+ * changed together.
117
+ *
118
+ * Changing either `savePaymentMethod` or `selectedSavedMethodId` re-initializes
119
+ * the payment session - the save flag and the saved-credential binding live on
120
+ * the PSP object server-side, so the adapter cannot apply them locally.
121
+ */
122
+ interface AuthorizeNetVaultProps {
123
+ /**
124
+ * EFFECTIVE save flag - already forced to `true` by the checkout when
125
+ * `saveRequired`, so the adapter renders it rather than recomputing it.
126
+ */
127
+ savePaymentMethod: boolean;
128
+ onSavePaymentMethodChange: (v: boolean) => void;
129
+ /**
130
+ * Saving is MANDATORY for this cart (Subscribe & Save). The renewal engine
131
+ * charges the stored card off-session with no buyer present, so the adapter
132
+ * must render the consent as checked + disabled instead of as an opt-in.
133
+ * Vaulting a card without surfacing that consent is not acceptable, and the
134
+ * card networks require the cardholder to have agreed to the stored-credential
135
+ * arrangement before the first off-session charge - a silently-checked box the
136
+ * buyer never saw is exactly the disclosure failure that gets the mandate
137
+ * disputed and the transaction charged back.
138
+ */
139
+ saveRequired: boolean;
140
+ /**
141
+ * Id of the already-saved method the buyer chose, or `null` to pay with a new
142
+ * card. Non-null means nothing is being vaulted on this order, so the consent
143
+ * must not be rendered at all.
144
+ */
145
+ selectedSavedMethodId: string | null;
146
+ onSelectSavedMethod: (id: string | null) => void;
98
147
  }
99
148
  /**
100
149
  * Shape of the provider object the orchestrator-owned adapter template
@@ -115,4 +164,4 @@ interface AuthorizeNetProviderRegistryEntry {
115
164
  Component: ComponentType<AuthorizeNetAdapterProps>;
116
165
  }
117
166
 
118
- export type { AuthorizeNetAdapterProps, AuthorizeNetCurrency, AuthorizeNetEnvironment, AuthorizeNetHostedMode, AuthorizeNetPaymentStatus, AuthorizeNetPostUrl, AuthorizeNetProviderId, AuthorizeNetProviderIdPrefix, AuthorizeNetProviderRegistryEntry, AuthorizeNetSessionData, AuthorizeNetTransactionStatus };
167
+ export type { AuthorizeNetAdapterProps, AuthorizeNetCurrency, AuthorizeNetEnvironment, AuthorizeNetHostedMode, AuthorizeNetPaymentStatus, AuthorizeNetPostUrl, AuthorizeNetProviderId, AuthorizeNetProviderIdPrefix, AuthorizeNetProviderRegistryEntry, AuthorizeNetSessionData, AuthorizeNetTransactionStatus, AuthorizeNetVaultProps };
package/dist/index.d.ts CHANGED
@@ -95,6 +95,55 @@ interface AuthorizeNetAdapterProps {
95
95
  * "Pay now" bar. Call `registerConfirm(null)` on unmount.
96
96
  */
97
97
  registerConfirm?: (fn: (() => Promise<void>) | null) => void;
98
+ /**
99
+ * Saved-payment-method (vault) state, threaded down from the storefront's
100
+ * `useCheckout`. Optional because the checkout page has been passing it for
101
+ * longer than this contract has declared it: older storefront templates -
102
+ * and any template pinned to an earlier version of this package - render the
103
+ * adapter without it, and a required field would break their typecheck on
104
+ * upgrade. Treat `undefined` as "this storefront has no vault UI", not as
105
+ * "saving is off".
106
+ */
107
+ vault?: AuthorizeNetVaultProps;
108
+ }
109
+ /**
110
+ * Saved-payment-method state the storefront checkout threads into the adapter.
111
+ *
112
+ * Field-for-field mirror of the `vault` object on the starter-template
113
+ * storefront's `PaymentProviderComponentProps`; it is restated here for the
114
+ * same zero-storefront-dependency reason as `AuthorizeNetAdapterProps`. Any
115
+ * drift from that shape is a silently broken adapter, so the two must be
116
+ * changed together.
117
+ *
118
+ * Changing either `savePaymentMethod` or `selectedSavedMethodId` re-initializes
119
+ * the payment session - the save flag and the saved-credential binding live on
120
+ * the PSP object server-side, so the adapter cannot apply them locally.
121
+ */
122
+ interface AuthorizeNetVaultProps {
123
+ /**
124
+ * EFFECTIVE save flag - already forced to `true` by the checkout when
125
+ * `saveRequired`, so the adapter renders it rather than recomputing it.
126
+ */
127
+ savePaymentMethod: boolean;
128
+ onSavePaymentMethodChange: (v: boolean) => void;
129
+ /**
130
+ * Saving is MANDATORY for this cart (Subscribe & Save). The renewal engine
131
+ * charges the stored card off-session with no buyer present, so the adapter
132
+ * must render the consent as checked + disabled instead of as an opt-in.
133
+ * Vaulting a card without surfacing that consent is not acceptable, and the
134
+ * card networks require the cardholder to have agreed to the stored-credential
135
+ * arrangement before the first off-session charge - a silently-checked box the
136
+ * buyer never saw is exactly the disclosure failure that gets the mandate
137
+ * disputed and the transaction charged back.
138
+ */
139
+ saveRequired: boolean;
140
+ /**
141
+ * Id of the already-saved method the buyer chose, or `null` to pay with a new
142
+ * card. Non-null means nothing is being vaulted on this order, so the consent
143
+ * must not be rendered at all.
144
+ */
145
+ selectedSavedMethodId: string | null;
146
+ onSelectSavedMethod: (id: string | null) => void;
98
147
  }
99
148
  /**
100
149
  * Shape of the provider object the orchestrator-owned adapter template
@@ -115,4 +164,4 @@ interface AuthorizeNetProviderRegistryEntry {
115
164
  Component: ComponentType<AuthorizeNetAdapterProps>;
116
165
  }
117
166
 
118
- export type { AuthorizeNetAdapterProps, AuthorizeNetCurrency, AuthorizeNetEnvironment, AuthorizeNetHostedMode, AuthorizeNetPaymentStatus, AuthorizeNetPostUrl, AuthorizeNetProviderId, AuthorizeNetProviderIdPrefix, AuthorizeNetProviderRegistryEntry, AuthorizeNetSessionData, AuthorizeNetTransactionStatus };
167
+ export type { AuthorizeNetAdapterProps, AuthorizeNetCurrency, AuthorizeNetEnvironment, AuthorizeNetHostedMode, AuthorizeNetPaymentStatus, AuthorizeNetPostUrl, AuthorizeNetProviderId, AuthorizeNetProviderIdPrefix, AuthorizeNetProviderRegistryEntry, AuthorizeNetSessionData, AuthorizeNetTransactionStatus, AuthorizeNetVaultProps };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type {\n AuthorizeNetSessionData,\n AuthorizeNetHostedMode,\n AuthorizeNetEnvironment,\n AuthorizeNetPostUrl,\n AuthorizeNetCurrency,\n AuthorizeNetTransactionStatus,\n AuthorizeNetPaymentStatus,\n AuthorizeNetProviderIdPrefix,\n AuthorizeNetProviderId,\n AuthorizeNetAdapterProps,\n AuthorizeNetProviderRegistryEntry,\n} from './types'\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type {\n AuthorizeNetSessionData,\n AuthorizeNetHostedMode,\n AuthorizeNetEnvironment,\n AuthorizeNetPostUrl,\n AuthorizeNetCurrency,\n AuthorizeNetTransactionStatus,\n AuthorizeNetPaymentStatus,\n AuthorizeNetProviderIdPrefix,\n AuthorizeNetProviderId,\n AuthorizeNetAdapterProps,\n AuthorizeNetVaultProps,\n AuthorizeNetProviderRegistryEntry,\n} from './types'\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amboras-dev/authorize-net",
3
- "version": "1.1.6",
3
+ "version": "1.2.0",
4
4
  "description": "Authorize.Net Accept Hosted payment provider types for Amboras storefronts",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",