@mintmoney/react 0.1.0-alpha.36 → 0.1.0-alpha.38

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.
Files changed (111) hide show
  1. package/dist/css/styles.css +45 -65
  2. package/dist/docs/card-payments.md +65 -0
  3. package/dist/docs/customisation.md +67 -0
  4. package/dist/docs/overview.md +19 -0
  5. package/dist/docs/quickstart.md +174 -0
  6. package/dist/esm/api/generated.js +1458 -2
  7. package/dist/esm/api/generated.js.map +1 -1
  8. package/dist/esm/api/payments.js +89 -4
  9. package/dist/esm/api/payments.js.map +1 -1
  10. package/dist/esm/checkout/index.js +45 -4
  11. package/dist/esm/checkout/index.js.map +1 -1
  12. package/dist/esm/checkout/launcher.js +6 -0
  13. package/dist/esm/checkout/launcher.js.map +1 -0
  14. package/dist/esm/checkout/modal.js +19 -14
  15. package/dist/esm/checkout/modal.js.map +1 -1
  16. package/dist/esm/checkout/payment-methods/providers.js +15 -0
  17. package/dist/esm/checkout/payment-methods/providers.js.map +1 -0
  18. package/dist/esm/checkout/resume-state.js +105 -0
  19. package/dist/esm/checkout/resume-state.js.map +1 -1
  20. package/dist/esm/checkout/views/amount-header.js +45 -5
  21. package/dist/esm/checkout/views/amount-header.js.map +1 -1
  22. package/dist/esm/checkout/views/card-intent/customer-details.js +108 -0
  23. package/dist/esm/checkout/views/card-intent/customer-details.js.map +1 -0
  24. package/dist/esm/checkout/views/card-intent/details.js +271 -21
  25. package/dist/esm/checkout/views/card-intent/details.js.map +1 -1
  26. package/dist/esm/checkout/views/card-intent/processing.js +42 -0
  27. package/dist/esm/checkout/views/card-intent/processing.js.map +1 -0
  28. package/dist/esm/checkout/views/card-intent/submission.js +85 -0
  29. package/dist/esm/checkout/views/card-intent/submission.js.map +1 -0
  30. package/dist/esm/checkout/views/crypto-intent/direct-details.js +49 -165
  31. package/dist/esm/checkout/views/crypto-intent/direct-details.js.map +1 -1
  32. package/dist/esm/checkout/views/crypto-intent/manual-payment-summary.js +112 -0
  33. package/dist/esm/checkout/views/crypto-intent/manual-payment-summary.js.map +1 -0
  34. package/dist/esm/checkout/views/crypto-intent/manual-refund-preference.js +69 -0
  35. package/dist/esm/checkout/views/crypto-intent/manual-refund-preference.js.map +1 -0
  36. package/dist/esm/checkout/views/crypto-intent/processing.js +15 -6
  37. package/dist/esm/checkout/views/crypto-intent/processing.js.map +1 -1
  38. package/dist/esm/checkout/views/crypto-intent/success.js +5 -1
  39. package/dist/esm/checkout/views/crypto-intent/success.js.map +1 -1
  40. package/dist/esm/checkout/views/initial.js +14 -2
  41. package/dist/esm/checkout/views/initial.js.map +1 -1
  42. package/dist/esm/checkout/views/method-select.js +1 -1
  43. package/dist/esm/checkout/views/method-select.js.map +1 -1
  44. package/dist/esm/components/inputs/index.js +25 -10
  45. package/dist/esm/components/inputs/index.js.map +1 -1
  46. package/dist/esm/components/modals/modal-with-views.js +3 -4
  47. package/dist/esm/components/modals/modal-with-views.js.map +1 -1
  48. package/dist/esm/refund/confirmation.js +30 -0
  49. package/dist/esm/refund/confirmation.js.map +1 -0
  50. package/dist/esm/refund/index.js +11 -57
  51. package/dist/esm/refund/index.js.map +1 -1
  52. package/dist/esm/refund/prepare-guard.js +1 -1
  53. package/dist/esm/refund/prepare-guard.js.map +1 -1
  54. package/dist/esm/state/checkout/store.js +81 -24
  55. package/dist/esm/state/checkout/store.js.map +1 -1
  56. package/dist/types/api/generated.d.ts +5680 -224
  57. package/dist/types/api/generated.d.ts.map +1 -1
  58. package/dist/types/api/payments.d.ts +59 -5
  59. package/dist/types/api/payments.d.ts.map +1 -1
  60. package/dist/types/checkout/index.d.ts +2 -1
  61. package/dist/types/checkout/index.d.ts.map +1 -1
  62. package/dist/types/checkout/launcher.d.ts +6 -0
  63. package/dist/types/checkout/launcher.d.ts.map +1 -0
  64. package/dist/types/checkout/modal.d.ts +1 -0
  65. package/dist/types/checkout/modal.d.ts.map +1 -1
  66. package/dist/types/checkout/payment-methods/providers.d.ts +13 -0
  67. package/dist/types/checkout/payment-methods/providers.d.ts.map +1 -0
  68. package/dist/types/checkout/resume-state.d.ts +14 -0
  69. package/dist/types/checkout/resume-state.d.ts.map +1 -1
  70. package/dist/types/checkout/views/amount-header.d.ts +1 -0
  71. package/dist/types/checkout/views/amount-header.d.ts.map +1 -1
  72. package/dist/types/checkout/views/card-intent/customer-details.d.ts +10 -0
  73. package/dist/types/checkout/views/card-intent/customer-details.d.ts.map +1 -0
  74. package/dist/types/checkout/views/card-intent/details.d.ts +3 -1
  75. package/dist/types/checkout/views/card-intent/details.d.ts.map +1 -1
  76. package/dist/types/checkout/views/card-intent/processing.d.ts +5 -0
  77. package/dist/types/checkout/views/card-intent/processing.d.ts.map +1 -0
  78. package/dist/types/checkout/views/card-intent/submission.d.ts +8 -0
  79. package/dist/types/checkout/views/card-intent/submission.d.ts.map +1 -0
  80. package/dist/types/checkout/views/crypto-intent/direct-details.d.ts +1 -1
  81. package/dist/types/checkout/views/crypto-intent/direct-details.d.ts.map +1 -1
  82. package/dist/types/checkout/views/crypto-intent/manual-payment-summary.d.ts +20 -0
  83. package/dist/types/checkout/views/crypto-intent/manual-payment-summary.d.ts.map +1 -0
  84. package/dist/types/checkout/views/crypto-intent/manual-refund-preference.d.ts +16 -0
  85. package/dist/types/checkout/views/crypto-intent/manual-refund-preference.d.ts.map +1 -0
  86. package/dist/types/checkout/views/crypto-intent/processing.d.ts +3 -0
  87. package/dist/types/checkout/views/crypto-intent/processing.d.ts.map +1 -1
  88. package/dist/types/checkout/views/crypto-intent/success.d.ts.map +1 -1
  89. package/dist/types/checkout/views/initial.d.ts.map +1 -1
  90. package/dist/types/checkout/views/method-select.d.ts.map +1 -1
  91. package/dist/types/components/inputs/index.d.ts +1 -1
  92. package/dist/types/components/inputs/index.d.ts.map +1 -1
  93. package/dist/types/components/modals/modal-with-views.d.ts +0 -1
  94. package/dist/types/components/modals/modal-with-views.d.ts.map +1 -1
  95. package/dist/types/components/wallet-selector/wallets/wagmi/index.d.ts +1 -1
  96. package/dist/types/refund/confirmation.d.ts +14 -0
  97. package/dist/types/refund/confirmation.d.ts.map +1 -0
  98. package/dist/types/refund/index.d.ts.map +1 -1
  99. package/dist/types/refund/prepare-guard.d.ts +1 -0
  100. package/dist/types/refund/prepare-guard.d.ts.map +1 -1
  101. package/dist/types/state/checkout/store.d.ts +6 -4
  102. package/dist/types/state/checkout/store.d.ts.map +1 -1
  103. package/package.json +11 -8
  104. package/dist/esm/checkout/views/fiat-intent/bank-payment.js +0 -35
  105. package/dist/esm/checkout/views/fiat-intent/bank-payment.js.map +0 -1
  106. package/dist/esm/refund/prepare-signing.js +0 -29
  107. package/dist/esm/refund/prepare-signing.js.map +0 -1
  108. package/dist/types/checkout/views/fiat-intent/bank-payment.d.ts +0 -2
  109. package/dist/types/checkout/views/fiat-intent/bank-payment.d.ts.map +0 -1
  110. package/dist/types/refund/prepare-signing.d.ts +0 -17
  111. package/dist/types/refund/prepare-signing.d.ts.map +0 -1
