@payos-inc/payos-react 1.0.42-staging.83 → 1.2.0-staging.100
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/LICENSE +96 -0
- package/README.md +160 -0
- package/dist/THIRD_PARTY_NOTICES.txt +549 -0
- package/dist/payos-react.cjs +50 -0
- package/dist/payos-react.css +1 -1
- package/dist/payos-react.esm.js +18 -12
- package/dist/payos-react.min.js +2 -1
- package/dist/payos-react.mjs +50 -0
- package/dist/types/index.d.ts +1 -57
- package/dist/types/payos-passkey-js/src/api/ApiClient.d.ts +48 -0
- package/dist/types/payos-passkey-js/src/core/PayOSPasskey.d.ts +165 -0
- package/dist/types/payos-passkey-js/src/core/sessionFlow.d.ts +48 -0
- package/dist/types/payos-passkey-js/src/core/types.d.ts +183 -0
- package/dist/types/payos-passkey-js/src/index.d.ts +10 -0
- package/dist/types/payos-passkey-js/src/services/mastercard/MastercardSDKService.d.ts +61 -0
- package/dist/types/payos-passkey-js/src/services/visa/VisaSDKService.d.ts +90 -0
- package/dist/types/payos-passkey-js/src/utils/diagnostics.d.ts +30 -0
- package/dist/types/payos-passkey-js/src/utils/logger.d.ts +36 -0
- package/dist/types/payos-passkey-js/src/version.d.ts +5 -0
- package/dist/{components → types/payos-react/src/components}/payos/ActiveCardWidget.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/AgentRegistrationFlow.d.ts +1 -3
- package/dist/{components → types/payos-react/src/components}/payos/ConnectStripeLinkButton.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/IdentityVerificationFlow.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/LinkPaymentFlow.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/LinkSessionContent.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/PayOSFooter.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/PayWithLinkButton.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/PaymentMethodRow.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/PaymentSheet.d.ts +3 -4
- package/dist/types/{components → payos-react/src/components}/payos/PaymentSheetContent.d.ts +6 -4
- package/dist/types/{components → payos-react/src/components}/payos/PaymentSheetPaymentFlow.d.ts +4 -2
- package/dist/{components → types/payos-react/src/components}/payos/PaymentSheetShell.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/PaymentSheetStatusViews.d.ts +3 -2
- package/dist/types/{components → payos-react/src/components}/payos/PriceTag.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/ReceiptPanel.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/ViewHeader.d.ts +2 -1
- package/dist/types/{components → payos-react/src/components}/payos/drawer.d.ts +5 -2
- package/dist/{components → types/payos-react/src/components}/payos/order-summary.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/otp-input.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/phone-input.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/themeMode.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/usePaymentSheetDisplayData.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/usePaymentSheetLifecycle.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/usePaymentSheetSkipToAuth.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/usePaymentSheetSkipToLink.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/views/AgentRegistrationView.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/views/CardAddView.d.ts +1 -2
- package/dist/types/{components → payos-react/src/components}/payos/views/CheckoutView.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/views/IdentityView.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/views/LinkBrand.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/views/LinkCheckoutView.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/views/LinkConnectView.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/views/LinkDeniedView.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/views/LinkLoadingView.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/views/LinkSuccessView.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/views/ManageThirdPartyView.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/views/MethodListView.d.ts +8 -1
- package/dist/types/{components → payos-react/src/components}/payos/views/OTPView.d.ts +0 -1
- package/dist/types/payos-react/src/components/payos/views/ShareCardsView.d.ts +28 -0
- package/dist/types/{components → payos-react/src/components}/payos/views/SuccessView.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/views/VisaIframeView.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/payos/views/VisaMethodView.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/views/VisaOtpView.d.ts +0 -1
- package/dist/{components → types/payos-react/src/components}/payos/views/WelcomeBackView.d.ts +0 -1
- package/dist/types/payos-react/src/components/ui/CardArt.d.ts +22 -0
- package/dist/types/{components → payos-react/src/components}/ui/CardBrandIcon.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/ui/ConfirmDialog.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/ui/DigitalCard.d.ts +0 -1
- package/dist/types/payos-react/src/components/ui/HelpPopover.d.ts +17 -0
- package/dist/types/{components → payos-react/src/components}/ui/button.d.ts +1 -2
- package/dist/types/{components → payos-react/src/components}/ui/card.d.ts +1 -2
- package/dist/types/{components → payos-react/src/components}/ui/input.d.ts +0 -1
- package/dist/types/{components → payos-react/src/components}/ui/label.d.ts +1 -2
- package/dist/types/{components → payos-react/src/components}/ui/separator.d.ts +0 -1
- package/dist/{hooks → types/payos-react/src/hooks}/useBiometricType.d.ts +0 -1
- package/dist/types/{hooks → payos-react/src/hooks}/useBodyScrollLock.d.ts +0 -1
- package/dist/types/{hooks → payos-react/src/hooks}/useCardElement.d.ts +1 -2
- package/dist/types/{hooks → payos-react/src/hooks}/useLinkAuth.d.ts +0 -1
- package/dist/types/{hooks → payos-react/src/hooks}/useLinkDeviceAuthPoll.d.ts +0 -1
- package/dist/types/{hooks → payos-react/src/hooks}/useLinkMethods.d.ts +0 -1
- package/dist/{hooks → types/payos-react/src/hooks}/useLinkSession.d.ts +0 -1
- package/dist/{hooks → types/payos-react/src/hooks}/useLinkSpendStatusPoll.d.ts +0 -1
- package/dist/types/{hooks → payos-react/src/hooks}/usePasskeySDK.d.ts +2 -4
- package/dist/{hooks → types/payos-react/src/hooks}/useSession.d.ts +14 -1
- package/dist/types/{hooks → payos-react/src/hooks}/useVisualViewport.d.ts +0 -1
- package/dist/{index.d.ts → types/payos-react/src/index.d.ts} +3 -4
- package/dist/{lib → types/payos-react/src/lib}/utils.d.ts +0 -1
- package/dist/{services → types/payos-react/src/services}/apiService.d.ts +14 -3
- package/dist/{services → types/payos-react/src/services}/linkTokenService.d.ts +0 -1
- package/dist/types/{cardElement.d.ts → payos-react/src/types/cardElement.d.ts} +2 -3
- package/dist/types/{drawer.d.ts → payos-react/src/types/drawer.d.ts} +0 -1
- package/dist/types/{types → payos-react/src/types}/index.d.ts +0 -1
- package/dist/types/{order.d.ts → payos-react/src/types/order.d.ts} +0 -1
- package/dist/types/{types → payos-react/src/types}/payment.d.ts +1 -2
- package/dist/types/{session.d.ts → payos-react/src/types/session.d.ts} +18 -2
- package/dist/types/{utils → payos-react/src/utils}/credentialStatus.d.ts +0 -1
- package/dist/{utils → types/payos-react/src/utils}/deviceFingerprint.d.ts +0 -1
- package/dist/types/payos-react/src/utils/ensureSelectedCardAttached.d.ts +10 -0
- package/dist/types/{utils → payos-react/src/utils}/environment.d.ts +0 -1
- package/dist/{utils → types/payos-react/src/utils}/formatting.d.ts +0 -1
- package/dist/types/{utils → payos-react/src/utils}/linkPopup.d.ts +0 -1
- package/dist/types/payos-react/src/utils/organizationName.d.ts +8 -0
- package/dist/types/{utils → payos-react/src/utils}/selectCard.d.ts +0 -1
- package/dist/types/{utils → payos-react/src/utils}/text.d.ts +0 -1
- package/dist/{utils → types/payos-react/src/utils}/validation.d.ts +0 -1
- package/package.json +38 -13
- package/dist/components/identity/IdentityBar.d.ts +0 -8
- package/dist/components/identity/IdentityBar.d.ts.map +0 -1
- package/dist/components/order/OrderSummaryAccordion.d.ts +0 -9
- package/dist/components/order/OrderSummaryAccordion.d.ts.map +0 -1
- package/dist/components/order/ShipmentCard.d.ts +0 -8
- package/dist/components/order/ShipmentCard.d.ts.map +0 -1
- package/dist/components/payos/ActiveCardWidget.d.ts.map +0 -1
- package/dist/components/payos/AgentRegistrationFlow.d.ts.map +0 -1
- package/dist/components/payos/ConnectStripeLinkButton.d.ts.map +0 -1
- package/dist/components/payos/IdentityVerificationFlow.d.ts +0 -26
- package/dist/components/payos/IdentityVerificationFlow.d.ts.map +0 -1
- package/dist/components/payos/LinkPaymentFlow.d.ts.map +0 -1
- package/dist/components/payos/LinkSessionContent.d.ts.map +0 -1
- package/dist/components/payos/PayOSFooter.d.ts +0 -25
- package/dist/components/payos/PayOSFooter.d.ts.map +0 -1
- package/dist/components/payos/PayWithLinkButton.d.ts +0 -74
- package/dist/components/payos/PayWithLinkButton.d.ts.map +0 -1
- package/dist/components/payos/PaymentMethodRow.d.ts.map +0 -1
- package/dist/components/payos/PaymentSheet.d.ts.map +0 -1
- package/dist/components/payos/PaymentSheetContent.d.ts +0 -80
- package/dist/components/payos/PaymentSheetContent.d.ts.map +0 -1
- package/dist/components/payos/PaymentSheetPaymentFlow.d.ts +0 -43
- package/dist/components/payos/PaymentSheetPaymentFlow.d.ts.map +0 -1
- package/dist/components/payos/PaymentSheetShell.d.ts.map +0 -1
- package/dist/components/payos/PaymentSheetStatusViews.d.ts +0 -28
- package/dist/components/payos/PaymentSheetStatusViews.d.ts.map +0 -1
- package/dist/components/payos/PriceTag.d.ts +0 -64
- package/dist/components/payos/PriceTag.d.ts.map +0 -1
- package/dist/components/payos/ReceiptPanel.d.ts +0 -67
- package/dist/components/payos/ReceiptPanel.d.ts.map +0 -1
- package/dist/components/payos/ViewHeader.d.ts +0 -9
- package/dist/components/payos/ViewHeader.d.ts.map +0 -1
- package/dist/components/payos/drawer.d.ts +0 -107
- package/dist/components/payos/drawer.d.ts.map +0 -1
- package/dist/components/payos/order-summary.d.ts.map +0 -1
- package/dist/components/payos/otp-input.d.ts.map +0 -1
- package/dist/components/payos/phone-input.d.ts +0 -30
- package/dist/components/payos/phone-input.d.ts.map +0 -1
- package/dist/components/payos/themeMode.d.ts.map +0 -1
- package/dist/components/payos/usePaymentSheetDebug.d.ts +0 -22
- package/dist/components/payos/usePaymentSheetDebug.d.ts.map +0 -1
- package/dist/components/payos/usePaymentSheetDisplayData.d.ts +0 -29
- package/dist/components/payos/usePaymentSheetDisplayData.d.ts.map +0 -1
- package/dist/components/payos/usePaymentSheetLifecycle.d.ts +0 -39
- package/dist/components/payos/usePaymentSheetLifecycle.d.ts.map +0 -1
- package/dist/components/payos/usePaymentSheetSkipToAuth.d.ts.map +0 -1
- package/dist/components/payos/usePaymentSheetSkipToLink.d.ts.map +0 -1
- package/dist/components/payos/views/AgentRegistrationView.d.ts.map +0 -1
- package/dist/components/payos/views/CardAddView.d.ts +0 -101
- package/dist/components/payos/views/CardAddView.d.ts.map +0 -1
- package/dist/components/payos/views/CheckoutView.d.ts +0 -95
- package/dist/components/payos/views/CheckoutView.d.ts.map +0 -1
- package/dist/components/payos/views/IdentityView.d.ts +0 -51
- package/dist/components/payos/views/IdentityView.d.ts.map +0 -1
- package/dist/components/payos/views/LinkBrand.d.ts.map +0 -1
- package/dist/components/payos/views/LinkCheckoutView.d.ts.map +0 -1
- package/dist/components/payos/views/LinkConnectView.d.ts +0 -18
- package/dist/components/payos/views/LinkConnectView.d.ts.map +0 -1
- package/dist/components/payos/views/LinkDeniedView.d.ts +0 -13
- package/dist/components/payos/views/LinkDeniedView.d.ts.map +0 -1
- package/dist/components/payos/views/LinkLoadingView.d.ts.map +0 -1
- package/dist/components/payos/views/LinkSuccessView.d.ts +0 -11
- package/dist/components/payos/views/LinkSuccessView.d.ts.map +0 -1
- package/dist/components/payos/views/ManageThirdPartyView.d.ts.map +0 -1
- package/dist/components/payos/views/MethodListView.d.ts.map +0 -1
- package/dist/components/payos/views/OTPView.d.ts +0 -69
- package/dist/components/payos/views/OTPView.d.ts.map +0 -1
- package/dist/components/payos/views/SuccessView.d.ts +0 -49
- package/dist/components/payos/views/SuccessView.d.ts.map +0 -1
- package/dist/components/payos/views/VisaIframeView.d.ts.map +0 -1
- package/dist/components/payos/views/VisaMethodView.d.ts +0 -23
- package/dist/components/payos/views/VisaMethodView.d.ts.map +0 -1
- package/dist/components/payos/views/VisaOtpView.d.ts.map +0 -1
- package/dist/components/payos/views/WelcomeBackView.d.ts.map +0 -1
- package/dist/components/ui/CardBrandIcon.d.ts +0 -10
- package/dist/components/ui/CardBrandIcon.d.ts.map +0 -1
- package/dist/components/ui/ConfirmDialog.d.ts +0 -25
- package/dist/components/ui/ConfirmDialog.d.ts.map +0 -1
- package/dist/components/ui/DigitalCard.d.ts +0 -13
- package/dist/components/ui/DigitalCard.d.ts.map +0 -1
- package/dist/components/ui/InfoTooltip.d.ts +0 -8
- package/dist/components/ui/InfoTooltip.d.ts.map +0 -1
- package/dist/components/ui/PinInput.d.ts +0 -12
- package/dist/components/ui/PinInput.d.ts.map +0 -1
- package/dist/components/ui/button.d.ts +0 -14
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/card.d.ts +0 -15
- package/dist/components/ui/card.d.ts.map +0 -1
- package/dist/components/ui/input.d.ts +0 -6
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/label.d.ts +0 -6
- package/dist/components/ui/label.d.ts.map +0 -1
- package/dist/components/ui/separator.d.ts +0 -5
- package/dist/components/ui/separator.d.ts.map +0 -1
- package/dist/hooks/index.d.ts +0 -8
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/useBiometricType.d.ts.map +0 -1
- package/dist/hooks/useBodyScrollLock.d.ts +0 -32
- package/dist/hooks/useBodyScrollLock.d.ts.map +0 -1
- package/dist/hooks/useCardElement.d.ts +0 -135
- package/dist/hooks/useCardElement.d.ts.map +0 -1
- package/dist/hooks/useCheckoutFlow.d.ts +0 -29
- package/dist/hooks/useCheckoutFlow.d.ts.map +0 -1
- package/dist/hooks/useDrawerState.d.ts +0 -4
- package/dist/hooks/useDrawerState.d.ts.map +0 -1
- package/dist/hooks/useLinkAuth.d.ts +0 -24
- package/dist/hooks/useLinkAuth.d.ts.map +0 -1
- package/dist/hooks/useLinkDeviceAuthPoll.d.ts +0 -29
- package/dist/hooks/useLinkDeviceAuthPoll.d.ts.map +0 -1
- package/dist/hooks/useLinkMethods.d.ts +0 -28
- package/dist/hooks/useLinkMethods.d.ts.map +0 -1
- package/dist/hooks/useLinkSession.d.ts.map +0 -1
- package/dist/hooks/useLinkSpendStatusPoll.d.ts.map +0 -1
- package/dist/hooks/usePasskeySDK.d.ts +0 -103
- package/dist/hooks/usePasskeySDK.d.ts.map +0 -1
- package/dist/hooks/useSession.d.ts.map +0 -1
- package/dist/hooks/useVisualViewport.d.ts +0 -15
- package/dist/hooks/useVisualViewport.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/theme.d.ts +0 -53
- package/dist/lib/theme.d.ts.map +0 -1
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/mocks/index.d.ts +0 -3
- package/dist/mocks/index.d.ts.map +0 -1
- package/dist/mocks/mockCheckoutFlow.d.ts +0 -25
- package/dist/mocks/mockCheckoutFlow.d.ts.map +0 -1
- package/dist/mocks/mockData.d.ts +0 -6
- package/dist/mocks/mockData.d.ts.map +0 -1
- package/dist/mocks/mockSessionData.d.ts +0 -38
- package/dist/mocks/mockSessionData.d.ts.map +0 -1
- package/dist/services/apiService.d.ts.map +0 -1
- package/dist/services/linkTokenService.d.ts.map +0 -1
- package/dist/services/mockSessionService.d.ts +0 -65
- package/dist/services/mockSessionService.d.ts.map +0 -1
- package/dist/types/cardElement.d.ts.map +0 -1
- package/dist/types/components/identity/IdentityBar.d.ts +0 -8
- package/dist/types/components/identity/IdentityBar.d.ts.map +0 -1
- package/dist/types/components/order/OrderSummaryAccordion.d.ts +0 -9
- package/dist/types/components/order/OrderSummaryAccordion.d.ts.map +0 -1
- package/dist/types/components/order/ShipmentCard.d.ts +0 -8
- package/dist/types/components/order/ShipmentCard.d.ts.map +0 -1
- package/dist/types/components/payos/ActiveCardWidget.d.ts +0 -60
- package/dist/types/components/payos/ActiveCardWidget.d.ts.map +0 -1
- package/dist/types/components/payos/AgentRegistrationFlow.d.ts +0 -24
- package/dist/types/components/payos/AgentRegistrationFlow.d.ts.map +0 -1
- package/dist/types/components/payos/ConnectStripeLinkButton.d.ts +0 -41
- package/dist/types/components/payos/ConnectStripeLinkButton.d.ts.map +0 -1
- package/dist/types/components/payos/IdentityVerificationFlow.d.ts.map +0 -1
- package/dist/types/components/payos/LinkPaymentFlow.d.ts +0 -11
- package/dist/types/components/payos/LinkPaymentFlow.d.ts.map +0 -1
- package/dist/types/components/payos/LinkSessionContent.d.ts +0 -19
- package/dist/types/components/payos/LinkSessionContent.d.ts.map +0 -1
- package/dist/types/components/payos/PayOSFooter.d.ts.map +0 -1
- package/dist/types/components/payos/PayWithLinkButton.d.ts.map +0 -1
- package/dist/types/components/payos/PaymentMethodRow.d.ts +0 -53
- package/dist/types/components/payos/PaymentMethodRow.d.ts.map +0 -1
- package/dist/types/components/payos/PaymentSheet.d.ts +0 -121
- package/dist/types/components/payos/PaymentSheet.d.ts.map +0 -1
- package/dist/types/components/payos/PaymentSheetContent.d.ts.map +0 -1
- package/dist/types/components/payos/PaymentSheetPaymentFlow.d.ts.map +0 -1
- package/dist/types/components/payos/PaymentSheetShell.d.ts +0 -25
- package/dist/types/components/payos/PaymentSheetShell.d.ts.map +0 -1
- package/dist/types/components/payos/PaymentSheetStatusViews.d.ts.map +0 -1
- package/dist/types/components/payos/PriceTag.d.ts.map +0 -1
- package/dist/types/components/payos/ReceiptPanel.d.ts.map +0 -1
- package/dist/types/components/payos/ViewHeader.d.ts.map +0 -1
- package/dist/types/components/payos/drawer.d.ts.map +0 -1
- package/dist/types/components/payos/order-summary.d.ts +0 -44
- package/dist/types/components/payos/order-summary.d.ts.map +0 -1
- package/dist/types/components/payos/otp-input.d.ts +0 -45
- package/dist/types/components/payos/otp-input.d.ts.map +0 -1
- package/dist/types/components/payos/phone-input.d.ts.map +0 -1
- package/dist/types/components/payos/themeMode.d.ts +0 -6
- package/dist/types/components/payos/themeMode.d.ts.map +0 -1
- package/dist/types/components/payos/usePaymentSheetDebug.d.ts +0 -22
- package/dist/types/components/payos/usePaymentSheetDebug.d.ts.map +0 -1
- package/dist/types/components/payos/usePaymentSheetDisplayData.d.ts.map +0 -1
- package/dist/types/components/payos/usePaymentSheetLifecycle.d.ts.map +0 -1
- package/dist/types/components/payos/usePaymentSheetSkipToAuth.d.ts +0 -18
- package/dist/types/components/payos/usePaymentSheetSkipToAuth.d.ts.map +0 -1
- package/dist/types/components/payos/usePaymentSheetSkipToLink.d.ts +0 -14
- package/dist/types/components/payos/usePaymentSheetSkipToLink.d.ts.map +0 -1
- package/dist/types/components/payos/views/AgentRegistrationView.d.ts +0 -61
- package/dist/types/components/payos/views/AgentRegistrationView.d.ts.map +0 -1
- package/dist/types/components/payos/views/CardAddView.d.ts.map +0 -1
- package/dist/types/components/payos/views/CheckoutView.d.ts.map +0 -1
- package/dist/types/components/payos/views/IdentityView.d.ts.map +0 -1
- package/dist/types/components/payos/views/LinkBrand.d.ts +0 -13
- package/dist/types/components/payos/views/LinkBrand.d.ts.map +0 -1
- package/dist/types/components/payos/views/LinkCheckoutView.d.ts +0 -31
- package/dist/types/components/payos/views/LinkCheckoutView.d.ts.map +0 -1
- package/dist/types/components/payos/views/LinkConnectView.d.ts.map +0 -1
- package/dist/types/components/payos/views/LinkDeniedView.d.ts.map +0 -1
- package/dist/types/components/payos/views/LinkLoadingView.d.ts +0 -11
- package/dist/types/components/payos/views/LinkLoadingView.d.ts.map +0 -1
- package/dist/types/components/payos/views/LinkSuccessView.d.ts.map +0 -1
- package/dist/types/components/payos/views/ManageThirdPartyView.d.ts +0 -19
- package/dist/types/components/payos/views/ManageThirdPartyView.d.ts.map +0 -1
- package/dist/types/components/payos/views/MethodListView.d.ts +0 -116
- package/dist/types/components/payos/views/MethodListView.d.ts.map +0 -1
- package/dist/types/components/payos/views/OTPView.d.ts.map +0 -1
- package/dist/types/components/payos/views/SuccessView.d.ts.map +0 -1
- package/dist/types/components/payos/views/VisaIframeView.d.ts +0 -16
- package/dist/types/components/payos/views/VisaIframeView.d.ts.map +0 -1
- package/dist/types/components/payos/views/VisaMethodView.d.ts.map +0 -1
- package/dist/types/components/payos/views/VisaOtpView.d.ts +0 -45
- package/dist/types/components/payos/views/VisaOtpView.d.ts.map +0 -1
- package/dist/types/components/payos/views/WelcomeBackView.d.ts +0 -34
- package/dist/types/components/payos/views/WelcomeBackView.d.ts.map +0 -1
- package/dist/types/components/ui/CardBrandIcon.d.ts.map +0 -1
- package/dist/types/components/ui/ConfirmDialog.d.ts.map +0 -1
- package/dist/types/components/ui/DigitalCard.d.ts.map +0 -1
- package/dist/types/components/ui/InfoTooltip.d.ts +0 -8
- package/dist/types/components/ui/InfoTooltip.d.ts.map +0 -1
- package/dist/types/components/ui/PinInput.d.ts +0 -12
- package/dist/types/components/ui/PinInput.d.ts.map +0 -1
- package/dist/types/components/ui/button.d.ts.map +0 -1
- package/dist/types/components/ui/card.d.ts.map +0 -1
- package/dist/types/components/ui/input.d.ts.map +0 -1
- package/dist/types/components/ui/label.d.ts.map +0 -1
- package/dist/types/components/ui/separator.d.ts.map +0 -1
- package/dist/types/drawer.d.ts.map +0 -1
- package/dist/types/hooks/index.d.ts +0 -8
- package/dist/types/hooks/index.d.ts.map +0 -1
- package/dist/types/hooks/useBiometricType.d.ts +0 -21
- package/dist/types/hooks/useBiometricType.d.ts.map +0 -1
- package/dist/types/hooks/useBodyScrollLock.d.ts.map +0 -1
- package/dist/types/hooks/useCardElement.d.ts.map +0 -1
- package/dist/types/hooks/useCheckoutFlow.d.ts +0 -29
- package/dist/types/hooks/useCheckoutFlow.d.ts.map +0 -1
- package/dist/types/hooks/useDrawerState.d.ts +0 -4
- package/dist/types/hooks/useDrawerState.d.ts.map +0 -1
- package/dist/types/hooks/useLinkAuth.d.ts.map +0 -1
- package/dist/types/hooks/useLinkDeviceAuthPoll.d.ts.map +0 -1
- package/dist/types/hooks/useLinkMethods.d.ts.map +0 -1
- package/dist/types/hooks/useLinkSession.d.ts +0 -81
- package/dist/types/hooks/useLinkSession.d.ts.map +0 -1
- package/dist/types/hooks/useLinkSpendStatusPoll.d.ts +0 -28
- package/dist/types/hooks/useLinkSpendStatusPoll.d.ts.map +0 -1
- package/dist/types/hooks/usePasskeySDK.d.ts.map +0 -1
- package/dist/types/hooks/useSession.d.ts +0 -87
- package/dist/types/hooks/useSession.d.ts.map +0 -1
- package/dist/types/hooks/useVisualViewport.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/lib/theme.d.ts +0 -53
- package/dist/types/lib/theme.d.ts.map +0 -1
- package/dist/types/lib/utils.d.ts +0 -3
- package/dist/types/lib/utils.d.ts.map +0 -1
- package/dist/types/mocks/index.d.ts +0 -3
- package/dist/types/mocks/index.d.ts.map +0 -1
- package/dist/types/mocks/mockCheckoutFlow.d.ts +0 -25
- package/dist/types/mocks/mockCheckoutFlow.d.ts.map +0 -1
- package/dist/types/mocks/mockData.d.ts +0 -6
- package/dist/types/mocks/mockData.d.ts.map +0 -1
- package/dist/types/mocks/mockSessionData.d.ts +0 -38
- package/dist/types/mocks/mockSessionData.d.ts.map +0 -1
- package/dist/types/order.d.ts.map +0 -1
- package/dist/types/payment.d.ts +0 -55
- package/dist/types/payment.d.ts.map +0 -1
- package/dist/types/services/apiService.d.ts +0 -406
- package/dist/types/services/apiService.d.ts.map +0 -1
- package/dist/types/services/linkTokenService.d.ts +0 -7
- package/dist/types/services/linkTokenService.d.ts.map +0 -1
- package/dist/types/services/mockSessionService.d.ts +0 -65
- package/dist/types/services/mockSessionService.d.ts.map +0 -1
- package/dist/types/session.d.ts.map +0 -1
- package/dist/types/types/cardElement.d.ts +0 -157
- package/dist/types/types/cardElement.d.ts.map +0 -1
- package/dist/types/types/drawer.d.ts +0 -33
- package/dist/types/types/drawer.d.ts.map +0 -1
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/types/order.d.ts +0 -25
- package/dist/types/types/order.d.ts.map +0 -1
- package/dist/types/types/payment.d.ts.map +0 -1
- package/dist/types/types/session.d.ts +0 -165
- package/dist/types/types/session.d.ts.map +0 -1
- package/dist/types/utils/credentialStatus.d.ts.map +0 -1
- package/dist/types/utils/deviceFingerprint.d.ts +0 -27
- package/dist/types/utils/deviceFingerprint.d.ts.map +0 -1
- package/dist/types/utils/environment.d.ts.map +0 -1
- package/dist/types/utils/formatting.d.ts +0 -41
- package/dist/types/utils/formatting.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/linkFormat.d.ts +0 -17
- package/dist/types/utils/linkFormat.d.ts.map +0 -1
- package/dist/types/utils/linkPopup.d.ts.map +0 -1
- package/dist/types/utils/selectCard.d.ts.map +0 -1
- package/dist/types/utils/text.d.ts.map +0 -1
- package/dist/types/utils/validation.d.ts +0 -90
- package/dist/types/utils/validation.d.ts.map +0 -1
- package/dist/utils/credentialStatus.d.ts +0 -8
- package/dist/utils/credentialStatus.d.ts.map +0 -1
- package/dist/utils/deviceFingerprint.d.ts.map +0 -1
- package/dist/utils/environment.d.ts +0 -22
- package/dist/utils/environment.d.ts.map +0 -1
- package/dist/utils/formatting.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/linkFormat.d.ts +0 -17
- package/dist/utils/linkFormat.d.ts.map +0 -1
- package/dist/utils/linkPopup.d.ts +0 -19
- package/dist/utils/linkPopup.d.ts.map +0 -1
- package/dist/utils/selectCard.d.ts +0 -18
- package/dist/utils/selectCard.d.ts.map +0 -1
- package/dist/utils/text.d.ts +0 -12
- package/dist/utils/text.d.ts.map +0 -1
- package/dist/utils/validation.d.ts.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,57 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { Input } from './components/ui/input';
|
|
3
|
-
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './components/ui/card';
|
|
4
|
-
export { Label } from './components/ui/label';
|
|
5
|
-
export { Separator } from './components/ui/separator';
|
|
6
|
-
export { PhoneInput, COUNTRIES } from './components/payos/phone-input';
|
|
7
|
-
export { OTPInput } from './components/payos/otp-input';
|
|
8
|
-
export { PayOSDrawer } from './components/payos/drawer';
|
|
9
|
-
export { PaymentMethodRow } from './components/payos/PaymentMethodRow';
|
|
10
|
-
export { ActiveCardWidget } from './components/payos/ActiveCardWidget';
|
|
11
|
-
export { ViewHeader } from './components/payos/ViewHeader';
|
|
12
|
-
export { OrderSummary } from './components/payos/order-summary';
|
|
13
|
-
export { PriceTag } from './components/payos/PriceTag';
|
|
14
|
-
export { ReceiptPanel } from './components/payos/ReceiptPanel';
|
|
15
|
-
export type { OrderItem } from './components/payos/ReceiptPanel';
|
|
16
|
-
export { PayOSFooter } from './components/payos/PayOSFooter';
|
|
17
|
-
export { IdentityView } from './components/payos/views/IdentityView';
|
|
18
|
-
export { WelcomeBackView } from './components/payos/views/WelcomeBackView';
|
|
19
|
-
export { OTPView } from './components/payos/views/OTPView';
|
|
20
|
-
export { CheckoutView } from './components/payos/views/CheckoutView';
|
|
21
|
-
export { MethodListView } from './components/payos/views/MethodListView';
|
|
22
|
-
export { CardAddView } from './components/payos/views/CardAddView';
|
|
23
|
-
export { SuccessView } from './components/payos/views/SuccessView';
|
|
24
|
-
export type { SuccessViewProps } from './components/payos/views/SuccessView';
|
|
25
|
-
export { VisaMethodView } from './components/payos/views/VisaMethodView';
|
|
26
|
-
export type { VisaMethodViewProps, VisaVerificationMethod } from './components/payos/views/VisaMethodView';
|
|
27
|
-
export { VisaOtpView } from './components/payos/views/VisaOtpView';
|
|
28
|
-
export type { VisaOtpViewProps } from './components/payos/views/VisaOtpView';
|
|
29
|
-
export { AgentRegistrationView } from './components/payos/views/AgentRegistrationView';
|
|
30
|
-
export type { AgentRegistrationViewProps } from './components/payos/views/AgentRegistrationView';
|
|
31
|
-
export { PaymentSheet } from './components/payos/PaymentSheet';
|
|
32
|
-
export type { PaymentSheetPaymentMethods, PaymentSheetProps, StripeLinkPaymentMethodConfig, } from './components/payos/PaymentSheet';
|
|
33
|
-
export { ConnectStripeLinkButton } from './components/payos/ConnectStripeLinkButton';
|
|
34
|
-
export type { ConnectStripeLinkButtonProps, ConnectStripeLinkResult, } from './components/payos/ConnectStripeLinkButton';
|
|
35
|
-
export { PayWithLinkButton } from './components/payos/PayWithLinkButton';
|
|
36
|
-
export type { PayWithLinkButtonProps } from './components/payos/PayWithLinkButton';
|
|
37
|
-
export { LinkConnectView } from './components/payos/views/LinkConnectView';
|
|
38
|
-
export { LinkCheckoutView } from './components/payos/views/LinkCheckoutView';
|
|
39
|
-
export { LinkSuccessView } from './components/payos/views/LinkSuccessView';
|
|
40
|
-
export { LinkDeniedView } from './components/payos/views/LinkDeniedView';
|
|
41
|
-
export { LinkLoadingView } from './components/payos/views/LinkLoadingView';
|
|
42
|
-
export { ManageThirdPartyView } from './components/payos/views/ManageThirdPartyView';
|
|
43
|
-
export { useLinkSession } from './hooks/useLinkSession';
|
|
44
|
-
export type { LinkPhase, UseLinkSessionReturn } from './hooks/useLinkSession';
|
|
45
|
-
export { useLinkAuth } from './hooks/useLinkAuth';
|
|
46
|
-
export { useLinkMethods } from './hooks/useLinkMethods';
|
|
47
|
-
export { useCheckoutFlow } from './hooks/useCheckoutFlow';
|
|
48
|
-
export { useSession } from './hooks/useSession';
|
|
49
|
-
export type { UseSessionReturn, SessionPhase, PaymentView as SessionPaymentView } from './hooks/useSession';
|
|
50
|
-
export { useCardElement } from './hooks/useCardElement';
|
|
51
|
-
export type { CardElementBinWarningEvent, CardElementBinWarningRule, UseCardElementOptions, UseCardElementReturn, } from './hooks/useCardElement';
|
|
52
|
-
export { useBodyScrollLock } from './hooks/useBodyScrollLock';
|
|
53
|
-
export { useVisualViewport, useVisualViewportStyle } from './hooks/useVisualViewport';
|
|
54
|
-
export type { PaymentView, CheckoutPhase, SavedCard, CardData, CardBrand } from './types';
|
|
55
|
-
export type { SessionType, SessionStatus, PaymentIntentType, MultiPaymentIntent, PaymentIntentStatus, WalletUser, SavedCard as SessionSavedCard, CardNetwork, CheckoutSession, SessionError, SessionErrorCode, VerificationInitResult, VerificationResult, CompletionResult, PaymentSheetResult, PaymentSheetError, } from './types/session';
|
|
56
|
-
export { cn } from './lib/utils';
|
|
57
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './payos-react/src/index';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Client for PayOS backend communication
|
|
3
|
+
*/
|
|
4
|
+
export declare class ApiClient {
|
|
5
|
+
private linkToken;
|
|
6
|
+
private baseUrl;
|
|
7
|
+
constructor(linkToken: string, sandbox?: boolean, apiBaseUrl?: string);
|
|
8
|
+
/**
|
|
9
|
+
* Make a GET request
|
|
10
|
+
*/
|
|
11
|
+
get<T = any>(path: string): Promise<T>;
|
|
12
|
+
/**
|
|
13
|
+
* Make a POST request
|
|
14
|
+
*/
|
|
15
|
+
post<T = any>(path: string, body?: any): Promise<T>;
|
|
16
|
+
/**
|
|
17
|
+
* Make a PUT request
|
|
18
|
+
*/
|
|
19
|
+
put<T = any>(path: string, body?: any): Promise<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Make a DELETE request
|
|
22
|
+
*/
|
|
23
|
+
delete<T = any>(path: string): Promise<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Generic request method
|
|
26
|
+
*/
|
|
27
|
+
private request;
|
|
28
|
+
/**
|
|
29
|
+
* Parse response body
|
|
30
|
+
*/
|
|
31
|
+
private parseResponse;
|
|
32
|
+
/**
|
|
33
|
+
* Update base URL
|
|
34
|
+
*/
|
|
35
|
+
setBaseUrl(url: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Update link token
|
|
38
|
+
*/
|
|
39
|
+
setLinkToken(token: string): void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* API Error class
|
|
43
|
+
*/
|
|
44
|
+
export declare class ApiError extends Error {
|
|
45
|
+
status: number;
|
|
46
|
+
data?: any | undefined;
|
|
47
|
+
constructor(status: number, message: string, data?: any | undefined);
|
|
48
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { PasskeyResult, RegisterResult, OTPSubmitResult, PasskeyFlowResult, PayOSPasskeyOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Diagnostics go to `/api/passkeys/diagnostics` so every SDK call stays under
|
|
4
|
+
* one prefix and a reseller proxy only has to forward `/api/passkeys/*`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDiagnosticsEndpointUrl(sandbox?: boolean, apiBaseUrl?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Main PayOS Passkey SDK class
|
|
9
|
+
* Provides simple methods for passkey authentication and registration
|
|
10
|
+
*/
|
|
11
|
+
export declare class PayOSPasskey {
|
|
12
|
+
private apiClient;
|
|
13
|
+
private visaService;
|
|
14
|
+
private mastercardService;
|
|
15
|
+
private logger;
|
|
16
|
+
private sdkConfig;
|
|
17
|
+
private isInitialized;
|
|
18
|
+
private initPromise;
|
|
19
|
+
private instanceId;
|
|
20
|
+
private onStepUp;
|
|
21
|
+
private onOtp;
|
|
22
|
+
/** Base delay between complete-device-binding retries (ms); scaled by attempt. */
|
|
23
|
+
private bindRetryDelayMs;
|
|
24
|
+
/**
|
|
25
|
+
* @param linkToken - Session secret (from `POST /api/sessions/agentic-setup` or
|
|
26
|
+
* `/api/sessions/checkout`) or a link token.
|
|
27
|
+
*/
|
|
28
|
+
constructor(linkToken: string, options?: PayOSPasskeyOptions);
|
|
29
|
+
/**
|
|
30
|
+
* Initialize SDK - fetch config and load SDKs
|
|
31
|
+
* Called automatically in constructor
|
|
32
|
+
*/
|
|
33
|
+
private initialize;
|
|
34
|
+
private performInitialization;
|
|
35
|
+
/**
|
|
36
|
+
* Run the passkey flow.
|
|
37
|
+
*
|
|
38
|
+
* - `authenticate()` (no arguments): the server resolves what to do from the
|
|
39
|
+
* session secret (agentic setup for an enrollment, or a checkout intent)
|
|
40
|
+
* and the SDK follows its `flowType`. Visa step-up goes through the
|
|
41
|
+
* `onStepUp` / `onOtp` options.
|
|
42
|
+
* - `authenticate(paymentIntentId, paymentId?)`: authenticate a payment
|
|
43
|
+
* (unchanged wallet behaviour).
|
|
44
|
+
*
|
|
45
|
+
* Every result carries `{status, flowType, network, vicEnrolled, vicError?}`.
|
|
46
|
+
*/
|
|
47
|
+
authenticate(): Promise<PasskeyFlowResult>;
|
|
48
|
+
authenticate(paymentIntentId: string, paymentId?: string): Promise<PasskeyFlowResult>;
|
|
49
|
+
private authenticateIntent;
|
|
50
|
+
/**
|
|
51
|
+
* Transaction authentication after the start call (wallet intent flow, and
|
|
52
|
+
* a checkout session secret used with authenticate()).
|
|
53
|
+
*/
|
|
54
|
+
private continueTransactionAuthentication;
|
|
55
|
+
/**
|
|
56
|
+
* Visa session context ({ sessionContext, browserData }) for the start call.
|
|
57
|
+
* Empty when the Visa SDK is not loaded; the backend handles that.
|
|
58
|
+
*/
|
|
59
|
+
private collectVisaSessionContext;
|
|
60
|
+
/** Adds the common flow fields to a transaction-authentication result. */
|
|
61
|
+
private decorateTransactionResult;
|
|
62
|
+
/**
|
|
63
|
+
* authenticate() with no arguments: the session secret decides the subject.
|
|
64
|
+
*/
|
|
65
|
+
private authenticateWithSession;
|
|
66
|
+
/**
|
|
67
|
+
* Registration subject (agentic setup): passkey ceremony, then
|
|
68
|
+
* complete-device-binding, which runs VIC enrollment on the server.
|
|
69
|
+
*/
|
|
70
|
+
private runRegistrationSubject;
|
|
71
|
+
private runVisaRegistrationSubject;
|
|
72
|
+
private visaCeremonyThenBind;
|
|
73
|
+
private runMastercardRegistrationSubject;
|
|
74
|
+
/**
|
|
75
|
+
* Visa step-up through the reseller's callbacks. Returns the registration
|
|
76
|
+
* context on success, or the terminal result.
|
|
77
|
+
*/
|
|
78
|
+
private runStepUp;
|
|
79
|
+
/** Shows the Visa frame, runs one AUTHENTICATE command, hides the frame. */
|
|
80
|
+
private runVisaCeremony;
|
|
81
|
+
/**
|
|
82
|
+
* complete-device-binding, retried while another request holds the VIC lock
|
|
83
|
+
* (409 agentic_enrollment_in_progress). The result reports the VIC outcome.
|
|
84
|
+
*/
|
|
85
|
+
private bindAndReport;
|
|
86
|
+
/**
|
|
87
|
+
* Register a card for passkey authentication
|
|
88
|
+
* Returns unified RegisterResult for both networks
|
|
89
|
+
*/
|
|
90
|
+
register(cardId: string): Promise<RegisterResult>;
|
|
91
|
+
/**
|
|
92
|
+
* Complete VIC enrollment using assurance data from passkey authentication
|
|
93
|
+
* Called when passkey exists but VIC enrollment was not completed
|
|
94
|
+
*/
|
|
95
|
+
completeVicEnrollment(enrollmentId: string, assuranceData: any): Promise<PasskeyResult>;
|
|
96
|
+
/**
|
|
97
|
+
* Authenticate using existing passkey and complete VIC enrollment
|
|
98
|
+
* Used when passkey exists but VIC enrollment was not completed
|
|
99
|
+
* @param enrollmentId - The enrollment ID from the registration flow
|
|
100
|
+
* @param authenticationContext - The authentication context from Visa for passkey assertion
|
|
101
|
+
*/
|
|
102
|
+
authenticateForVicEnrollment(enrollmentId: string, authenticationContext: any): Promise<PasskeyResult>;
|
|
103
|
+
/**
|
|
104
|
+
* Submit step-up method selection for Visa registration
|
|
105
|
+
*/
|
|
106
|
+
submitStepUpMethod(enrollmentId: string, methodIndex: number): Promise<OTPSubmitResult>;
|
|
107
|
+
/**
|
|
108
|
+
* Validate OTP for step-up authentication
|
|
109
|
+
* Returns registrationContext for the caller to trigger SDK registration
|
|
110
|
+
* (This allows React to render the iframe container first)
|
|
111
|
+
*/
|
|
112
|
+
validateStepUpOTP(enrollmentId: string, otpValue: string): Promise<PasskeyResult>;
|
|
113
|
+
/**
|
|
114
|
+
* Complete Visa passkey registration after OTP validation
|
|
115
|
+
* Call this AFTER the iframe container has been rendered
|
|
116
|
+
*/
|
|
117
|
+
completeVisaRegistration(enrollmentId: string, registrationContext: any): Promise<PasskeyResult>;
|
|
118
|
+
private getMastercardStatusFailure;
|
|
119
|
+
/**
|
|
120
|
+
* Internal method to complete authentication
|
|
121
|
+
* Called automatically after SDK interaction
|
|
122
|
+
*/
|
|
123
|
+
private completeAuthenticationInternal;
|
|
124
|
+
/**
|
|
125
|
+
* Show Visa iframe in specified container
|
|
126
|
+
* @param containerId - ID of the HTML element where iframe should be placed
|
|
127
|
+
*/
|
|
128
|
+
showVisaIframe(containerId?: string): void;
|
|
129
|
+
/**
|
|
130
|
+
* Hide Visa iframe
|
|
131
|
+
*/
|
|
132
|
+
hideVisaIframe(): void;
|
|
133
|
+
/**
|
|
134
|
+
* Remove Visa iframe from DOM while preserving session data
|
|
135
|
+
* Use this when navigating away but want to retain session for retry
|
|
136
|
+
*/
|
|
137
|
+
removeVisaIframeOnly(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Get direct reference to Visa iframe element
|
|
140
|
+
* Gives developers full control over iframe styling and placement
|
|
141
|
+
*/
|
|
142
|
+
getVisaIframe(): HTMLIFrameElement | null;
|
|
143
|
+
/**
|
|
144
|
+
* Set custom Mastercard popup window dimensions
|
|
145
|
+
* @param width - Popup width (default: 550)
|
|
146
|
+
* @param height - Popup height (default: 760)
|
|
147
|
+
*/
|
|
148
|
+
setMastercardPopupDimensions(width: number, height: number): void;
|
|
149
|
+
/**
|
|
150
|
+
* Close Mastercard authentication window if open
|
|
151
|
+
*/
|
|
152
|
+
closeMastercardWindow(): void;
|
|
153
|
+
/**
|
|
154
|
+
* Get reference to Mastercard authentication window (if open)
|
|
155
|
+
*/
|
|
156
|
+
getMastercardWindow(): Window | null;
|
|
157
|
+
/**
|
|
158
|
+
* Check if SDK is loaded for a specific network
|
|
159
|
+
*/
|
|
160
|
+
isSDKLoaded(network: "visa" | "mastercard"): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Clean up SDK resources
|
|
163
|
+
*/
|
|
164
|
+
cleanup(): void;
|
|
165
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for the session-driven passkey flow.
|
|
3
|
+
*
|
|
4
|
+
* The server resolves the subject (enrollment / intent / card) from the
|
|
5
|
+
* session secret, so `authenticate()` with no arguments only has to read the
|
|
6
|
+
* server's answer and turn it into one result shape.
|
|
7
|
+
*/
|
|
8
|
+
import { AgenticEnrollmentError, PasskeyFlowResult, PasskeyFlowStatus, PasskeyFlowType, PasskeyNetwork, PasskeyResult, StepUpMethodOption } from "./types";
|
|
9
|
+
/** Server error code for a concurrent VIC enrollment (409, retryable). */
|
|
10
|
+
export declare const AGENTIC_ENROLLMENT_IN_PROGRESS = "agentic_enrollment_in_progress";
|
|
11
|
+
export declare function resolveNetwork(authResponse: any): PasskeyNetwork | undefined;
|
|
12
|
+
export declare function passkeyActionOf(authResponse: any): string | undefined;
|
|
13
|
+
/** Server `transaction_authentication` maps to the public `authentication`. */
|
|
14
|
+
export declare function isRegistrationFlow(authResponse: any): boolean;
|
|
15
|
+
export declare function normalizeStepUpMethods(raw: unknown): StepUpMethodOption[];
|
|
16
|
+
/** `onStepUp` may return the option, its index, or nothing (cancel). */
|
|
17
|
+
export declare function resolveStepUpChoice(choice: unknown, methods: StepUpMethodOption[]): number | null;
|
|
18
|
+
/**
|
|
19
|
+
* Read the VIC outcome from a complete-device-binding response `data`.
|
|
20
|
+
* Visa: `vicEnrollment.success` (or `vicEnrolled`) must be true.
|
|
21
|
+
* Other networks: binding success is the agentic outcome.
|
|
22
|
+
*/
|
|
23
|
+
export declare function agenticOutcomeFromBinding(network: PasskeyNetwork | undefined, data: any): {
|
|
24
|
+
vicEnrolled: boolean;
|
|
25
|
+
vicError?: AgenticEnrollmentError;
|
|
26
|
+
};
|
|
27
|
+
/** VIC outcome of a WAIVED start response (the server enrolls VIC itself). */
|
|
28
|
+
export declare function agenticOutcomeFromWaiver(network: PasskeyNetwork | undefined, authResponse: any): {
|
|
29
|
+
vicEnrolled: boolean;
|
|
30
|
+
vicError?: AgenticEnrollmentError;
|
|
31
|
+
};
|
|
32
|
+
export declare function withFlowFields(base: PasskeyResult, fields: {
|
|
33
|
+
status: PasskeyFlowStatus;
|
|
34
|
+
flowType: PasskeyFlowType;
|
|
35
|
+
network?: PasskeyNetwork | undefined;
|
|
36
|
+
vicEnrolled: boolean;
|
|
37
|
+
vicError?: AgenticEnrollmentError | undefined;
|
|
38
|
+
}): PasskeyFlowResult;
|
|
39
|
+
/**
|
|
40
|
+
* Registration-subject result: `success` only when the passkey step worked
|
|
41
|
+
* AND agentic enrollment finished, so a VIC failure is never reported as success.
|
|
42
|
+
*/
|
|
43
|
+
export declare function registrationResult(status: PasskeyFlowStatus, flowType: PasskeyFlowType, network: PasskeyNetwork | undefined, outcome: {
|
|
44
|
+
vicEnrolled: boolean;
|
|
45
|
+
vicError?: AgenticEnrollmentError;
|
|
46
|
+
}, extra?: Partial<PasskeyResult>): PasskeyFlowResult;
|
|
47
|
+
export declare function failedResult(flowType: PasskeyFlowType, network: PasskeyNetwork | undefined, code: string, message: string, status?: PasskeyFlowStatus): PasskeyFlowResult;
|
|
48
|
+
export declare function isAgenticInProgressError(error: any): boolean;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PayOS Passkey SDK Types
|
|
3
|
+
*/
|
|
4
|
+
export interface PasskeyAuthResponse {
|
|
5
|
+
paymentIntentId?: string;
|
|
6
|
+
enrollmentId: string;
|
|
7
|
+
enrollmentStatus: 'enrolled' | 'pending' | 'failed';
|
|
8
|
+
cardBrand: string;
|
|
9
|
+
network: PasskeyNetwork;
|
|
10
|
+
flowType: 'registration' | 'transaction_authentication';
|
|
11
|
+
passkeyAction?: 'REGISTER' | 'AUTHENTICATE' | 'WAIVED';
|
|
12
|
+
vProvisionedTokenID?: string;
|
|
13
|
+
srcDigitalCardId?: string;
|
|
14
|
+
vicEnrolled?: boolean;
|
|
15
|
+
orgConfig?: any;
|
|
16
|
+
passkeyFlow?: any;
|
|
17
|
+
paymentAmount?: number;
|
|
18
|
+
paymentCurrency?: string;
|
|
19
|
+
}
|
|
20
|
+
export type PasskeyNetwork = 'visa' | 'mastercard' | 'discover';
|
|
21
|
+
/**
|
|
22
|
+
* Outcome of a passkey flow.
|
|
23
|
+
* - REGISTERED: a new passkey was created and bound to the card
|
|
24
|
+
* - AUTHENTICATED: an existing passkey was used
|
|
25
|
+
* - WAIVED: no passkey ceremony was needed (organization waiver or network)
|
|
26
|
+
* - CANCELLED: the customer (or a callback) stopped the flow
|
|
27
|
+
* - PENDING: the card's network enrollment is still pending; try again later
|
|
28
|
+
* - FAILED: anything else; see `error`
|
|
29
|
+
*/
|
|
30
|
+
export type PasskeyFlowStatus = 'REGISTERED' | 'AUTHENTICATED' | 'WAIVED' | 'CANCELLED' | 'PENDING' | 'FAILED';
|
|
31
|
+
/** `registration` for a new passkey, `authentication` when the customer already had one. */
|
|
32
|
+
export type PasskeyFlowType = 'registration' | 'authentication';
|
|
33
|
+
/** Why agentic (VIC) enrollment did not finish. */
|
|
34
|
+
export interface AgenticEnrollmentError {
|
|
35
|
+
code: string;
|
|
36
|
+
message?: string;
|
|
37
|
+
/** True when creating a new session and running authenticate() again may succeed. */
|
|
38
|
+
retryable: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Fields every authenticate() result carries.
|
|
42
|
+
* `success` is never true when agentic enrollment was attempted and failed.
|
|
43
|
+
*/
|
|
44
|
+
export interface PasskeyFlowFields {
|
|
45
|
+
status: PasskeyFlowStatus;
|
|
46
|
+
flowType: PasskeyFlowType;
|
|
47
|
+
/**
|
|
48
|
+
* True when the card is ready for agentic purchases
|
|
49
|
+
* (Visa: VIC enrolled; Mastercard / Discover: passkey bound or waived).
|
|
50
|
+
*/
|
|
51
|
+
vicEnrolled: boolean;
|
|
52
|
+
/** Present when agentic enrollment was attempted and did not finish. */
|
|
53
|
+
vicError?: AgenticEnrollmentError;
|
|
54
|
+
/** Alias of `vicEnrolled` (network-neutral name used in the public docs). */
|
|
55
|
+
agenticEnrolled: boolean;
|
|
56
|
+
/** Alias of `vicError`. */
|
|
57
|
+
agenticError?: AgenticEnrollmentError;
|
|
58
|
+
}
|
|
59
|
+
export type PasskeyFlowResult = PasskeyResult & PasskeyFlowFields;
|
|
60
|
+
/** A Visa step-up verification method, as passed to `onStepUp`. */
|
|
61
|
+
export interface StepUpMethodOption {
|
|
62
|
+
/** Position in the list; return this (or the object) from `onStepUp`. */
|
|
63
|
+
index: number;
|
|
64
|
+
/** Raw Visa method name, e.g. `OTP_SMS`, `OTP_EMAIL`. */
|
|
65
|
+
method: string;
|
|
66
|
+
type: 'sms' | 'email' | 'other';
|
|
67
|
+
/** Masked destination, e.g. `***-***-1234` or `j***@example.com`. */
|
|
68
|
+
maskedValue?: string;
|
|
69
|
+
}
|
|
70
|
+
/** Context passed to `onOtp`. */
|
|
71
|
+
export interface OtpPromptContext {
|
|
72
|
+
/** 1 for the first prompt, 2+ after a wrong code. */
|
|
73
|
+
attempt: number;
|
|
74
|
+
method: StepUpMethodOption;
|
|
75
|
+
/** Set on retries: why the previous code was refused. */
|
|
76
|
+
previousError?: string;
|
|
77
|
+
attemptsRemaining?: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Return the chosen method (or its index). Return null/undefined to cancel.
|
|
81
|
+
*/
|
|
82
|
+
export type StepUpHandler = (methods: StepUpMethodOption[]) => Promise<StepUpMethodOption | number | null | undefined> | StepUpMethodOption | number | null | undefined;
|
|
83
|
+
/** Return the code the customer typed. Return null/undefined/empty to cancel. */
|
|
84
|
+
export type OtpHandler = (context: OtpPromptContext) => Promise<string | null | undefined> | string | null | undefined;
|
|
85
|
+
export interface PayOSPasskeyOptions {
|
|
86
|
+
/** true for sandbox, false/undefined for production */
|
|
87
|
+
sandbox?: boolean;
|
|
88
|
+
/** Override API base URL (your subdomain or proxy). All calls go to `<base>/api/passkeys/*`. */
|
|
89
|
+
apiBaseUrl?: string;
|
|
90
|
+
debug?: boolean;
|
|
91
|
+
/** ID of element where the Visa iframe should be placed */
|
|
92
|
+
visaContainerId?: string;
|
|
93
|
+
/** Custom Mastercard popup dimensions */
|
|
94
|
+
mastercardPopupDimensions?: {
|
|
95
|
+
width: number;
|
|
96
|
+
height: number;
|
|
97
|
+
};
|
|
98
|
+
/** Visa step-up: show your method picker. Used by authenticate() with no arguments. */
|
|
99
|
+
onStepUp?: StepUpHandler;
|
|
100
|
+
/** Visa step-up: show your code-entry screen. Used by authenticate() with no arguments. */
|
|
101
|
+
onOtp?: OtpHandler;
|
|
102
|
+
}
|
|
103
|
+
export interface SDKConfig {
|
|
104
|
+
visa: {
|
|
105
|
+
sdkUrl: string;
|
|
106
|
+
};
|
|
107
|
+
mastercard: {
|
|
108
|
+
sdkUrl: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export interface SDKSessionData {
|
|
112
|
+
/** SDK session context */
|
|
113
|
+
sessionContext: any;
|
|
114
|
+
/** Browser data */
|
|
115
|
+
browserData: any;
|
|
116
|
+
}
|
|
117
|
+
export interface PasskeyResult {
|
|
118
|
+
/** Success status */
|
|
119
|
+
success: boolean;
|
|
120
|
+
/** Network type */
|
|
121
|
+
network?: PasskeyNetwork;
|
|
122
|
+
/** Optional message */
|
|
123
|
+
message?: string;
|
|
124
|
+
/** Whether OTP was valid (for step-up flow) */
|
|
125
|
+
otpValid?: boolean;
|
|
126
|
+
/** Registration context to pass to completeVisaRegistration (for step-up flow) */
|
|
127
|
+
registrationContext?: any;
|
|
128
|
+
/** Whether user can retry (for OTP validation failures) */
|
|
129
|
+
canRetry?: boolean;
|
|
130
|
+
/** Number of attempts remaining (for OTP validation) */
|
|
131
|
+
attemptsRemaining?: number;
|
|
132
|
+
/** Device needs passkey registration before authentication (Visa new device) */
|
|
133
|
+
requiresRegistration?: boolean;
|
|
134
|
+
/** Passkey waived for this organization */
|
|
135
|
+
passkeyWaived?: boolean;
|
|
136
|
+
/** Step-up methods available for registration */
|
|
137
|
+
stepUpMethods?: any[];
|
|
138
|
+
/** Enrollment ID for registration flow */
|
|
139
|
+
enrollmentId?: string;
|
|
140
|
+
/** Optional error details */
|
|
141
|
+
error?: {
|
|
142
|
+
code: string;
|
|
143
|
+
message: string;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export interface RegisterResult {
|
|
147
|
+
/** Success status - true if registration complete, false if step-up needed or failed */
|
|
148
|
+
success: boolean;
|
|
149
|
+
/** Network type */
|
|
150
|
+
network?: PasskeyNetwork;
|
|
151
|
+
/** Step-up required (Visa only) */
|
|
152
|
+
requiresStepUp?: boolean;
|
|
153
|
+
/** VIC enrollment required (Visa only - passkey exists but VIC not enrolled) */
|
|
154
|
+
requiresVicEnrollment?: boolean;
|
|
155
|
+
/** Already registered (passkey already exists) */
|
|
156
|
+
alreadyRegistered?: boolean;
|
|
157
|
+
/** Passkey waived for this organization */
|
|
158
|
+
passkeyWaived?: boolean;
|
|
159
|
+
/** Enrollment ID for step-up flow */
|
|
160
|
+
enrollmentId?: string;
|
|
161
|
+
/** Step-up methods available */
|
|
162
|
+
stepUpMethods?: any[];
|
|
163
|
+
/** Authentication context for VIC enrollment flow */
|
|
164
|
+
authenticationContext?: any;
|
|
165
|
+
/** Message */
|
|
166
|
+
message?: string;
|
|
167
|
+
/** Error details if failed */
|
|
168
|
+
error?: {
|
|
169
|
+
code: string;
|
|
170
|
+
message: string;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export interface OTPSubmitResult {
|
|
174
|
+
success: boolean;
|
|
175
|
+
requiresRetry?: boolean;
|
|
176
|
+
attemptsRemaining?: number;
|
|
177
|
+
}
|
|
178
|
+
export type PasskeyErrorCode = 'INVALID_SESSION' | 'SESSION_EXPIRED' | 'NETWORK_ERROR' | 'SDK_LOAD_FAILED' | 'AUTH_FAILED' | 'INVALID_PARAMS' | 'API_ERROR' | 'DEVICE_NOT_REGISTERED';
|
|
179
|
+
export declare class PasskeyError extends Error {
|
|
180
|
+
code: PasskeyErrorCode;
|
|
181
|
+
details?: any | undefined;
|
|
182
|
+
constructor(code: PasskeyErrorCode, message: string, details?: any | undefined);
|
|
183
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PayOS Passkey JS SDK
|
|
3
|
+
* Browser SDK for passkey authentication operations
|
|
4
|
+
*/
|
|
5
|
+
export { PayOSPasskey } from './core/PayOSPasskey';
|
|
6
|
+
export type { PasskeyAuthResponse, SDKConfig, PasskeyResult, RegisterResult, SDKSessionData, OTPSubmitResult, PasskeyErrorCode, PasskeyNetwork, PasskeyFlowStatus, PasskeyFlowType, PasskeyFlowFields, PasskeyFlowResult, AgenticEnrollmentError, StepUpMethodOption, OtpPromptContext, StepUpHandler, OtpHandler, PayOSPasskeyOptions, } from './core/types';
|
|
7
|
+
export { SDK_VERSION } from './version';
|
|
8
|
+
export { PasskeyError } from './core/types';
|
|
9
|
+
import { PayOSPasskey } from './core/PayOSPasskey';
|
|
10
|
+
export default PayOSPasskey;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mastercard SDK Service - Simplified wrapper
|
|
3
|
+
* Handles loading and interacting with Mastercard SRC SDK
|
|
4
|
+
*/
|
|
5
|
+
declare global {
|
|
6
|
+
interface Window {
|
|
7
|
+
AUTHSDK_MASTERCARD?: {
|
|
8
|
+
authenticate: (config: any) => Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare class MastercardSDKService {
|
|
13
|
+
private sdkLoaded;
|
|
14
|
+
private sdkLoadPromise;
|
|
15
|
+
private sdkUrl;
|
|
16
|
+
private authWindow;
|
|
17
|
+
private popupWidth;
|
|
18
|
+
private popupHeight;
|
|
19
|
+
private instanceId;
|
|
20
|
+
/**
|
|
21
|
+
* Set SDK URL from backend config
|
|
22
|
+
*/
|
|
23
|
+
setSDKUrl(url: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Load Mastercard SDK
|
|
26
|
+
*/
|
|
27
|
+
loadSDK(sdkUrl?: string): Promise<void>;
|
|
28
|
+
private loadSDKInternal;
|
|
29
|
+
/**
|
|
30
|
+
* Set custom popup window dimensions
|
|
31
|
+
* @param width - Popup width (default: 550)
|
|
32
|
+
* @param height - Popup height (default: 760)
|
|
33
|
+
*/
|
|
34
|
+
setPopupDimensions(width: number, height: number): void;
|
|
35
|
+
/**
|
|
36
|
+
* Authenticate using Mastercard SDK
|
|
37
|
+
* Opens a popup window and performs authentication
|
|
38
|
+
* @param authRequest - Authentication request from backend
|
|
39
|
+
* @param popupOptions - Optional popup dimensions
|
|
40
|
+
*/
|
|
41
|
+
authenticate(authRequest: any, popupOptions?: {
|
|
42
|
+
width?: number;
|
|
43
|
+
height?: number;
|
|
44
|
+
}): Promise<any>;
|
|
45
|
+
/**
|
|
46
|
+
* Get reference to the authentication window (if open)
|
|
47
|
+
*/
|
|
48
|
+
getAuthWindow(): Window | null;
|
|
49
|
+
/**
|
|
50
|
+
* Close authentication window if open
|
|
51
|
+
*/
|
|
52
|
+
closeAuthWindow(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Check if SDK is loaded
|
|
55
|
+
*/
|
|
56
|
+
isLoaded(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Clean up SDK
|
|
59
|
+
*/
|
|
60
|
+
cleanup(): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visa SDK Service - VTS SDK integration via iframe and postMessage
|
|
3
|
+
* Based on working passkey-core implementation
|
|
4
|
+
*/
|
|
5
|
+
export interface VTSSessionData {
|
|
6
|
+
sessionContext: any;
|
|
7
|
+
browserData: any;
|
|
8
|
+
requestID: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class VisaSDKService {
|
|
11
|
+
private initialized;
|
|
12
|
+
private initPromise;
|
|
13
|
+
private sessionData;
|
|
14
|
+
private sdkUrl;
|
|
15
|
+
private sdkOrigin;
|
|
16
|
+
private iframe;
|
|
17
|
+
private containerId;
|
|
18
|
+
private vtsRequestId;
|
|
19
|
+
private messageHandlers;
|
|
20
|
+
private messageListener;
|
|
21
|
+
private instanceId;
|
|
22
|
+
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Set SDK URL from backend config
|
|
25
|
+
*/
|
|
26
|
+
setSDKUrl(url: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Set container ID for iframe placement
|
|
29
|
+
* @param containerId - ID of the HTML element where iframe should be placed
|
|
30
|
+
*/
|
|
31
|
+
setContainerId(containerId: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Initialize VTS SDK by creating iframe and establishing session
|
|
34
|
+
*/
|
|
35
|
+
loadSDK(sdkUrl?: string): Promise<void>;
|
|
36
|
+
private initializeSDK;
|
|
37
|
+
/**
|
|
38
|
+
* Create hidden iframe for VTS SDK
|
|
39
|
+
*/
|
|
40
|
+
private createIframe;
|
|
41
|
+
/**
|
|
42
|
+
* Handle messages from VTS SDK iframe
|
|
43
|
+
*/
|
|
44
|
+
private handleMessage;
|
|
45
|
+
/**
|
|
46
|
+
* Send CREATE_AUTH_SESSION command to VTS SDK
|
|
47
|
+
*/
|
|
48
|
+
private sendCreateAuthSession;
|
|
49
|
+
/**
|
|
50
|
+
* Get session context needed for Visa operations
|
|
51
|
+
*/
|
|
52
|
+
getSessionContext(): Promise<{
|
|
53
|
+
sessionContext: any;
|
|
54
|
+
browserData: any;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Send AUTHENTICATE command for passkey operations
|
|
58
|
+
* Note: This is for advanced use cases - normally backend handles this
|
|
59
|
+
*/
|
|
60
|
+
authenticate(authenticationContext: any): Promise<any>;
|
|
61
|
+
/**
|
|
62
|
+
* Check if SDK is loaded and initialized
|
|
63
|
+
*/
|
|
64
|
+
isLoaded(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Show VTS SDK iframe positioned over specified container
|
|
67
|
+
* NOTE: We position the iframe over the container instead of moving it into the container.
|
|
68
|
+
* Moving an iframe to a new DOM parent causes it to reload, which destroys the VTS session.
|
|
69
|
+
* @param containerId - ID of the HTML element to position iframe over
|
|
70
|
+
*/
|
|
71
|
+
showIframe(containerId?: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* Hide VTS SDK iframe
|
|
74
|
+
* Moves iframe off-screen but maintains the VTS session
|
|
75
|
+
*/
|
|
76
|
+
hideIframe(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Get reference to the VTS iframe element
|
|
79
|
+
*/
|
|
80
|
+
getIframe(): HTMLIFrameElement | null;
|
|
81
|
+
/**
|
|
82
|
+
* Remove iframe from DOM while preserving session data
|
|
83
|
+
* Use this when navigating away but want to retain session for retry
|
|
84
|
+
*/
|
|
85
|
+
removeIframeOnly(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Clean up SDK
|
|
88
|
+
*/
|
|
89
|
+
cleanup(): void;
|
|
90
|
+
}
|