@amos.com/react-amos-js 0.11.29 → 0.11.30
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/README.md +2 -2
- package/dist/index.d.ts +8 -3
- package/package.json +2 -2
- package/src/index.tsx +8 -3
package/README.md
CHANGED
|
@@ -293,7 +293,7 @@ function CheckoutForm() {
|
|
|
293
293
|
renderToken="the-render-token-that-you-created-on-dashboard.amos.com"
|
|
294
294
|
additionalFields={{ cardholderName: true }}
|
|
295
295
|
defaultValues={{
|
|
296
|
-
|
|
296
|
+
cardholderName: "Jane Doe",
|
|
297
297
|
billingAddress: {
|
|
298
298
|
line1: "354 Oyster Point Blvd",
|
|
299
299
|
city: "South San Francisco",
|
|
@@ -574,7 +574,7 @@ Renders the secure credit card iframe form. A field-shaped skeleton with an opaq
|
|
|
574
574
|
|
|
575
575
|
- `additionalFields` (`{ cardholderName: boolean }`) — set `additionalFields={{ cardholderName: true }}` to render the cardholder name field in the iframe (`false` by default)
|
|
576
576
|
- `billingAddressRequirement` (`"country" | "full"`, defaults to `"country"`) — how much billing address the iframe collects. `country` collects country / region and, for CA / PR / GB / US, a postal code (labeled ZIP for the United States). `full` shows a full street address form with Smarty autocomplete.
|
|
577
|
-
- `defaultValues` (`{
|
|
577
|
+
- `defaultValues` (`{ accountHolderName?: string; cardholderName?: string; billingAddress?: { name?, email?, phone?, line1?, line2?, city?, state?, postalCode?, country? } }`) — seed account-holder name, cardholder name, and billing address. Provided keys overwrite matching fields, including ones the customer already edited. `cardholderName` is applied and confirmed only when that input is shown. Billing fields are sent on confirm even when those inputs are hidden (`country` billing mode). Never send PAN, CVC, account number, or routing number.
|
|
578
578
|
- `onValidityChange` (`(event: { isValid: boolean }) => void`) — called when form validity changes. `isValid` is true when all required fields are present and valid. Does not include PCI data. Use this to enable or disable your checkout button.
|
|
579
579
|
- `onCardBrandChanged` (`(event: { brand: CardBrand | null }) => void`) — called when the detected card brand changes. `brand` is `"visa"`, `"mastercard"`, `"amex"`, `"discover"`, `"diners"`, or `"jcb"`, or `null` when the field is empty or the number does not match a known brand. Does not include PCI data.
|
|
580
580
|
- `onPostalCodeChange` (`(event: { postalCode: string | null; country: string }) => void`) — called when the customer commits a billing postal code, or clears one. `postalCode` is a finished code, or `null` when a finished code is deleted or the country changes. Incomplete keystrokes are not reported. US and PR commit at 5 digits (ZIP+4 is reported as the first 5). Canada commits as `A1A 1A1`. The UK commits at a full postcode. Not called for `defaultValues`, so a host can copy its own postal field into the iframe until the first callback and then stop. Debounce shipping-rate requests in the host. Card and bank forms only.
|
package/dist/index.d.ts
CHANGED
|
@@ -103,8 +103,11 @@ type AmosCreditCardPaymentMethodFormProps = IframePassthroughProps & {
|
|
|
103
103
|
billingAddressRequirement?: BillingAddressRequirement;
|
|
104
104
|
/**
|
|
105
105
|
* Seed cardholder name and billing address. Provided keys overwrite
|
|
106
|
-
* matching fields, including ones the customer already edited.
|
|
107
|
-
*
|
|
106
|
+
* matching fields, including ones the customer already edited.
|
|
107
|
+
* `cardholderName` prefills the cardholder input and is confirmed only
|
|
108
|
+
* when `additionalFields.cardholderName` is true. Billing fields,
|
|
109
|
+
* including `billingAddress.name`, `email`, and `phone`, are sent on
|
|
110
|
+
* confirm even when those inputs are hidden.
|
|
108
111
|
*/
|
|
109
112
|
defaultValues?: PaymentMethodFormDefaultValues;
|
|
110
113
|
};
|
|
@@ -138,7 +141,9 @@ type AmosBankAccountPaymentMethodFormProps = IframePassthroughProps & {
|
|
|
138
141
|
/**
|
|
139
142
|
* Seed account holder name and billing address. Provided keys
|
|
140
143
|
* overwrite matching fields, including ones the customer already
|
|
141
|
-
* edited.
|
|
144
|
+
* edited. `accountHolderName` prefills the account-holder input.
|
|
145
|
+
* Billing fields, including `billingAddress.name`, `email`, and
|
|
146
|
+
* `phone`, are sent on confirm even when those inputs are hidden.
|
|
142
147
|
*/
|
|
143
148
|
defaultValues?: PaymentMethodFormDefaultValues;
|
|
144
149
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amos.com/react-amos-js",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.30",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"vite-plugin-dts": "5.1.1"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@amos.com/amos-js": "0.11.
|
|
60
|
+
"@amos.com/amos-js": "0.11.33",
|
|
61
61
|
"@types/googlepay": "0.7.13"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
package/src/index.tsx
CHANGED
|
@@ -345,8 +345,11 @@ type AmosCreditCardPaymentMethodFormProps = IframePassthroughProps & {
|
|
|
345
345
|
billingAddressRequirement?: BillingAddressRequirement;
|
|
346
346
|
/**
|
|
347
347
|
* Seed cardholder name and billing address. Provided keys overwrite
|
|
348
|
-
* matching fields, including ones the customer already edited.
|
|
349
|
-
*
|
|
348
|
+
* matching fields, including ones the customer already edited.
|
|
349
|
+
* `cardholderName` prefills the cardholder input and is confirmed only
|
|
350
|
+
* when `additionalFields.cardholderName` is true. Billing fields,
|
|
351
|
+
* including `billingAddress.name`, `email`, and `phone`, are sent on
|
|
352
|
+
* confirm even when those inputs are hidden.
|
|
350
353
|
*/
|
|
351
354
|
defaultValues?: PaymentMethodFormDefaultValues;
|
|
352
355
|
};
|
|
@@ -430,7 +433,9 @@ type AmosBankAccountPaymentMethodFormProps = IframePassthroughProps & {
|
|
|
430
433
|
/**
|
|
431
434
|
* Seed account holder name and billing address. Provided keys
|
|
432
435
|
* overwrite matching fields, including ones the customer already
|
|
433
|
-
* edited.
|
|
436
|
+
* edited. `accountHolderName` prefills the account-holder input.
|
|
437
|
+
* Billing fields, including `billingAddress.name`, `email`, and
|
|
438
|
+
* `phone`, are sent on confirm even when those inputs are hidden.
|
|
434
439
|
*/
|
|
435
440
|
defaultValues?: PaymentMethodFormDefaultValues;
|
|
436
441
|
/**
|