@@ -31,12 +31,52 @@ const Instructions = styled.p `
31
31
  line-height: 1.5;
32
32
  font-weight: 400;
33
33
  `;
34
- export const CheckoutAmountHeader = ({ amount, currency, instructions, }) => {
34
+ const CompactHeader = styled.div `
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: space-between;
38
+ gap: 16px;
39
+ margin-bottom: 1rem;
40
+ padding-bottom: 1rem;
41
+ border-bottom: 1px solid #e0e0e0;
42
+ font-family: var(--mm-font-family);
43
+ `;
44
+ const CompactValue = styled.span `
45
+ display: block;
46
+ margin-top: 4px;
47
+ color: #172033;
48
+ font-size: 20px;
49
+ font-weight: 800;
50
+ letter-spacing: -0.02em;
51
+ `;
52
+ const SecureBadge = styled.span `
53
+ display: inline-flex;
54
+ align-items: center;
55
+ gap: 7px;
56
+ color: #526078;
57
+ font-size: 12px;
58
+ font-weight: 600;
59
+ white-space: nowrap;
60
+
61
+ &::before {
62
+ content: "";
63
+ width: 7px;
64
+ height: 7px;
65
+ border-radius: 50%;
66
+ background: #31c8aa;
67
+ box-shadow: 0 0 0 4px rgba(49, 200, 170, 0.13);
68
+ }
69
+ `;
70
+ export const CheckoutAmountHeader = ({ amount, currency, instructions, compact = false, }) => {
35
71
  const { currentView } = useModalWithView();
36
72
  const isSmall = !["initial", "methods"].includes(currentView);
37
- return (_jsxs(HeaderContainer, { children: [_jsx(Label, { children: "Amount" }), _jsxs(Value, { "$isSmall": isSmall, children: [amount.toLocaleString(undefined, {
38
- minimumFractionDigits: 2,
39
- maximumFractionDigits: 2,
40
- }), " ", currency] }), instructions && _jsx(Instructions, { children: instructions })] }));
73
+ const formattedAmount = amount.toLocaleString(undefined, {
74
+ minimumFractionDigits: 2,
75
+ maximumFractionDigits: 2,
76
+ });
77
+ if (compact) {
78
+ return (_jsxs(CompactHeader, { children: [_jsxs("div", { children: [_jsx(Label, { children: "Total" }), _jsxs(CompactValue, { children: [formattedAmount, " ", currency] })] }), _jsx(SecureBadge, { children: instructions || "Secure payment" })] }));
79
+ }
80
+ return (_jsxs(HeaderContainer, { children: [_jsx(Label, { children: "Amount" }), _jsxs(Value, { "$isSmall": isSmall, children: [formattedAmount, " ", currency] }), instructions && _jsx(Instructions, { children: instructions })] }));
41
81
  };
42
82
  //# sourceMappingURL=amount-header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"amount-header.js","sourceRoot":"","sources":["../../../../src/checkout/views/amount-header.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAQnF,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQjC,CAAC;AAEF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;CAMxB,CAAC;AAEF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAuB;;;;eAIjC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CA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,CAAC,CAAC,CAAA;;;;;;CAM5B,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;CAS/B,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;CAO/B,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;CAiB9B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CAAC,EACxE,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,OAAO,GAAG,KAAK,GAChB,EAAE,EAAE;IACH,MAAM,EAAE,WAAW,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC3C,MAAM,OAAO,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE;QACvD,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,EAAE,CAAC;KACzB,CAAC,CAAC;IAEH,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,MAAC,aAAa,eACZ,0BACE,KAAC,KAAK,wBAAc,EACpB,MAAC,YAAY,eACV,eAAe,OAAG,QAAQ,IACd,IACX,EACN,KAAC,WAAW,cAAE,YAAY,IAAI,gBAAgB,GAAe,IAC/C,CACjB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,eAAe,eACd,KAAC,KAAK,yBAAe,EACrB,MAAC,KAAK,gBAAW,OAAO,aACrB,eAAe,OAAG,QAAQ,IACrB,EACP,YAAY,IAAI,KAAC,YAAY,cAAE,YAAY,GAAgB,IAC5C,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,108 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { styled } from "styled-components";
3
+ import { Input } from "../../../components/inputs/index.js";
4
+ const FormHeading = styled.div `
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 4px;
8
+ color: #172033;
9
+ font-family: var(--mm-font-family);
10
+
11
+ strong {
12
+ font-size: 17px;
13
+ line-height: 24px;
14
+ letter-spacing: -0.01em;
15
+ }
16
+
17
+ span {
18
+ color: #6b778c;
19
+ font-size: 13px;
20
+ line-height: 20px;
21
+ }
22
+ `;
23
+ const FormSection = styled.div `
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: 10px;
27
+ padding-top: 8px;
28
+ border-top: 1px solid #e5eaf1;
29
+ `;
30
+ const Field = styled.div `
31
+ display: flex;
32
+ flex-direction: column;
33
+ gap: 8px;
34
+ font-family: var(--mm-font-family);
35
+ `;
36
+ const FieldLabel = styled.label `
37
+ color: #344054;
38
+ font-family: var(--mm-font-family);
39
+ font-size: 13px;
40
+ font-weight: 700;
41
+ line-height: 18px;
42
+ `;
43
+ const FieldGrid = styled.div `
44
+ display: grid;
45
+ grid-template-columns: minmax(164px, 0.75fr) minmax(0, 1.25fr);
46
+ gap: 10px;
47
+
48
+ ${FieldLabel} {
49
+ white-space: nowrap;
50
+ }
51
+
52
+ @media (max-width: 440px) {
53
+ grid-template-columns: 1fr;
54
+ }
55
+ `;
56
+ const ShippingGrid = styled.div `
57
+ display: grid;
58
+ grid-template-columns: repeat(2, minmax(0, 1fr));
59
+ gap: 10px;
60
+
61
+ @media (max-width: 440px) {
62
+ grid-template-columns: 1fr;
63
+ }
64
+ `;
65
+ const SandboxDetailsButton = styled.button `
66
+ align-self: flex-start;
67
+ padding: 0;
68
+ border: 0;
69
+ background: transparent;
70
+ color: #526078;
71
+ cursor: pointer;
72
+ font-family: var(--mm-font-family);
73
+ font-size: 13px;
74
+ font-weight: 700;
75
+ line-height: 20px;
76
+
77
+ &:hover {
78
+ color: #172033;
79
+ text-decoration: underline;
80
+ text-underline-offset: 3px;
81
+ }
82
+
83
+ &:focus-visible {
84
+ outline: 2px solid #31c8aa;
85
+ outline-offset: 3px;
86
+ border-radius: 4px;
87
+ }
88
+ `;
89
+ const SANDBOX_CUSTOMER_DETAILS = {
90
+ phoneCountryCode: "+1",
91
+ phone: "415 555 0136",
92
+ shipping: {
93
+ street1: "123 Market Street",
94
+ city: "San Francisco",
95
+ state: "CA",
96
+ postcode: "94105",
97
+ country: "US",
98
+ },
99
+ };
100
+ export function ContactAndShippingFields({ disabled, onChange, showSandboxDetails, value, }) {
101
+ const updatePhone = (field, nextValue) => onChange({ ...value, [field]: nextValue });
102
+ const updateShipping = (field, nextValue) => onChange({
103
+ ...value,
104
+ shipping: { ...value.shipping, [field]: nextValue },
105
+ });
106
+ return (_jsxs(FormSection, { children: [_jsxs(FormHeading, { children: [_jsx("strong", { children: "Contact and shipping" }), _jsx("span", { children: "Required by the card provider for verification." })] }), showSandboxDetails && (_jsx(SandboxDetailsButton, { disabled: disabled, onClick: () => onChange(SANDBOX_CUSTOMER_DETAILS), type: "button", children: "Use sandbox details" })), _jsxs(FieldGrid, { children: [_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "mm-card-phone-country-code", children: "Phone country code" }), _jsx(Input, { "aria-label": "Phone country code", autoComplete: "tel-country-code", disabled: disabled, id: "mm-card-phone-country-code", inputMode: "tel", onChange: (event) => updatePhone("phoneCountryCode", event.target.value), placeholder: "+1", value: value.phoneCountryCode })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "mm-card-phone-number", children: "Phone number" }), _jsx(Input, { "aria-label": "Phone number", autoComplete: "tel-national", disabled: disabled, id: "mm-card-phone-number", inputMode: "tel", onChange: (event) => updatePhone("phone", event.target.value), placeholder: "555 123 4567", value: value.phone })] })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "mm-card-street-address", children: "Street address" }), _jsx(Input, { "aria-label": "Street address", autoComplete: "shipping street-address", disabled: disabled, id: "mm-card-street-address", onChange: (event) => updateShipping("street1", event.target.value), placeholder: "123 Market Street", value: value.shipping.street1 })] }), _jsxs(ShippingGrid, { children: [_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "mm-card-city", children: "City" }), _jsx(Input, { "aria-label": "City", autoComplete: "shipping address-level2", disabled: disabled, id: "mm-card-city", onChange: (event) => updateShipping("city", event.target.value), placeholder: "San Francisco", value: value.shipping.city })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "mm-card-state", children: "State or region" }), _jsx(Input, { "aria-label": "State or region", autoComplete: "shipping address-level1", disabled: disabled, id: "mm-card-state", onChange: (event) => updateShipping("state", event.target.value), placeholder: "CA", value: value.shipping.state })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "mm-card-postal-code", children: "Postal code" }), _jsx(Input, { "aria-label": "Postal code", autoComplete: "shipping postal-code", disabled: disabled, id: "mm-card-postal-code", onChange: (event) => updateShipping("postcode", event.target.value), placeholder: "94105", value: value.shipping.postcode })] }), _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "mm-card-shipping-country-code", children: "Country code" }), _jsx(Input, { "aria-label": "Shipping country code", autoComplete: "shipping country", disabled: disabled, id: "mm-card-shipping-country-code", maxLength: 2, onChange: (event) => updateShipping("country", event.target.value.toUpperCase()), placeholder: "US", value: value.shipping.country })] })] })] }));
107
+ }
108
+ //# sourceMappingURL=customer-details.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer-details.js","sourceRoot":"","sources":["../../../../../src/checkout/views/card-intent/customer-details.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAW5D,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;CAkB7B,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAM7B,CAAC;AAEF,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKvB,CAAC;AAEF,MAAM,UAAU,GAAG,MAAM,CAA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ClB,EAAE,EAAC,+BAA+B,EAClC,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,cAAc,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,EAE7D,WAAW,EAAC,IAAI,EAChB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,GAC7B,IACI,IACK,IACH,CACf,CAAC;AACJ,CAAC"}
@@ -1,36 +1,286 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
2
+ import { Card, EvervaultProvider, themes, } from "@evervault/react";
3
+ import { useCallback, useEffect, useRef, useState, } from "react";
4
+ import { styled } from "styled-components";
5
+ import { isNonterminalFiatPaymentAttempt } from "../../../api/payments.js";
6
+ import { Button, Loader, Text } from "../../../components/index.js";
7
+ import { Input } from "../../../components/inputs/index.js";
3
8
  import { useModalWithView } from "../../../components/modals/use-modal-with-views.js";
