@amboras-dev/authorize-net 1.0.0 → 1.1.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
@@ -15,8 +15,21 @@ interface AuthorizeNetSessionData {
15
15
  post_url?: AuthorizeNetPostUrl;
16
16
  /** Accept Hosted token. Valid 15 minutes from mint; minted at redirect time. */
17
17
  token?: string;
18
- /** Only 'redirect' in T1. 'lightbox' and 'iframe' are T2. */
18
+ /**
19
+ * How the Accept Hosted form is presented. `redirect` navigates away;
20
+ * `iframe` keeps the buyer on the storefront. The provider decides, so the
21
+ * adapter must branch on this rather than assume either.
22
+ */
19
23
  mode: AuthorizeNetHostedMode;
24
+ /**
25
+ * Absolute HTTPS URL of the storefront's IFrameCommunicator relay page, which
26
+ * Accept Hosted loads in a hidden nested iframe to post its result back.
27
+ *
28
+ * Set only when `mode` is `iframe`. Authorize.Net requires the page to be
29
+ * served over HTTPS from the storefront's own origin, so a merchant whose
30
+ * storefront URL is missing or not HTTPS stays on `redirect`.
31
+ */
32
+ communicator_url?: string;
20
33
  environment: AuthorizeNetEnvironment;
21
34
  currency_code: AuthorizeNetCurrency;
22
35
  /** Two-decimal string, already converted out of Amboras minor units. */
@@ -29,11 +42,15 @@ interface AuthorizeNetSessionData {
29
42
  payment_status?: AuthorizeNetPaymentStatus;
30
43
  }
31
44
  /**
32
- * Single-member union on purpose: adding Accept Hosted's lightbox and iframe
33
- * modes in T2 is then a compile-visible widening rather than a silent string
34
- * change.
45
+ * `redirect` posts the token to Accept Hosted as a full-page navigation.
46
+ * `iframe` posts it into an inline frame so the buyer never leaves checkout;
47
+ * it additionally requires `communicator_url`.
48
+ *
49
+ * Widening this union was deliberately left compile-visible rather than typed
50
+ * as a bare string, so every consumer had to acknowledge the second mode.
51
+ * `lightbox` is still unimplemented.
35
52
  */
36
- type AuthorizeNetHostedMode = 'redirect';
53
+ type AuthorizeNetHostedMode = 'redirect' | 'iframe';
37
54
  type AuthorizeNetEnvironment = 'sandbox' | 'production';
38
55
  /**
39
56
  * Accept Hosted form targets. The pair is fixed by Authorize.Net and is
package/dist/index.d.ts CHANGED
@@ -15,8 +15,21 @@ interface AuthorizeNetSessionData {
15
15
  post_url?: AuthorizeNetPostUrl;
16
16
  /** Accept Hosted token. Valid 15 minutes from mint; minted at redirect time. */
17
17
  token?: string;
18
- /** Only 'redirect' in T1. 'lightbox' and 'iframe' are T2. */
18
+ /**
19
+ * How the Accept Hosted form is presented. `redirect` navigates away;
20
+ * `iframe` keeps the buyer on the storefront. The provider decides, so the
21
+ * adapter must branch on this rather than assume either.
22
+ */
19
23
  mode: AuthorizeNetHostedMode;
24
+ /**
25
+ * Absolute HTTPS URL of the storefront's IFrameCommunicator relay page, which
26
+ * Accept Hosted loads in a hidden nested iframe to post its result back.
27
+ *
28
+ * Set only when `mode` is `iframe`. Authorize.Net requires the page to be
29
+ * served over HTTPS from the storefront's own origin, so a merchant whose
30
+ * storefront URL is missing or not HTTPS stays on `redirect`.
31
+ */
32
+ communicator_url?: string;
20
33
  environment: AuthorizeNetEnvironment;
21
34
  currency_code: AuthorizeNetCurrency;
22
35
  /** Two-decimal string, already converted out of Amboras minor units. */
@@ -29,11 +42,15 @@ interface AuthorizeNetSessionData {
29
42
  payment_status?: AuthorizeNetPaymentStatus;
30
43
  }
31
44
  /**
32
- * Single-member union on purpose: adding Accept Hosted's lightbox and iframe
33
- * modes in T2 is then a compile-visible widening rather than a silent string
34
- * change.
45
+ * `redirect` posts the token to Accept Hosted as a full-page navigation.
46
+ * `iframe` posts it into an inline frame so the buyer never leaves checkout;
47
+ * it additionally requires `communicator_url`.
48
+ *
49
+ * Widening this union was deliberately left compile-visible rather than typed
50
+ * as a bare string, so every consumer had to acknowledge the second mode.
51
+ * `lightbox` is still unimplemented.
35
52
  */
36
- type AuthorizeNetHostedMode = 'redirect';
53
+ type AuthorizeNetHostedMode = 'redirect' | 'iframe';
37
54
  type AuthorizeNetEnvironment = 'sandbox' | 'production';
38
55
  /**
39
56
  * Accept Hosted form targets. The pair is fixed by Authorize.Net and is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amboras-dev/authorize-net",
3
- "version": "1.0.0",
3
+ "version": "1.1.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",