@amos.com/react-amos-js 0.9.8 → 0.9.9
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 +30 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/index.mjs +36 -20
- package/package.json +2 -2
- package/src/index.tsx +65 -30
package/README.md
CHANGED
|
@@ -457,12 +457,40 @@ Renders the secure Google Pay iframe button (express checkout flow).
|
|
|
457
457
|
**Optional props:**
|
|
458
458
|
|
|
459
459
|
- `appearance` (`{ themeVariables?: Partial<Record<ThemeVariable, string>>; labels?: "above" | "floating" | "placeholder" }`)
|
|
460
|
+
- `buttonType` (`"book" | "buy" | "checkout" | "donate" | "order" | "pay" | "plain" | "subscribe" | "short" | "long"`, defaults to `"short"`)
|
|
461
|
+
- `buttonColor` (`"default" | "black" | "white"`)
|
|
462
|
+
- `buttonRadius` (`number`, 0–20)
|
|
463
|
+
- `buttonSizeMode` (`"static" | "fill"`)
|
|
464
|
+
- `buttonLocale` (`string`)
|
|
465
|
+
- `buttonBorderType` (`"no_border" | "default_border"`)
|
|
466
|
+
- `style` — forwarded to the Google Pay button **inside** the iframe (not the iframe element). Example: `style={{ height: "48px", width: "100%" }}` with `buttonSizeMode="fill"`.
|
|
460
467
|
|
|
461
|
-
**Also accepts:** standard iframe props, minus
|
|
468
|
+
**Also accepts:** standard iframe props, minus `src`, `title`, `name`, `role`, `allow`, and `style` (which is the inner button style).
|
|
462
469
|
|
|
463
470
|
### `AmosApplePayButton`
|
|
464
471
|
|
|
465
|
-
Renders the secure Apple Pay iframe button (express checkout flow). Same props and callbacks as `AmosGooglePayButton`.
|
|
472
|
+
Renders the secure Apple Pay iframe button (express checkout flow). Same required props and callbacks as `AmosGooglePayButton`.
|
|
473
|
+
|
|
474
|
+
**Optional visual props** use Apple's `<apple-pay-button>` attribute names:
|
|
475
|
+
|
|
476
|
+
- `buttonstyle` (`"black" | "white" | "white-outline"`, defaults to `"black"`)
|
|
477
|
+
- `type` (`"plain" | "buy" | "set-up" | "donate" | "check-out" | "book" | "subscribe" | "reload" | "add-money" | "top-up" | "order" | "rent" | "support" | "contribute" | "tip"`, defaults to `"plain"`)
|
|
478
|
+
- `locale` (`string`, BCP 47, defaults to `"en-US"`)
|
|
479
|
+
- `style` — forwarded to the `<apple-pay-button>` inside the iframe. Apple sizes the button with CSS custom properties:
|
|
480
|
+
|
|
481
|
+
```tsx
|
|
482
|
+
<AmosApplePayButton
|
|
483
|
+
buttonstyle="white-outline"
|
|
484
|
+
type="buy"
|
|
485
|
+
locale="en-GB"
|
|
486
|
+
style={{
|
|
487
|
+
"--apple-pay-button-height": "48px",
|
|
488
|
+
"--apple-pay-button-width": "100%",
|
|
489
|
+
width: "100%",
|
|
490
|
+
}}
|
|
491
|
+
// ...required props
|
|
492
|
+
/>
|
|
493
|
+
```
|
|
466
494
|
|
|
467
495
|
Only Amos domains need Apple merchant registration. The button and `ApplePaySession` run inside the Amos embed iframe. On Safari, the native payment sheet is used. On other browsers, Apple's QR handoff opens in a popup (`pay.apple.com`); while that popup is open, the SDK automatically shows a full-viewport waiting overlay on the host page with instructions and a **Cancel payment** button. You do not need to implement popup or overlay handling yourself.
|
|
468
496
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="googlepay" />
|
|
2
|
-
import { Appearance, BillingAddressRequirement, ConfirmationResult, CreditCardAdditionalFields } from '@amos.com/amos-js';
|
|
2
|
+
import { Appearance, ApplePayButtonElementProps, BillingAddressRequirement, ConfirmationResult, CreditCardAdditionalFields, GooglePayButtonElementProps } from '@amos.com/amos-js';
|
|
3
3
|
import { components } from '@amos.com/node';
|
|
4
4
|
import { ComponentProps, RefObject } from 'react';
|
|
5
5
|
export * from '@amos.com/amos-js';
|
|
@@ -56,7 +56,7 @@ type AmosBankAccountPaymentMethodFormProps = IframePassthroughProps & {
|
|
|
56
56
|
billingAddressRequirement?: BillingAddressRequirement;
|
|
57
57
|
};
|
|
58
58
|
export declare function AmosBankAccountPaymentMethodForm({ ref, renderToken, appearance, onResult, billingAddressRequirement, style, ...rest }: AmosBankAccountPaymentMethodFormProps): import("react").JSX.Element;
|
|
59
|
-
type AmosGooglePayButtonProps = IframePassthroughProps & {
|
|
59
|
+
type AmosGooglePayButtonProps = Omit<IframePassthroughProps, "style"> & GooglePayButtonElementProps & {
|
|
60
60
|
renderToken: string;
|
|
61
61
|
amount: string;
|
|
62
62
|
merchantName: string;
|
|
@@ -67,8 +67,8 @@ type AmosGooglePayButtonProps = IframePassthroughProps & {
|
|
|
67
67
|
}) => Promise<components["schemas"]["EmbedToken"]["token"]>;
|
|
68
68
|
onResult: (result: ConfirmationResult) => void;
|
|
69
69
|
};
|
|
70
|
-
export declare function AmosGooglePayButton({ ref, renderToken, amount, merchantName, appearance, onInitiatePaymentIntentRequest, onResult, style, ...rest }: AmosGooglePayButtonProps): import("react").JSX.Element;
|
|
71
|
-
type AmosApplePayButtonProps = IframePassthroughProps & {
|
|
70
|
+
export declare function AmosGooglePayButton({ ref, renderToken, amount, merchantName, appearance, onInitiatePaymentIntentRequest, onResult, buttonType, buttonColor, buttonRadius, buttonSizeMode, buttonLocale, buttonBorderType, style, ...rest }: AmosGooglePayButtonProps): import("react").JSX.Element;
|
|
71
|
+
type AmosApplePayButtonProps = Omit<IframePassthroughProps, "style" | "type"> & ApplePayButtonElementProps & {
|
|
72
72
|
renderToken: string;
|
|
73
73
|
amount: string;
|
|
74
74
|
merchantName: string;
|
|
@@ -79,4 +79,4 @@ type AmosApplePayButtonProps = IframePassthroughProps & {
|
|
|
79
79
|
}) => Promise<components["schemas"]["EmbedToken"]["token"]>;
|
|
80
80
|
onResult: (result: ConfirmationResult) => void;
|
|
81
81
|
};
|
|
82
|
-
export declare function AmosApplePayButton({ ref, renderToken, amount, merchantName, appearance, onInitiatePaymentIntentRequest, onResult, style, ...rest }: AmosApplePayButtonProps): import("react").JSX.Element;
|
|
82
|
+
export declare function AmosApplePayButton({ ref, renderToken, amount, merchantName, appearance, onInitiatePaymentIntentRequest, onResult, buttonstyle, type, locale, style, ...rest }: AmosApplePayButtonProps): import("react").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@amos.com/amos-js"),t=require("react"),n=require("react/jsx-runtime");function r(e){return e?e.current??null:null}function i({iframeRef:t}){return(0,e.validateForm)({iframe:r(t)})}function a({iframeRef:t,token:n}){(0,e.confirmPaymentIntent)({iframe:r(t),token:n})}function o({iframeRef:t,token:n}){(0,e.confirmSetupIntent)({iframe:r(t),token:n})}function s({iframeRef:t}){(0,e.resetForm)({iframe:r(t)})}function c(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function l(e,{style:t,className:n,id:r,...i}){n!=null&&(e.className=n),r!=null&&(e.id=r),t!=null&&Object.assign(e.style,t);for(let[t,n]of Object.entries(i))n!=null&&(t in e?Reflect.set(e,t,n):e.setAttribute(t,String(n)))}function u({containerRef:e,iframeRef:n,mount:r,options:i,remountDeps:a,iframePassthrough:o,updateDeps:s}){let u=(0,t.useRef)(null);(0,t.useEffect)(()=>{let t=e.current;if(!t)return;let a=r(t,i);return u.current=a,c(n,a.iframe),l(a.iframe,o),()=>{a.destroy(),u.current=null,c(n,null)}},[...a]),(0,t.useEffect)(()=>{u.current?.update(i)},[...s]),(0,t.useEffect)(()=>{let e=u.current?.iframe;e&&l(e,o)})}function d({ref:r,renderToken:i,appearance:a,onResult:o,additionalFields:s={cardholderName:!1},billingAddressRequirement:c=`country`,style:l,...d}){let f=(0,t.useRef)(null);return u({containerRef:f,iframeRef:r,mount:e.mountAmosCreditCardPaymentMethodForm,options:{renderToken:i,appearance:a,additionalFields:s,billingAddressRequirement:c,onResult:o},remountDeps:[i,s.cardholderName,c],iframePassthrough:{style:l,...d},updateDeps:[a,s,c,o]}),(0,n.jsx)(`div`,{ref:f})}function f({ref:r,renderToken:i,appearance:a,onResult:o,billingAddressRequirement:s=`country`,style:c,...l}){let d=(0,t.useRef)(null);return u({containerRef:d,iframeRef:r,mount:e.mountAmosBankAccountPaymentMethodForm,options:{renderToken:i,appearance:a,billingAddressRequirement:s,onResult:o},remountDeps:[i,s],iframePassthrough:{style:c,...l},updateDeps:[a,s,o]}),(0,n.jsx)(`div`,{ref:d})}function p({ref:r,renderToken:i,amount:a,merchantName:o,appearance:s,onInitiatePaymentIntentRequest:c,onResult:l,style:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@amos.com/amos-js"),t=require("react"),n=require("react/jsx-runtime");function r(e){return e?e.current??null:null}function i({iframeRef:t}){return(0,e.validateForm)({iframe:r(t)})}function a({iframeRef:t,token:n}){(0,e.confirmPaymentIntent)({iframe:r(t),token:n})}function o({iframeRef:t,token:n}){(0,e.confirmSetupIntent)({iframe:r(t),token:n})}function s({iframeRef:t}){(0,e.resetForm)({iframe:r(t)})}function c(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function l(e,{style:t,className:n,id:r,...i}){n!=null&&(e.className=n),r!=null&&(e.id=r),t!=null&&Object.assign(e.style,t);for(let[t,n]of Object.entries(i))n!=null&&(t in e?Reflect.set(e,t,n):e.setAttribute(t,String(n)))}function u({containerRef:e,iframeRef:n,mount:r,options:i,remountDeps:a,iframePassthrough:o,updateDeps:s}){let u=(0,t.useRef)(null);(0,t.useEffect)(()=>{let t=e.current;if(!t)return;let a=r(t,i);return u.current=a,c(n,a.iframe),l(a.iframe,o),()=>{a.destroy(),u.current=null,c(n,null)}},[...a]),(0,t.useEffect)(()=>{u.current?.update(i)},[...s]),(0,t.useEffect)(()=>{let e=u.current?.iframe;e&&l(e,o)})}function d({ref:r,renderToken:i,appearance:a,onResult:o,additionalFields:s={cardholderName:!1},billingAddressRequirement:c=`country`,style:l,...d}){let f=(0,t.useRef)(null);return u({containerRef:f,iframeRef:r,mount:e.mountAmosCreditCardPaymentMethodForm,options:{renderToken:i,appearance:a,additionalFields:s,billingAddressRequirement:c,onResult:o},remountDeps:[i,s.cardholderName,c],iframePassthrough:{style:l,...d},updateDeps:[a,s,c,o]}),(0,n.jsx)(`div`,{ref:f})}function f({ref:r,renderToken:i,appearance:a,onResult:o,billingAddressRequirement:s=`country`,style:c,...l}){let d=(0,t.useRef)(null);return u({containerRef:d,iframeRef:r,mount:e.mountAmosBankAccountPaymentMethodForm,options:{renderToken:i,appearance:a,billingAddressRequirement:s,onResult:o},remountDeps:[i,s],iframePassthrough:{style:c,...l},updateDeps:[a,s,o]}),(0,n.jsx)(`div`,{ref:d})}function p({ref:r,renderToken:i,amount:a,merchantName:o,appearance:s,onInitiatePaymentIntentRequest:c,onResult:l,buttonType:d,buttonColor:f,buttonRadius:p,buttonSizeMode:m,buttonLocale:h,buttonBorderType:g,style:_,...v}){let y=(0,t.useRef)(null);return u({containerRef:y,iframeRef:r,mount:e.mountAmosGooglePayButton,options:{renderToken:i,amount:a,merchantName:o,appearance:s,onInitiatePaymentIntentRequest:c,onResult:l,buttonType:d,buttonColor:f,buttonRadius:p,buttonSizeMode:m,buttonLocale:h,buttonBorderType:g,style:_},remountDeps:[i],iframePassthrough:{...v},updateDeps:[a,o,s,c,l,d,f,p,m,h,g,_]}),(0,n.jsx)(`div`,{ref:y})}function m({ref:r,renderToken:i,amount:a,merchantName:o,appearance:s,onInitiatePaymentIntentRequest:c,onResult:l,buttonstyle:d,type:f,locale:p,style:m,...h}){let g=(0,t.useRef)(null);return u({containerRef:g,iframeRef:r,mount:e.mountAmosApplePayButton,options:{renderToken:i,amount:a,merchantName:o,appearance:s,onInitiatePaymentIntentRequest:c,onResult:l,buttonstyle:d,type:f,locale:p,style:m},remountDeps:[i],iframePassthrough:{...h},updateDeps:[a,o,s,c,l,d,f,p,m]}),(0,n.jsx)(`div`,{ref:g})}exports.AmosApplePayButton=m,exports.AmosBankAccountPaymentMethodForm=f,exports.AmosCreditCardPaymentMethodForm=d,exports.AmosGooglePayButton=p,exports.confirmPaymentIntent=a,exports.confirmSetupIntent=o,exports.resetForm=s,exports.validateForm=i,Object.keys(e).forEach(function(t){t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})});
|
package/dist/index.mjs
CHANGED
|
@@ -101,10 +101,10 @@ function b({ ref: e, renderToken: t, appearance: n, onResult: i, billingAddressR
|
|
|
101
101
|
]
|
|
102
102
|
}), /* @__PURE__ */ u("div", { ref: c });
|
|
103
103
|
}
|
|
104
|
-
function x({ ref: e, renderToken: t, amount: n, merchantName: r, appearance: i, onInitiatePaymentIntentRequest: o, onResult: s,
|
|
105
|
-
let
|
|
104
|
+
function x({ ref: e, renderToken: t, amount: n, merchantName: r, appearance: i, onInitiatePaymentIntentRequest: o, onResult: s, buttonType: c, buttonColor: d, buttonRadius: f, buttonSizeMode: p, buttonLocale: m, buttonBorderType: h, style: g, ..._ }) {
|
|
105
|
+
let y = l(null);
|
|
106
106
|
return v({
|
|
107
|
-
containerRef:
|
|
107
|
+
containerRef: y,
|
|
108
108
|
iframeRef: e,
|
|
109
109
|
mount: a,
|
|
110
110
|
options: {
|
|
@@ -113,26 +113,37 @@ function x({ ref: e, renderToken: t, amount: n, merchantName: r, appearance: i,
|
|
|
113
113
|
merchantName: r,
|
|
114
114
|
appearance: i,
|
|
115
115
|
onInitiatePaymentIntentRequest: o,
|
|
116
|
-
onResult: s
|
|
116
|
+
onResult: s,
|
|
117
|
+
buttonType: c,
|
|
118
|
+
buttonColor: d,
|
|
119
|
+
buttonRadius: f,
|
|
120
|
+
buttonSizeMode: p,
|
|
121
|
+
buttonLocale: m,
|
|
122
|
+
buttonBorderType: h,
|
|
123
|
+
style: g
|
|
117
124
|
},
|
|
118
125
|
remountDeps: [t],
|
|
119
|
-
iframePassthrough: {
|
|
120
|
-
style: c,
|
|
121
|
-
...d
|
|
122
|
-
},
|
|
126
|
+
iframePassthrough: { ..._ },
|
|
123
127
|
updateDeps: [
|
|
124
128
|
n,
|
|
125
129
|
r,
|
|
126
130
|
i,
|
|
127
131
|
o,
|
|
128
|
-
s
|
|
132
|
+
s,
|
|
133
|
+
c,
|
|
134
|
+
d,
|
|
135
|
+
f,
|
|
136
|
+
p,
|
|
137
|
+
m,
|
|
138
|
+
h,
|
|
139
|
+
g
|
|
129
140
|
]
|
|
130
|
-
}), /* @__PURE__ */ u("div", { ref:
|
|
141
|
+
}), /* @__PURE__ */ u("div", { ref: y });
|
|
131
142
|
}
|
|
132
|
-
function S({ ref: e, renderToken: t, amount: r, merchantName: i, appearance: a, onInitiatePaymentIntentRequest: o, onResult: s,
|
|
133
|
-
let
|
|
143
|
+
function S({ ref: e, renderToken: t, amount: r, merchantName: i, appearance: a, onInitiatePaymentIntentRequest: o, onResult: s, buttonstyle: c, type: d, locale: f, style: p, ...m }) {
|
|
144
|
+
let h = l(null);
|
|
134
145
|
return v({
|
|
135
|
-
containerRef:
|
|
146
|
+
containerRef: h,
|
|
136
147
|
iframeRef: e,
|
|
137
148
|
mount: n,
|
|
138
149
|
options: {
|
|
@@ -141,21 +152,26 @@ function S({ ref: e, renderToken: t, amount: r, merchantName: i, appearance: a,
|
|
|
141
152
|
merchantName: i,
|
|
142
153
|
appearance: a,
|
|
143
154
|
onInitiatePaymentIntentRequest: o,
|
|
144
|
-
onResult: s
|
|
155
|
+
onResult: s,
|
|
156
|
+
buttonstyle: c,
|
|
157
|
+
type: d,
|
|
158
|
+
locale: f,
|
|
159
|
+
style: p
|
|
145
160
|
},
|
|
146
161
|
remountDeps: [t],
|
|
147
|
-
iframePassthrough: {
|
|
148
|
-
style: c,
|
|
149
|
-
...d
|
|
150
|
-
},
|
|
162
|
+
iframePassthrough: { ...m },
|
|
151
163
|
updateDeps: [
|
|
152
164
|
r,
|
|
153
165
|
i,
|
|
154
166
|
a,
|
|
155
167
|
o,
|
|
156
|
-
s
|
|
168
|
+
s,
|
|
169
|
+
c,
|
|
170
|
+
d,
|
|
171
|
+
f,
|
|
172
|
+
p
|
|
157
173
|
]
|
|
158
|
-
}), /* @__PURE__ */ u("div", { ref:
|
|
174
|
+
}), /* @__PURE__ */ u("div", { ref: h });
|
|
159
175
|
}
|
|
160
176
|
//#endregion
|
|
161
177
|
export { S as AmosApplePayButton, b as AmosBankAccountPaymentMethodForm, y as AmosCreditCardPaymentMethodForm, x as AmosGooglePayButton, p as confirmPaymentIntent, m as confirmSetupIntent, h as resetForm, f as validateForm };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amos.com/react-amos-js",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"vite-plugin-dts": "5.0.3"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@amos.com/amos-js": "0.9.
|
|
51
|
+
"@amos.com/amos-js": "0.9.10",
|
|
52
52
|
"@types/googlepay": "0.7.11"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
package/src/index.tsx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
type Appearance,
|
|
5
|
+
type ApplePayButtonElementProps,
|
|
5
6
|
confirmPaymentIntent as amosConfirmPaymentIntent,
|
|
6
7
|
confirmSetupIntent as amosConfirmSetupIntent,
|
|
7
8
|
resetForm as amosResetForm,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
type BillingAddressRequirement,
|
|
10
11
|
type ConfirmationResult,
|
|
11
12
|
type CreditCardAdditionalFields,
|
|
13
|
+
type GooglePayButtonElementProps,
|
|
12
14
|
mountAmosApplePayButton,
|
|
13
15
|
mountAmosBankAccountPaymentMethodForm,
|
|
14
16
|
mountAmosCreditCardPaymentMethodForm,
|
|
@@ -272,20 +274,21 @@ export function AmosBankAccountPaymentMethodForm({
|
|
|
272
274
|
return <div ref={containerRef} />;
|
|
273
275
|
}
|
|
274
276
|
|
|
275
|
-
type AmosGooglePayButtonProps = IframePassthroughProps &
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
277
|
+
type AmosGooglePayButtonProps = Omit<IframePassthroughProps, "style"> &
|
|
278
|
+
GooglePayButtonElementProps & {
|
|
279
|
+
renderToken: string;
|
|
280
|
+
amount: string;
|
|
281
|
+
merchantName: string;
|
|
282
|
+
appearance?: Appearance;
|
|
283
|
+
onInitiatePaymentIntentRequest: ({
|
|
284
|
+
paymentIntentCreateAttributes,
|
|
285
|
+
customerCreateAttributes,
|
|
286
|
+
}: {
|
|
287
|
+
paymentIntentCreateAttributes: components["schemas"]["CreatePaymentIntentInput"];
|
|
288
|
+
customerCreateAttributes: components["schemas"]["CreateCustomerInput"];
|
|
289
|
+
}) => Promise<components["schemas"]["EmbedToken"]["token"]>;
|
|
290
|
+
onResult: (result: ConfirmationResult) => void;
|
|
291
|
+
};
|
|
289
292
|
|
|
290
293
|
export function AmosGooglePayButton({
|
|
291
294
|
ref,
|
|
@@ -295,6 +298,12 @@ export function AmosGooglePayButton({
|
|
|
295
298
|
appearance,
|
|
296
299
|
onInitiatePaymentIntentRequest,
|
|
297
300
|
onResult,
|
|
301
|
+
buttonType,
|
|
302
|
+
buttonColor,
|
|
303
|
+
buttonRadius,
|
|
304
|
+
buttonSizeMode,
|
|
305
|
+
buttonLocale,
|
|
306
|
+
buttonBorderType,
|
|
298
307
|
style,
|
|
299
308
|
...rest
|
|
300
309
|
}: AmosGooglePayButtonProps) {
|
|
@@ -311,35 +320,50 @@ export function AmosGooglePayButton({
|
|
|
311
320
|
appearance,
|
|
312
321
|
onInitiatePaymentIntentRequest,
|
|
313
322
|
onResult,
|
|
323
|
+
buttonType,
|
|
324
|
+
buttonColor,
|
|
325
|
+
buttonRadius,
|
|
326
|
+
buttonSizeMode,
|
|
327
|
+
buttonLocale,
|
|
328
|
+
buttonBorderType,
|
|
329
|
+
style,
|
|
314
330
|
},
|
|
315
331
|
remountDeps: [renderToken],
|
|
316
|
-
iframePassthrough: {
|
|
332
|
+
iframePassthrough: { ...rest },
|
|
317
333
|
updateDeps: [
|
|
318
334
|
amount,
|
|
319
335
|
merchantName,
|
|
320
336
|
appearance,
|
|
321
337
|
onInitiatePaymentIntentRequest,
|
|
322
338
|
onResult,
|
|
339
|
+
buttonType,
|
|
340
|
+
buttonColor,
|
|
341
|
+
buttonRadius,
|
|
342
|
+
buttonSizeMode,
|
|
343
|
+
buttonLocale,
|
|
344
|
+
buttonBorderType,
|
|
345
|
+
style,
|
|
323
346
|
],
|
|
324
347
|
});
|
|
325
348
|
|
|
326
349
|
return <div ref={containerRef} />;
|
|
327
350
|
}
|
|
328
351
|
|
|
329
|
-
type AmosApplePayButtonProps = IframePassthroughProps &
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
352
|
+
type AmosApplePayButtonProps = Omit<IframePassthroughProps, "style" | "type"> &
|
|
353
|
+
ApplePayButtonElementProps & {
|
|
354
|
+
renderToken: string;
|
|
355
|
+
amount: string;
|
|
356
|
+
merchantName: string;
|
|
357
|
+
appearance?: Appearance;
|
|
358
|
+
onInitiatePaymentIntentRequest: ({
|
|
359
|
+
paymentIntentCreateAttributes,
|
|
360
|
+
customerCreateAttributes,
|
|
361
|
+
}: {
|
|
362
|
+
paymentIntentCreateAttributes: components["schemas"]["CreatePaymentIntentInput"];
|
|
363
|
+
customerCreateAttributes: components["schemas"]["CreateCustomerInput"];
|
|
364
|
+
}) => Promise<components["schemas"]["EmbedToken"]["token"]>;
|
|
365
|
+
onResult: (result: ConfirmationResult) => void;
|
|
366
|
+
};
|
|
343
367
|
|
|
344
368
|
export function AmosApplePayButton({
|
|
345
369
|
ref,
|
|
@@ -349,6 +373,9 @@ export function AmosApplePayButton({
|
|
|
349
373
|
appearance,
|
|
350
374
|
onInitiatePaymentIntentRequest,
|
|
351
375
|
onResult,
|
|
376
|
+
buttonstyle,
|
|
377
|
+
type,
|
|
378
|
+
locale,
|
|
352
379
|
style,
|
|
353
380
|
...rest
|
|
354
381
|
}: AmosApplePayButtonProps) {
|
|
@@ -365,15 +392,23 @@ export function AmosApplePayButton({
|
|
|
365
392
|
appearance,
|
|
366
393
|
onInitiatePaymentIntentRequest,
|
|
367
394
|
onResult,
|
|
395
|
+
buttonstyle,
|
|
396
|
+
type,
|
|
397
|
+
locale,
|
|
398
|
+
style,
|
|
368
399
|
},
|
|
369
400
|
remountDeps: [renderToken],
|
|
370
|
-
iframePassthrough: {
|
|
401
|
+
iframePassthrough: { ...rest },
|
|
371
402
|
updateDeps: [
|
|
372
403
|
amount,
|
|
373
404
|
merchantName,
|
|
374
405
|
appearance,
|
|
375
406
|
onInitiatePaymentIntentRequest,
|
|
376
407
|
onResult,
|
|
408
|
+
buttonstyle,
|
|
409
|
+
type,
|
|
410
|
+
locale,
|
|
411
|
+
style,
|
|
377
412
|
],
|
|
378
413
|
});
|
|
379
414
|
|