4
- import { InstaXchangePayment } from "../../../integrations/instaxchange.js";
5
- import { useCheckoutStore, createCheckoutFiatPaymentAttempt, ACTIONS, } from "../../../state/checkout/store.js";
9
+ import { useMintMoneyConfig } from "../../../context.js";
10
+ import { useCheckoutStore, createCheckoutFiatPaymentAttempt, refreshCheckoutFiatPaymentAttempt, ACTIONS, } from "../../../state/checkout/store.js";
6
11
  import { ModalViewContainer } from "../../container.js";
7
- const CardIntentViewContent = () => {
8
- const { payment, checkout, fiatPaymentAttempt, error: storeError, loading, } = useCheckoutStore();
12
+ import { writeFiatPaymentReturnState } from "../../resume-state.js";
13
+ import { ModalBackButton } from "../back.js";
14
+ import { ContactAndShippingFields } from "./customer-details.js";
15
+ import { buildFiatCardSubmission, createFiatAttemptIdempotencyKey, EMPTY_CARD_CUSTOMER_DETAILS, getThreeDSReturnUrl, } from "./submission.js";
16
+ const Form = styled.form `
17
+ width: min(100%, 500px);
18
+ margin: 0 auto;
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: 12px;
22
+ `;
23
+ const CardFormArea = styled.div `
24
+ position: relative;
25
+ min-height: 208px;
26
+ `;
27
+ const FormContent = styled(Form) `
28
+ opacity: ${({ $isReady }) => ($isReady ? 1 : 0)};
29
+ pointer-events: ${({ $isReady }) => ($isReady ? "auto" : "none")};
30
+ position: ${({ $isReady }) => ($isReady ? "static" : "absolute")};
31
+ inset: 0;
32
+ visibility: ${({ $isReady }) => ($isReady ? "visible" : "hidden")};
33
+ transition: opacity 160ms ease-out;
34
+ `;
35
+ const LoadingOverlay = styled.div `
36
+ position: absolute;
37
+ inset: 0;
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ `;
42
+ const FormHeading = styled.div `
43
+ display: flex;
44
+ flex-direction: column;
45
+ gap: 4px;
46
+ color: #172033;
47
+ font-family: var(--mm-font-family);
48
+
49
+ strong {
50
+ font-size: 17px;
51
+ line-height: 24px;
52
+ letter-spacing: -0.01em;
53
+ }
54
+
55
+ span {
56
+ color: #6b778c;
57
+ font-size: 13px;
58
+ line-height: 20px;
59
+ }
60
+ `;
61
+ const Field = styled.div `
62
+ display: flex;
63
+ flex-direction: column;
64
+ gap: 8px;
65
+ font-family: var(--mm-font-family);
66
+ `;
67
+ const FieldLabel = styled.label `
68
+ color: #344054;
69
+ font-family: var(--mm-font-family);
70
+ font-size: 13px;
71
+ font-weight: 700;
72
+ line-height: 18px;
73
+ `;
74
+ const CardFrame = styled.div `
75
+ --mm-card-frame-height: ${({ $hasValidationErrors }) => $hasValidationErrors ? "264px" : "216px"};
76
+ min-height: var(--mm-card-frame-height);
77
+ `;
78
+ const StatusPanel = styled.div `
79
+ min-height: 220px;
80
+ display: flex;
81
+ flex-direction: column;
82
+ align-items: center;
83
+ justify-content: center;
84
+ gap: 12px;
85
+ text-align: center;
86
+ `;
87
+ const ErrorText = styled(Text) `
88
+ color: #b42318;
89
+ `;
90
+ const PROVIDER_CONFIRMATION_TIMEOUT_MS = 30_000;
91
+ const CARD_FIELDS = ["name", "number", "expiry", "cvc"];
92
+ const CARD_AUTO_COMPLETE = {
93
+ name: true,
94
+ number: true,
95
+ expiry: true,
96
+ cvc: true,
97
+ };
98
+ const CARD_THEME = themes.clean();
99
+ const CardIntentViewContent = ({ resumeKey }) => {
100
+ const { payment, checkout, fiatPaymentAttempt, cardCollectionConfig, error: storeError, loading, } = useCheckoutStore();
101
+ const config = useMintMoneyConfig();
9
102
  const { goToView } = useModalWithView();
10
- const [initialized, setInitialized] = useState(false);
103
+ const idempotencyKey = useRef(createFiatAttemptIdempotencyKey());
104
+ const [cardPayload, setCardPayload] = useState(null);
105
+ const [email, setEmail] = useState("");
106
+ const [customerDetails, setCustomerDetails] = useState(EMPTY_CARD_CUSTOMER_DETAILS);
107
+ const [providerError, setProviderError] = useState(null);
108
+ const [isCardReady, setIsCardReady] = useState(false);
109
+ const [providerTimedOut, setProviderTimedOut] = useState(false);
110
+ const terminalFailureRefreshes = useRef(new Set());
111
+ const handleCardReady = useCallback(() => {
112
+ setProviderError(null);
113
+ setIsCardReady(true);
114
+ }, []);
115
+ const handleCardError = useCallback(() => {
116
+ setProviderError("Secure card collection is unavailable.");
117
+ setIsCardReady(true);
118
+ }, []);
119
+ const handleCardLoadError = useCallback(() => {
120
+ setProviderError("Secure card collection failed to load.");
121
+ setIsCardReady(true);
122
+ }, []);
123
+ useEffect(() => {
124
+ setIsCardReady(false);
125
+ }, [cardCollectionConfig?.appId, cardCollectionConfig?.teamId]);
126
+ useEffect(() => {
127
+ setProviderTimedOut(false);
128
+ }, [fiatPaymentAttempt?.attempt_id, fiatPaymentAttempt?.status]);
129
+ useEffect(() => {
130
+ const action = fiatPaymentAttempt?.next_action;
131
+ if (!action || action.type !== "three_ds_redirect")
132
+ return;
133
+ if (payment) {
134
+ writeFiatPaymentReturnState({
135
+ attemptId: fiatPaymentAttempt.attempt_id,
136
+ paymentId: payment.id,
137
+ ownerKey: resumeKey,
138
+ location: window.location,
139
+ });
140
+ }
141
+ const redirect = action.redirect;
142
+ let redirectUrl;
143
+ try {
144
+ redirectUrl = new URL(redirect.url);
145
+ }
146
+ catch {
147
+ setProviderError("Card verification returned an invalid redirect.");
148
+ return;
149
+ }
150
+ if (redirectUrl.protocol !== "https:") {
151
+ setProviderError("Card verification returned an unsafe redirect.");
152
+ return;
153
+ }
154
+ if (redirect.method === "GET") {
155
+ window.location.assign(redirectUrl.toString());
156
+ return;
157
+ }
158
+ const form = document.createElement("form");
159
+ form.method = "POST";
160
+ form.action = redirectUrl.toString();
161
+ form.style.display = "none";
162
+ for (const parameter of redirect.parameters) {
163
+ const input = document.createElement("input");
164
+ input.type = "hidden";
165
+ input.name = parameter.name;
166
+ input.value = parameter.value;
167
+ form.appendChild(input);
168
+ }
169
+ document.body.appendChild(form);
170
+ form.submit();
171
+ }, [
172
+ fiatPaymentAttempt?.attempt_id,
173
+ fiatPaymentAttempt?.next_action,
174
+ payment,
175
+ resumeKey,
176
+ ]);
177
+ useEffect(() => {
178
+ if (!payment || !checkout || !cardCollectionConfig) {
179
+ goToView("failed", { reason: "Card payment is not available" });
180
+ }
181
+ }, [payment, checkout, cardCollectionConfig, goToView]);
11
182
  useEffect(() => {
12
- if (!payment || !checkout) {
13
- goToView("failed", { reason: "Payment or checkout not found" });
183
+ if (!fiatPaymentAttempt)
184
+ return;
185
+ if (fiatPaymentAttempt.status === "settled") {
186
+ goToView("paymentSuccess");
187
+ }
188
+ else if (fiatPaymentAttempt.status === "settlement_pending") {
189
+ goToView("cardPaymentStatus");
190
+ }
191
+ else if (fiatPaymentAttempt.status === "failed" ||
192
+ fiatPaymentAttempt.status === "cancelled" ||
193
+ fiatPaymentAttempt.status === "financial_exception") {
194
+ if (fiatPaymentAttempt.status === "failed" &&
195
+ fiatPaymentAttempt.failure === "Card payment failed" &&
196
+ !terminalFailureRefreshes.current.has(fiatPaymentAttempt.attempt_id)) {
197
+ terminalFailureRefreshes.current.add(fiatPaymentAttempt.attempt_id);
198
+ void refreshCheckoutFiatPaymentAttempt().catch(() => undefined);
199
+ return;
200
+ }
201
+ goToView("failed", {
202
+ reason: fiatPaymentAttempt.failure ?? "Card payment was not completed",
203
+ });
14
204
  }
15
- }, [payment, checkout, goToView]);
205
+ }, [fiatPaymentAttempt, goToView]);
16
206
  useEffect(() => {
17
- if (!initialized && payment) {
18
- setInitialized(true);
19
- void createCheckoutFiatPaymentAttempt("card");
207
+ if (!fiatPaymentAttempt ||
208
+ !isNonterminalFiatPaymentAttempt(fiatPaymentAttempt)) {
209
+ return undefined;
20
210
  }
21
- }, [initialized, payment]);
211
+ let active = true;
212
+ let refreshing = false;
213
+ const refresh = async () => {
214
+ if (refreshing)
215
+ return;
216
+ refreshing = true;
217
+ try {
218
+ await refreshCheckoutFiatPaymentAttempt();
219
+ }
220
+ catch {
221
+ if (active)
222
+ setProviderError("Unable to refresh card payment status.");
223
+ }
224
+ finally {
225
+ refreshing = false;
226
+ }
227
+ };
228
+ const interval = setInterval(() => void refresh(), 2_000);
229
+ return () => {
230
+ active = false;
231
+ clearInterval(interval);
232
+ };
233
+ }, [fiatPaymentAttempt?.attempt_id, fiatPaymentAttempt?.status]);
22
234
  useEffect(() => {
23
- if (storeError && storeError.CREATE_FIAT_PAYMENT_ATTEMPT) {
24
- goToView("failed", { reason: storeError.CREATE_FIAT_PAYMENT_ATTEMPT });
235
+ if (!fiatPaymentAttempt ||
236
+ !isNonterminalFiatPaymentAttempt(fiatPaymentAttempt)) {
237
+ return undefined;
25
238
  }
26
- }, [storeError, goToView]);
27
- if (!payment || !checkout) {
239
+ const timeout = setTimeout(() => {
240
+ setProviderTimedOut(true);
241
+ }, PROVIDER_CONFIRMATION_TIMEOUT_MS);
242
+ return () => clearTimeout(timeout);
243
+ }, [fiatPaymentAttempt?.attempt_id, fiatPaymentAttempt?.status]);
244
+ if (!payment || !checkout || !cardCollectionConfig)
28
245
  return null;
