@flopay/react 1.14.11 → 1.14.13
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var jt=Object.create;var Me=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Jt=Object.getPrototypeOf,Qt=Object.prototype.hasOwnProperty;var Se=(e,r)=>()=>(e&&(r=e(e=0)),r);var Oe=(e,r)=>{for(var t in r)Me(e,t,{get:r[t],enumerable:!0})},dt=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Zt(r))!Qt.call(e,s)&&s!==t&&Me(e,s,{get:()=>r[s],enumerable:!(o=$t(r,s))||o.enumerable});return e};var er=(e,r,t)=>(t=e!=null?jt(Jt(e)):{},dt(r||!e||!e.__esModule?Me(t,"default",{value:e,enumerable:!0}):t,e)),tr=e=>dt(Me({},"__esModule",{value:!0}),e);var P,Ve=Se(()=>{"use strict";P=require("@flopay/shared")});var mr,we,Te,Ne=Se(()=>{"use strict";mr=require("@flopay/shared"),we=require("@flopay/shared"),Te=require("@flopay/shared")});var Ct,Pt=Se(()=>{"use strict";Ct={alipay:"https://cdn.flopay.com/sdk-logos/v1/alipay.svg",bancontact:"https://cdn.flopay.com/sdk-logos/v1/bancontact.svg",blik:"https://cdn.flopay.com/sdk-logos/v1/blik.svg",eps:"https://cdn.flopay.com/sdk-logos/v1/eps.svg",giropay:"https://cdn.flopay.com/sdk-logos/v1/giropay.svg",ideal:"https://cdn.flopay.com/sdk-logos/v1/ideal.svg",klarna:"https://cdn.flopay.com/sdk-logos/v1/klarna.svg",p24:"https://cdn.flopay.com/sdk-logos/v1/p24.svg",sepa_debit:"https://cdn.flopay.com/sdk-logos/v1/sepa_debit.svg",wechat_pay:"https://cdn.flopay.com/sdk-logos/v1/wechat_pay.svg"}});function Et(){return(0,M.jsx)("style",{children:yr})}function wt(e,r){let t=e.availablePaymentMethods;return t&&r.some(o=>t[o])?"ready":"unavailable"}function Rt({state:e,placeholderTestId:r,borderRadius:t=8,children:o}){return e==="unavailable"||e==="load_error"?null:(0,M.jsxs)("div",{style:{position:"relative",minHeight:44},children:[(0,M.jsx)("div",{"data-testid":r,"aria-hidden":e==="ready",style:{position:"absolute",inset:0,height:44,borderRadius:t,background:"#e5e7eb",animation:e==="ready"?void 0:"flopay-pulse 1.5s ease-in-out infinite",opacity:e==="ready"?0:1,transform:e==="ready"?"scale(0.985)":"scale(1)",transition:"opacity 140ms ease-out, transform 140ms ease-out",pointerEvents:"none"}}),(0,M.jsx)("div",{style:{minHeight:44,opacity:e==="ready"?1:0,transform:e==="ready"?"translateY(0)":"translateY(2px)",transition:"opacity 140ms ease-out, transform 140ms ease-out",pointerEvents:e==="ready"?"auto":"none"},children:o})]})}function kt({method:e,themeId:r,submitting:t=!1,disabled:o=!1,highlighted:s=!1,hasNextStep:i=!1,onClick:d,backgroundColor:p,borderColor:f,textColor:F,borderRadius:L,fontFamily:Y}){let b=(0,re.resolveStripeMethodBrandVariant)(e,r),T=Ct[e],[E,w]=(0,bt.useState)(!1),y=!!T&&!E,g=b?.backgroundColor??p??"#ffffff",R=b?.borderColor??f??"#d1d5db",B=b?.textColor??F??"#262833";return(0,M.jsx)("button",{type:"button","data-testid":`flopay-stripe-method-button-${e}`,"data-method":e,onClick:()=>{!t&&!o&&d()},disabled:t||o,"aria-busy":t||void 0,style:{position:"relative",width:"100%",boxSizing:"border-box",height:fr,padding:"0 1rem",backgroundColor:g,color:B,border:`1px solid ${R}`,borderRadius:L??8,fontSize:"0.95rem",fontWeight:600,fontFamily:Y,cursor:t||o?"not-allowed":"pointer",opacity:o&&!t?.55:1,animation:t?"flopay-pulse 1.5s ease-in-out infinite":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:8,transition:"transform 0.1s, opacity 140ms ease-out, border-color 140ms ease-out",boxShadow:s?"0 0 0 2px rgba(74, 73, 255, 0.15)":void 0},children:t?(0,M.jsx)("span",{style:{margin:"0 auto"},children:`Connecting to ${(0,re.getStripeMethodDisplayName)(e)}\u2026`}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:(0,re.hasVendoredStripeMethodLogo)(e)?8:0},children:[y?(0,M.jsx)("img",{src:T,alt:"","aria-hidden":"true",onError:()=>w(!0),loading:"lazy",decoding:"async",width:30,height:20,style:{width:30,height:20,flexShrink:0,borderRadius:3,objectFit:"contain",display:"inline-flex"}}):null,!y&&b?.logoSvg?(0,M.jsx)("span",{"aria-hidden":"true",style:{width:30,height:20,flexShrink:0,display:"inline-flex",borderRadius:3,overflow:"hidden"},dangerouslySetInnerHTML:{__html:b.logoSvg}}):null,(0,M.jsx)("span",{children:(0,re.getStripeMethodDisplayName)(e)})]}),i&&(0,M.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:B,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",right:"1rem",top:"50%",transform:"translateY(-50%)",flexShrink:0,opacity:.7},"aria-hidden":"true",children:(0,M.jsx)("path",{d:"M9 18l6-6-6-6"})})]})})}function Mt(e){let r=new Set(e.map(re.stripeExpressMethodToOptionKey));return Object.fromEntries(["applePay","googlePay","paypal","link","amazonPay","klarna"].map(t=>[t,r.has(t)?"auto":"never"]))}function Ft({testId:e,attributes:r,disabled:t,onClick:o,color:s,borderRadius:i,style:d,children:p}){return(0,M.jsx)("button",{type:"button","data-testid":e,...r,onClick:o,disabled:t,style:{width:"100%",marginTop:"0.75rem",padding:"0.875rem",backgroundColor:s,color:"white",border:"none",borderRadius:i,fontSize:"1rem",fontWeight:600,cursor:t?"not-allowed":"pointer",opacity:t?.5:1,transition:"opacity 120ms ease-out",...d??{}},children:p})}var re,bt,M,yr,fr,xt,_t,Tt=Se(()=>{"use strict";re=require("@flopay/shared"),bt=require("react");Pt();M=require("react/jsx-runtime"),yr=`
|
|
1
|
+
"use strict";var jt=Object.create;var Me=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Jt=Object.getPrototypeOf,Qt=Object.prototype.hasOwnProperty;var Se=(e,r,t)=>()=>{if(t)throw t[0];try{return e&&(r=e(e=0)),r}catch(o){throw t=[o],o}};var Oe=(e,r)=>{for(var t in r)Me(e,t,{get:r[t],enumerable:!0})},dt=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Zt(r))!Qt.call(e,s)&&s!==t&&Me(e,s,{get:()=>r[s],enumerable:!(o=$t(r,s))||o.enumerable});return e};var er=(e,r,t)=>(t=e!=null?jt(Jt(e)):{},dt(r||!e||!e.__esModule?Me(t,"default",{value:e,enumerable:!0}):t,e)),tr=e=>dt(Me({},"__esModule",{value:!0}),e);var P,Ve=Se(()=>{"use strict";P=require("@flopay/shared")});var mr,we,Te,Ne=Se(()=>{"use strict";mr=require("@flopay/shared"),we=require("@flopay/shared"),Te=require("@flopay/shared")});var Ct,Pt=Se(()=>{"use strict";Ct={alipay:"https://cdn.flopay.com/sdk-logos/v1/alipay.svg",bancontact:"https://cdn.flopay.com/sdk-logos/v1/bancontact.svg",blik:"https://cdn.flopay.com/sdk-logos/v1/blik.svg",eps:"https://cdn.flopay.com/sdk-logos/v1/eps.svg",giropay:"https://cdn.flopay.com/sdk-logos/v1/giropay.svg",ideal:"https://cdn.flopay.com/sdk-logos/v1/ideal.svg",klarna:"https://cdn.flopay.com/sdk-logos/v1/klarna.svg",p24:"https://cdn.flopay.com/sdk-logos/v1/p24.svg",sepa_debit:"https://cdn.flopay.com/sdk-logos/v1/sepa_debit.svg",wechat_pay:"https://cdn.flopay.com/sdk-logos/v1/wechat_pay.svg"}});function Et(){return(0,M.jsx)("style",{children:yr})}function wt(e,r){let t=e.availablePaymentMethods;return t&&r.some(o=>t[o])?"ready":"unavailable"}function Rt({state:e,placeholderTestId:r,borderRadius:t=8,children:o}){return e==="unavailable"||e==="load_error"?null:(0,M.jsxs)("div",{style:{position:"relative",minHeight:44},children:[(0,M.jsx)("div",{"data-testid":r,"aria-hidden":e==="ready",style:{position:"absolute",inset:0,height:44,borderRadius:t,background:"#e5e7eb",animation:e==="ready"?void 0:"flopay-pulse 1.5s ease-in-out infinite",opacity:e==="ready"?0:1,transform:e==="ready"?"scale(0.985)":"scale(1)",transition:"opacity 140ms ease-out, transform 140ms ease-out",pointerEvents:"none"}}),(0,M.jsx)("div",{style:{minHeight:44,opacity:e==="ready"?1:0,transform:e==="ready"?"translateY(0)":"translateY(2px)",transition:"opacity 140ms ease-out, transform 140ms ease-out",pointerEvents:e==="ready"?"auto":"none"},children:o})]})}function kt({method:e,themeId:r,submitting:t=!1,disabled:o=!1,highlighted:s=!1,hasNextStep:i=!1,onClick:d,backgroundColor:p,borderColor:f,textColor:F,borderRadius:L,fontFamily:Y}){let b=(0,re.resolveStripeMethodBrandVariant)(e,r),T=Ct[e],[E,w]=(0,bt.useState)(!1),y=!!T&&!E,g=b?.backgroundColor??p??"#ffffff",R=b?.borderColor??f??"#d1d5db",B=b?.textColor??F??"#262833";return(0,M.jsx)("button",{type:"button","data-testid":`flopay-stripe-method-button-${e}`,"data-method":e,onClick:()=>{!t&&!o&&d()},disabled:t||o,"aria-busy":t||void 0,style:{position:"relative",width:"100%",boxSizing:"border-box",height:fr,padding:"0 1rem",backgroundColor:g,color:B,border:`1px solid ${R}`,borderRadius:L??8,fontSize:"0.95rem",fontWeight:600,fontFamily:Y,cursor:t||o?"not-allowed":"pointer",opacity:o&&!t?.55:1,animation:t?"flopay-pulse 1.5s ease-in-out infinite":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:8,transition:"transform 0.1s, opacity 140ms ease-out, border-color 140ms ease-out",boxShadow:s?"0 0 0 2px rgba(74, 73, 255, 0.15)":void 0},children:t?(0,M.jsx)("span",{style:{margin:"0 auto"},children:`Connecting to ${(0,re.getStripeMethodDisplayName)(e)}\u2026`}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:(0,re.hasVendoredStripeMethodLogo)(e)?8:0},children:[y?(0,M.jsx)("img",{src:T,alt:"","aria-hidden":"true",onError:()=>w(!0),loading:"lazy",decoding:"async",width:30,height:20,style:{width:30,height:20,flexShrink:0,borderRadius:3,objectFit:"contain",display:"inline-flex"}}):null,!y&&b?.logoSvg?(0,M.jsx)("span",{"aria-hidden":"true",style:{width:30,height:20,flexShrink:0,display:"inline-flex",borderRadius:3,overflow:"hidden"},dangerouslySetInnerHTML:{__html:b.logoSvg}}):null,(0,M.jsx)("span",{children:(0,re.getStripeMethodDisplayName)(e)})]}),i&&(0,M.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:B,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",right:"1rem",top:"50%",transform:"translateY(-50%)",flexShrink:0,opacity:.7},"aria-hidden":"true",children:(0,M.jsx)("path",{d:"M9 18l6-6-6-6"})})]})})}function Mt(e){let r=new Set(e.map(re.stripeExpressMethodToOptionKey));return Object.fromEntries(["applePay","googlePay","paypal","link","amazonPay","klarna"].map(t=>[t,r.has(t)?"auto":"never"]))}function Ft({testId:e,attributes:r,disabled:t,onClick:o,color:s,borderRadius:i,style:d,children:p}){return(0,M.jsx)("button",{type:"button","data-testid":e,...r,onClick:o,disabled:t,style:{width:"100%",marginTop:"0.75rem",padding:"0.875rem",backgroundColor:s,color:"white",border:"none",borderRadius:i,fontSize:"1rem",fontWeight:600,cursor:t?"not-allowed":"pointer",opacity:t?.5:1,transition:"opacity 120ms ease-out",...d??{}},children:p})}var re,bt,M,yr,fr,xt,_t,Tt=Se(()=>{"use strict";re=require("@flopay/shared"),bt=require("react");Pt();M=require("react/jsx-runtime"),yr=`
|
|
2
2
|
.paypal-buttons { margin: 0 !important; vertical-align: top !important; }
|
|
3
3
|
@keyframes flopay-spin { to { transform: rotate(360deg); } }
|
|
4
4
|
@keyframes flopay-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FloPay, SavedCardChallengeInput, SavedCardChallengeOutcome } from '@flopay/js';
|
|
1
|
+
import type { FloPay, SavedCardChallengeInput, SavedCardChallengeOutcome, ThreeDsChallengeAttempt } from '@flopay/js';
|
|
2
2
|
import type { CheckoutButtonMethod, CheckoutProcessError, CheckoutSession, NormalizedCheckoutSession, PaymentResult, TelemetryExpectedOutcome, TelemetryFailureCategory, TelemetryRequestCategory, TokenizedBody } from '@flopay/shared';
|
|
3
3
|
import { FloPayError } from '@flopay/shared';
|
|
4
4
|
export declare const DEFAULT_SAVED_PAYMENT_DECLINE_METHOD: CheckoutButtonMethod;
|
|
@@ -47,6 +47,22 @@ type ProviderNeutralActionInput = {
|
|
|
47
47
|
* telemetry for this flow (FloPayCheckout) leave it off.
|
|
48
48
|
*/
|
|
49
49
|
telemetry?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The challenge's lifecycle recorder (`three_ds.challenge`, #525), begun by the calling
|
|
52
|
+
* component on its own `PaymentAPI` with `beginSavedCardChallengeTelemetry`. Observation only.
|
|
53
|
+
*/
|
|
54
|
+
challengeTelemetry?: ThreeDsChallengeAttempt;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Begin a component-owned saved-card challenge's lifecycle recorder (#525) on a dedicated
|
|
58
|
+
* `PaymentAPI` client. Pass `telemetry` to {@link completeProviderNeutralSavedPaymentAction} as
|
|
59
|
+
* `challengeTelemetry` and call `release` once the action settles: it destroys the client on
|
|
60
|
+
* the next task, after the runner's teardown record, so the reporter drains what it queued. With
|
|
61
|
+
* the merchant's telemetry off, or when recording cannot start, nothing is created or released.
|
|
62
|
+
*/
|
|
63
|
+
export declare function beginComponentChallengeTelemetry(billingApiUrl: string, sessionId: string, session: CheckoutSession, enabled?: boolean): {
|
|
64
|
+
telemetry?: ThreeDsChallengeAttempt;
|
|
65
|
+
release: () => void;
|
|
50
66
|
};
|
|
51
67
|
/** Complete a backend-owned saved-card challenge without loading a browser payment provider. */
|
|
52
68
|
export declare function completeProviderNeutralSavedPaymentAction(action: ProviderNeutralNextAction, input: ProviderNeutralActionInput): Promise<PaymentResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flopay/react",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@flopay/js": "1.14.
|
|
40
|
-
"@flopay/shared": "1.14.
|
|
41
|
-
"@paypal/paypal-js": "^
|
|
39
|
+
"@flopay/js": "1.14.13",
|
|
40
|
+
"@flopay/shared": "1.14.13",
|
|
41
|
+
"@paypal/paypal-js": "^11.3.0",
|
|
42
42
|
"@stripe/react-stripe-js": "^7.0.1",
|
|
43
|
-
"@stripe/stripe-js": "^10.
|
|
43
|
+
"@stripe/stripe-js": "^10.3.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=18.0.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"jsdom": "^29.1.1",
|
|
55
55
|
"react": "^19.3.1",
|
|
56
56
|
"react-dom": "^19.3.1",
|
|
57
|
-
"tsup": "^
|
|
57
|
+
"tsup": "^9.0.0",
|
|
58
58
|
"typescript": "^7.0.2",
|
|
59
59
|
"vitest": "4.1.12"
|
|
60
60
|
},
|