246
+ const createError = storeError[ACTIONS.CREATE_FIAT_PAYMENT_ATTEMPT];
247
+ const isCreating = loading[ACTIONS.CREATE_FIAT_PAYMENT_ATTEMPT];
248
+ const formattedAmount = payment.amount.toLocaleString(undefined, {
249
+ minimumFractionDigits: 2,
250
+ maximumFractionDigits: 2,
251
+ });
252
+ const threeDSReturnUrl = typeof window === "undefined" ? "" : getThreeDSReturnUrl(window.location);
253
+ const canUseSandboxDetails = typeof window !== "undefined" &&
254
+ window.location.hostname.endsWith(".local.getmint.money");
255
+ const submitCard = async (event) => {
256
+ event.preventDefault();
257
+ setProviderError(null);
258
+ const submission = buildFiatCardSubmission(cardPayload, email, customerDetails, threeDSReturnUrl);
259
+ if (!submission) {
260
+ setProviderError("Complete the card, contact, and shipping details.");
261
+ return;
262
+ }
263
+ try {
264
+ await createCheckoutFiatPaymentAttempt(submission, idempotencyKey.current);
265
+ setCardPayload(null);
266
+ }
267
+ catch {
268
+ // The store exposes a redacted API error for display.
269
+ }
270
+ };
271
+ if (fiatPaymentAttempt) {
272
+ return (_jsx(ModalViewContainer, { children: _jsxs(StatusPanel, { "aria-live": "polite", children: [!providerTimedOut && _jsx(Loader, { asChild: true }), _jsx(Text, { size: "lg", weight: "semibold", children: fiatPaymentAttempt.next_action
273
+ ? "Opening card verification"
274
+ : providerTimedOut
275
+ ? "Card payment confirmation timed out"
276
+ : "Processing card payment" }), _jsx(Text, { size: "sm", color: config.theme.font.color.secondary, children: fiatPaymentAttempt.next_action
277
+ ? "Continue the secure card verification in the window that just opened."
278
+ : providerTimedOut
279
+ ? "We did not receive confirmation from the card provider. No payment has been marked as completed."
280
+ : "Keep this window open while the card provider confirms your payment." }), providerError && (_jsx(ErrorText, { size: "sm", role: "alert", children: providerError }))] }) }));
29
281
  }
30
- if (loading[ACTIONS.CREATE_FIAT_PAYMENT_ATTEMPT] || !fiatPaymentAttempt) {
31
- return (_jsx(ModalViewContainer, { children: _jsxs("div", { className: "text-center py-8", children: [_jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 mx-auto" }), _jsx("p", { className: "mt-2", children: "Initializing payment..." })] }) }));
32
- }
33
- return (_jsx(ModalViewContainer, { children: _jsx(InstaXchangePayment, { onError: () => { }, clientParams: fiatPaymentAttempt.client_params }) }));
282
+ return (_jsx(ModalViewContainer, { children: _jsx(EvervaultProvider, { appId: cardCollectionConfig.appId, onLoadError: handleCardLoadError, teamId: cardCollectionConfig.teamId, children: _jsxs(CardFormArea, { "data-card-form-loading": !isCardReady, children: [!isCardReady && (_jsx(LoadingOverlay, { "aria-label": "Loading secure card fields", role: "status", children: _jsx(Loader, { asChild: true }) })), _jsxs(FormContent, { "$isReady": isCardReady, onSubmit: (event) => void submitCard(event), children: [_jsxs(FormHeading, { children: [_jsx("strong", { children: "Card details" }), _jsx("span", { children: "Use the cardholder\u2019s first and last name exactly as shown on the card." })] }), _jsx(CardFrame, { "$hasValidationErrors": Boolean(cardPayload?.errors && Object.keys(cardPayload.errors).length), className: "mm-card-frame", children: _jsx(Card, { autoComplete: CARD_AUTO_COMPLETE, autoProgress: true, fields: CARD_FIELDS, onChange: setCardPayload, onComplete: setCardPayload, onError: handleCardError, onReady: handleCardReady, redactCVC: true, theme: CARD_THEME }) }), _jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: "mm-card-email", children: "Email receipt" }), _jsx(Input, { "aria-label": "Billing email", autoComplete: "email", disabled: isCreating, id: "mm-card-email", onChange: (event) => setEmail(event.target.value), placeholder: "you@example.com", type: "email", value: email })] }), _jsx(ContactAndShippingFields, { disabled: isCreating, onChange: setCustomerDetails, showSandboxDetails: canUseSandboxDetails, value: customerDetails }), (providerError || createError) && (_jsx(ErrorText, { size: "sm", role: "alert", children: providerError || createError })), _jsxs(Button, { disabled: isCreating ||
283
+ !buildFiatCardSubmission(cardPayload, email, customerDetails, threeDSReturnUrl), loading: isCreating, children: ["Pay ", formattedAmount, " ", payment.currency] }), _jsx(ModalBackButton, { view: "methods" })] })] }) }) }));
34
284
  };
35
285
  export { CardIntentViewContent };
36
286
  //# sourceMappingURL=details.js.map
@@ -1 +1 @@
1
- {"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EAAE,KAAK,GACZ,IACI,EACR,KAAC,wBAAwB,IACvB,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,kBAAkB,EAC5B,kBAAkB,EAAE,oBAAoB,EACxC,KAAK,EAAE,eAAe,GACtB,EACD,CAAC,aAAa,IAAI,WAAW,CAAC,IAAI,CACjC,KAAC,SAAS,IAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,YAC9B,aAAa,IAAI,WAAW,GACnB,CACb,EACD,MAAC,MAAM,IACL,QAAQ,EACN,UAAU;oCACV,CAAC,uBAAuB,CACtB,WAAW,EACX,KAAK,EACL,eAAe,EACf,gBAAgB,CACjB,EAEH,OAAO,EAAE,UAAU,qBAEd,eAAe,OAAG,OAAO,CAAC,QAAQ,IAChC,EACT,KAAC,eAAe,IAAC,IAAI,EAAC,SAAS,GAAG,IACtB,IACD,GACG,GACD,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { styled } from "styled-components";
4
+ import { PaymentStatus } from "../../../api/types.js";
5
+ import { Loader, Text, useModalWithView } from "../../../components/index.js";
6
+ import { useMintMoneyConfig } from "../../../context.js";
7
+ import { startPaymentPolling, stopPaymentPolling, useCheckoutStore, } from "../../../state/checkout/store.js";
8
+ import { ModalViewContainer } from "../../container.js";
9
+ export const CARD_PAYMENT_CONFIRMATION_STATUS = PaymentStatus.PAID;
10
+ const StatusPanel = styled.div `
11
+ min-height: 220px;
12
+ display: flex;
13
+ flex-direction: column;
14
+ align-items: center;
15
+ justify-content: center;
16
+ gap: 12px;
17
+ text-align: center;
18
+ `;
19
+ const CardIntentPaymentStatusViewContent = () => {
20
+ const { goToView } = useModalWithView();
21
+ const config = useMintMoneyConfig();
22
+ const { payment } = useCheckoutStore();
23
+ useEffect(() => {
24
+ if (!payment)
25
+ return;
26
+ const poller = startPaymentPolling((status) => {
27
+ if (status === PaymentStatus.PAID) {
28
+ goToView("paymentSuccess");
29
+ }
30
+ else if (status === PaymentStatus.FAILED) {
31
+ goToView("failed");
32
+ }
33
+ }, CARD_PAYMENT_CONFIRMATION_STATUS);
34
+ return () => {
35
+ poller.stop();
36
+ stopPaymentPolling();
37
+ };
38
+ }, [payment?.id, goToView]);
39
+ return (_jsx(ModalViewContainer, { children: _jsxs(StatusPanel, { children: [_jsx(Loader, { asChild: true }), _jsx(Text, { size: "lg", weight: "semibold", children: "Finalizing card payment" }), _jsx(Text, { size: "sm", color: config.theme.font.color.secondary, children: "We'll update this after the payment split is verified." })] }) }));
40
+ };
41
+ export { CardIntentPaymentStatusViewContent };
42
+ //# sourceMappingURL=processing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processing.js","sourceRoot":"","sources":["../../../../../src/checkout/views/card-intent/processing.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,MAAM,gCAAgC,GAAG,aAAa,CAAC,IAAI,CAAC;AAEnE,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQ7B,CAAC;AAEF,MAAM,kCAAkC,GAAG,GAAG,EAAE;IAC9C,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,EAAE,CA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