@paydock/client-sdk 1.144.1-beta → 1.145.0-beta
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 +422 -31
- package/bundles/index.cjs +1972 -532
- package/bundles/index.cjs.d.ts +192 -8
- package/bundles/index.mjs +1972 -532
- package/bundles/index.mjs.d.ts +192 -8
- package/bundles/types/helper/browser.d.ts.map +1 -1
- package/bundles/types/helper/element-id.d.ts +3 -1
- package/bundles/types/helper/element-id.d.ts.map +1 -1
- package/bundles/types/helper/uuid.d.ts.map +1 -1
- package/bundles/types/open-wallets/apple-pay-open-wallet-button.d.ts +41 -0
- package/bundles/types/open-wallets/apple-pay-open-wallet-button.d.ts.map +1 -1
- package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts +10 -0
- package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts.map +1 -1
- package/bundles/types/open-wallets/base/service-config-cache.d.ts +23 -0
- package/bundles/types/open-wallets/base/service-config-cache.d.ts.map +1 -0
- package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts +33 -1
- package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts.map +1 -1
- package/bundles/types/open-wallets/index.d.ts +82 -1
- package/bundles/types/open-wallets/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-availability.interface.d.ts +41 -0
- package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-availability.interface.d.ts.map +1 -0
- package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts +1 -0
- package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/google-pay/google-pay-availability.interface.d.ts +25 -0
- package/bundles/types/open-wallets/interfaces/google-pay/google-pay-availability.interface.d.ts.map +1 -0
- package/bundles/types/open-wallets/interfaces/google-pay/index.d.ts +1 -0
- package/bundles/types/open-wallets/interfaces/google-pay/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/index.d.ts +3 -0
- package/bundles/types/open-wallets/interfaces/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/open-wallet-availability.interface.d.ts +31 -0
- package/bundles/types/open-wallets/interfaces/open-wallet-availability.interface.d.ts.map +1 -0
- package/bundles/types/open-wallets/services/apple-pay/apple-pay-availability.d.ts +58 -0
- package/bundles/types/open-wallets/services/apple-pay/apple-pay-availability.d.ts.map +1 -0
- package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts +8 -10
- package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/apple-pay/index.d.ts +1 -0
- package/bundles/types/open-wallets/services/apple-pay/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/google-pay/google-pay-availability.d.ts +53 -0
- package/bundles/types/open-wallets/services/google-pay/google-pay-availability.d.ts.map +1 -0
- package/bundles/types/open-wallets/services/google-pay/google-pay.open-wallet.service.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/google-pay/index.d.ts +1 -0
- package/bundles/types/open-wallets/services/google-pay/index.d.ts.map +1 -1
- package/bundles/widget.umd.js +1972 -532
- package/bundles/widget.umd.js.d.ts +192 -8
- package/bundles/widget.umd.js.min.d.ts +192 -8
- package/bundles/widget.umd.min.js +1 -1
- package/docs/open-wallet-buttons-examples.md +170 -2
- package/docs/open-wallet-buttons.md +252 -29
- package/package.json +10 -7
- package/slate.md +170 -2
package/bundles/index.mjs.d.ts
CHANGED
|
@@ -3782,6 +3782,77 @@ declare enum ERROR_OPERATION {
|
|
|
3782
3782
|
SHIPPING_UPDATE = "shipping_update"
|
|
3783
3783
|
}
|
|
3784
3784
|
|
|
3785
|
+
/**
|
|
3786
|
+
* Base options shared by every wallet's static availability check
|
|
3787
|
+
* (e.g. `ApplePayOpenWalletButton.checkAvailability`). Wallet-specific option
|
|
3788
|
+
* interfaces extend this with their own fields.
|
|
3789
|
+
*/
|
|
3790
|
+
interface OpenWalletAvailabilityOptions {
|
|
3791
|
+
/** Public key or access token used to fetch the service config when needed. */
|
|
3792
|
+
public_key_or_access_token?: string;
|
|
3793
|
+
/** Service ID — used with `public_key_or_access_token` to resolve the wallet configuration. */
|
|
3794
|
+
service_id?: string;
|
|
3795
|
+
/** Environment for the config fetch (e.g. `'sandbox'`). Defaults to the SDK default. */
|
|
3796
|
+
env?: string;
|
|
3797
|
+
/**
|
|
3798
|
+
* When `true`, performs only the cheap, network-free synchronous check and resolves
|
|
3799
|
+
* immediately — no config fetch, SDK load, or remote capability query.
|
|
3800
|
+
*/
|
|
3801
|
+
sync?: boolean;
|
|
3802
|
+
}
|
|
3803
|
+
/**
|
|
3804
|
+
* Base result shared by every wallet's static availability check. Wallet-specific
|
|
3805
|
+
* result interfaces extend this with their own fields.
|
|
3806
|
+
*/
|
|
3807
|
+
interface OpenWalletAvailabilityResult {
|
|
3808
|
+
/** Convenience verdict: the wallet is usable for a payment in the current context. */
|
|
3809
|
+
available: boolean;
|
|
3810
|
+
/** Whether the wallet is supported here at all (may be available via a fallback flow). */
|
|
3811
|
+
supported: boolean;
|
|
3812
|
+
/** Machine-readable reason when not available. */
|
|
3813
|
+
reason?: string;
|
|
3814
|
+
}
|
|
3815
|
+
|
|
3816
|
+
/**
|
|
3817
|
+
* Friendly capability tokens accepted as **input** — the same values used in
|
|
3818
|
+
* `ApplePayOpenWalletMeta.apple_pay_capabilities`. They declare which device
|
|
3819
|
+
* credential statuses should be treated as "available".
|
|
3820
|
+
*/
|
|
3821
|
+
type ApplePayCapabilityToken = 'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable';
|
|
3822
|
+
/**
|
|
3823
|
+
* Device-reported credential status — the **output** of
|
|
3824
|
+
* `ApplePaySession.applePayCapabilities()`.
|
|
3825
|
+
*/
|
|
3826
|
+
type ApplePayCredentialStatus = 'paymentCredentialsAvailable' | 'paymentCredentialStatusUnknown' | 'paymentCredentialsUnavailable' | 'applePayUnsupported';
|
|
3827
|
+
/**
|
|
3828
|
+
* Options for `ApplePayOpenWalletButton.checkAvailability`. Provide `merchant_id`
|
|
3829
|
+
* directly to skip the network call, **or** provide `public_key_or_access_token` +
|
|
3830
|
+
* `service_id` to have the SDK resolve the merchant identifier from the service config.
|
|
3831
|
+
*/
|
|
3832
|
+
interface ApplePayAvailabilityOptions extends OpenWalletAvailabilityOptions {
|
|
3833
|
+
/** Apple merchant identifier. Provide this OR (`public_key_or_access_token` + `service_id`). */
|
|
3834
|
+
merchant_id?: string;
|
|
3835
|
+
/**
|
|
3836
|
+
* Device credential statuses that count as available. Defaults to
|
|
3837
|
+
* `['credentials_available', 'credentials_status_unknown']` — `credentials_status_unknown`
|
|
3838
|
+
* is what third-party / cross-device (QR) browsers report, so the default keeps Apple Pay
|
|
3839
|
+
* visible outside Safari.
|
|
3840
|
+
*/
|
|
3841
|
+
apple_pay_capabilities?: ApplePayCapabilityToken[];
|
|
3842
|
+
}
|
|
3843
|
+
/** Result of `ApplePayOpenWalletButton.checkAvailability`. */
|
|
3844
|
+
interface ApplePayAvailabilityResult extends OpenWalletAvailabilityResult {
|
|
3845
|
+
/**
|
|
3846
|
+
* Whether a **native, same-device** Apple Pay session is present right now
|
|
3847
|
+
* (`ApplePaySession` exists and `canMakePayments()` is `true`). Apple does not expose
|
|
3848
|
+
* the transport directly, so use this to infer it: `available && has_native_session` ⇒
|
|
3849
|
+
* native sheet likely; `available && !has_native_session` ⇒ cross-device / QR handoff likely.
|
|
3850
|
+
*/
|
|
3851
|
+
has_native_session: boolean;
|
|
3852
|
+
/** The raw device-reported credential status. Undefined when unsupported or not queried. */
|
|
3853
|
+
payment_credential_status?: ApplePayCredentialStatus;
|
|
3854
|
+
}
|
|
3855
|
+
|
|
3785
3856
|
/**
|
|
3786
3857
|
* Events emitted during the OpenWallet payment lifecycle.
|
|
3787
3858
|
*/
|
|
@@ -3933,6 +4004,30 @@ interface OnCancelEventData extends OpenWalletBaseEvent {
|
|
|
3933
4004
|
event: EVENT$1.CHECKOUT_CLOSE;
|
|
3934
4005
|
}
|
|
3935
4006
|
|
|
4007
|
+
/**
|
|
4008
|
+
* Options for `GooglePayOpenWalletButton.checkAvailability`. Extends
|
|
4009
|
+
* {@link OpenWalletAvailabilityOptions}. All fields are optional — Google Pay's
|
|
4010
|
+
* `isReadyToPay` check does not require a merchant identifier. Provide
|
|
4011
|
+
* `public_key_or_access_token` + `service_id` to validate that the service is a Google Pay
|
|
4012
|
+
* service (and resolve the merchant id), or `merchant_id` directly.
|
|
4013
|
+
*/
|
|
4014
|
+
interface GooglePayAvailabilityOptions extends OpenWalletAvailabilityOptions {
|
|
4015
|
+
/**
|
|
4016
|
+
* Google Pay gateway merchant identifier. Optional — `isReadyToPay` does not require it;
|
|
4017
|
+
* when omitted the readiness check still runs.
|
|
4018
|
+
*/
|
|
4019
|
+
merchant_id?: string;
|
|
4020
|
+
}
|
|
4021
|
+
/** Result of `GooglePayOpenWalletButton.checkAvailability`. */
|
|
4022
|
+
interface GooglePayAvailabilityResult extends OpenWalletAvailabilityResult {
|
|
4023
|
+
/**
|
|
4024
|
+
* Google's `isReadyToPay` `paymentMethodPresent` — whether the buyer already has a
|
|
4025
|
+
* payment method usable with Google Pay. `undefined` when not reported (e.g. the
|
|
4026
|
+
* synchronous check, or browsers where it is not surfaced).
|
|
4027
|
+
*/
|
|
4028
|
+
payment_method_present?: boolean;
|
|
4029
|
+
}
|
|
4030
|
+
|
|
3936
4031
|
/**
|
|
3937
4032
|
* Base metadata required to configure an OpenWallet button.
|
|
3938
4033
|
*/
|
|
@@ -4201,6 +4296,16 @@ declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = OpenWall
|
|
|
4201
4296
|
abstract readonly walletType: WalletType;
|
|
4202
4297
|
/** @private */
|
|
4203
4298
|
constructor(selector: string, publicKeyOrAccessToken: string, serviceId: string, meta: TMeta);
|
|
4299
|
+
/**
|
|
4300
|
+
* Invalidates the cached service configuration whenever an error or unavailable
|
|
4301
|
+
* event fires, so the next `load()` re-fetches a fresh config. The cache is keyed
|
|
4302
|
+
* on the service ID with a 1-day TTL; clearing it on failure means a config that
|
|
4303
|
+
* changed server-side (and caused the failure) is not reused until the TTL expires.
|
|
4304
|
+
* Registered once per button, independently of any merchant-registered handlers.
|
|
4305
|
+
*
|
|
4306
|
+
* @private
|
|
4307
|
+
*/
|
|
4308
|
+
private registerCacheInvalidationOnError;
|
|
4204
4309
|
/**
|
|
4205
4310
|
* Creates the wallet-specific service instance for this button.
|
|
4206
4311
|
* Each concrete subclass implements this to instantiate its specific wallet service.
|
|
@@ -5062,11 +5167,6 @@ type ApplePayButtonStyle$1 = 'black' | 'white' | 'white-outline';
|
|
|
5062
5167
|
|
|
5063
5168
|
type ApplePayButtonType$1 = 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'plain' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';
|
|
5064
5169
|
|
|
5065
|
-
declare global {
|
|
5066
|
-
interface Window {
|
|
5067
|
-
ApplePaySession: ApplePaySession;
|
|
5068
|
-
}
|
|
5069
|
-
}
|
|
5070
5170
|
/** Styling configuration for the Apple Pay button. */
|
|
5071
5171
|
interface ApplePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
|
|
5072
5172
|
/** Variant displayed on the button (e.g. `'buy'`, `'donate'`, `'plain'`, `'check-out'`). */
|
|
@@ -5127,12 +5227,24 @@ interface ApplePayOpenWalletMeta extends OpenWalletMeta, Omit<ApplePayPaymentReq
|
|
|
5127
5227
|
/** Visual styling for the Apple Pay button. */
|
|
5128
5228
|
style?: ApplePayOpenWalletMetaStyles;
|
|
5129
5229
|
/**
|
|
5130
|
-
* Device
|
|
5131
|
-
*
|
|
5230
|
+
* Device credential statuses that make the button render. Defaults to
|
|
5231
|
+
* `['credentials_available', 'credentials_status_unknown']`:
|
|
5232
|
+
* - `credentials_available` — the device has a confirmed Apple Pay card ready to use.
|
|
5233
|
+
* - `credentials_status_unknown` — a local card can't be confirmed, but Apple Pay can
|
|
5234
|
+
* still proceed (e.g. the cross-device flow where the buyer completes payment on their
|
|
5235
|
+
* iPhone via QR, used by Chrome, Edge and Firefox).
|
|
5236
|
+
* The button renders when the device's reported status is in this list. Narrow to
|
|
5237
|
+
* `['credentials_available']` to require a confirmed local card.
|
|
5132
5238
|
*/
|
|
5133
5239
|
apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
|
|
5134
5240
|
}
|
|
5135
5241
|
|
|
5242
|
+
declare global {
|
|
5243
|
+
interface Window {
|
|
5244
|
+
ApplePaySession: ApplePaySession;
|
|
5245
|
+
}
|
|
5246
|
+
}
|
|
5247
|
+
|
|
5136
5248
|
/**
|
|
5137
5249
|
* @classdesc Apple Pay wallet button that creates One-Time Tokens (OTT) via Apple Pay.
|
|
5138
5250
|
*
|
|
@@ -5171,6 +5283,46 @@ interface ApplePayOpenWalletMeta extends OpenWalletMeta, Omit<ApplePayPaymentReq
|
|
|
5171
5283
|
declare class ApplePayOpenWalletButton extends OpenWalletButtons<ApplePayOpenWalletMeta> {
|
|
5172
5284
|
/** @private */
|
|
5173
5285
|
readonly walletType: WalletType;
|
|
5286
|
+
/**
|
|
5287
|
+
* Checks Apple Pay availability **without instantiating the button** — the single,
|
|
5288
|
+
* authoritative, cross-browser-aware availability entry point.
|
|
5289
|
+
*
|
|
5290
|
+
* Resolves the merchant identifier (either supplied directly or fetched from the
|
|
5291
|
+
* service configuration), loads Apple's web SDK if needed, then queries
|
|
5292
|
+
* `ApplePaySession.applePayCapabilities()`. Returns a convenience `available` verdict
|
|
5293
|
+
* (computed against `apple_pay_capabilities`), the raw device-reported
|
|
5294
|
+
* `payment_credential_status`, and `has_native_session` so callers can infer the transport:
|
|
5295
|
+
* `available && has_native_session` ⇒ native sheet likely; `available && !has_native_session`
|
|
5296
|
+
* ⇒ cross-device / QR handoff likely.
|
|
5297
|
+
*
|
|
5298
|
+
* Pass `{ sync: true }` for a cheap, network-free native same-device pre-check that
|
|
5299
|
+
* resolves immediately (see {@link ApplePayAvailabilityOptions.sync}).
|
|
5300
|
+
*
|
|
5301
|
+
* @param {ApplePayAvailabilityOptions} [options] - Merchant context, allowed capabilities, and mode.
|
|
5302
|
+
* @returns {Promise<ApplePayAvailabilityResult>} The availability result.
|
|
5303
|
+
*
|
|
5304
|
+
* @example
|
|
5305
|
+
* // Lightest path — no network, when you already know the merchant identifier:
|
|
5306
|
+
* const result = await ApplePayOpenWalletButton.checkAvailability({ merchant_id });
|
|
5307
|
+
*
|
|
5308
|
+
* @example
|
|
5309
|
+
* // Resolve the merchant identifier from the service configuration:
|
|
5310
|
+
* const result = await ApplePayOpenWalletButton.checkAvailability({
|
|
5311
|
+
* public_key_or_access_token,
|
|
5312
|
+
* service_id,
|
|
5313
|
+
* env: 'sandbox',
|
|
5314
|
+
* });
|
|
5315
|
+
* if (result.available) {
|
|
5316
|
+
* // Render the Apple Pay button (native sheet or cross-device QR, per has_native_session).
|
|
5317
|
+
* } else {
|
|
5318
|
+
* console.log('Unavailable:', result.reason, result.payment_credential_status);
|
|
5319
|
+
* }
|
|
5320
|
+
*
|
|
5321
|
+
* @example
|
|
5322
|
+
* // Synchronous native-only fast check (no network / SDK load):
|
|
5323
|
+
* const { has_native_session } = await ApplePayOpenWalletButton.checkAvailability({ sync: true });
|
|
5324
|
+
*/
|
|
5325
|
+
static checkAvailability(options?: ApplePayAvailabilityOptions): Promise<ApplePayAvailabilityResult>;
|
|
5174
5326
|
/**
|
|
5175
5327
|
* Validates Apple Pay-specific required metadata fields.
|
|
5176
5328
|
* Apple Pay requires `amount_label` and `store_name` to be present and strings.
|
|
@@ -5342,6 +5494,38 @@ interface GooglePayCardConfig {
|
|
|
5342
5494
|
declare class GooglePayOpenWalletButton extends OpenWalletButtons<GooglePayOpenWalletMeta> {
|
|
5343
5495
|
/** @private */
|
|
5344
5496
|
readonly walletType: WalletType;
|
|
5497
|
+
/**
|
|
5498
|
+
* Checks Google Pay availability **without instantiating the button** — the static
|
|
5499
|
+
* availability entry point.
|
|
5500
|
+
*
|
|
5501
|
+
* Loads the Google Pay JS SDK if needed, then runs `PaymentsClient.isReadyToPay()` using
|
|
5502
|
+
* the **default** card configuration (a button instance with a custom `card_config` may
|
|
5503
|
+
* produce a different result). All options are optional — unlike Apple Pay, Google Pay's
|
|
5504
|
+
* readiness check does not require a merchant identifier; supplying `service_id` +
|
|
5505
|
+
* `public_key_or_access_token` additionally validates that the service is a Google Pay service.
|
|
5506
|
+
*
|
|
5507
|
+
* Pass `{ sync: true }` for a cheap, network-free check that only reports whether the
|
|
5508
|
+
* Google Pay JS API is already present (see {@link GooglePayAvailabilityOptions.sync}).
|
|
5509
|
+
*
|
|
5510
|
+
* @param {GooglePayAvailabilityOptions} [options] - Optional merchant context and mode.
|
|
5511
|
+
* @returns {Promise<GooglePayAvailabilityResult>} The availability result.
|
|
5512
|
+
*
|
|
5513
|
+
* @example
|
|
5514
|
+
* // Simplest form — no merchant context needed:
|
|
5515
|
+
* const result = await GooglePayOpenWalletButton.checkAvailability();
|
|
5516
|
+
* if (result.available) {
|
|
5517
|
+
* // Render the Google Pay button.
|
|
5518
|
+
* }
|
|
5519
|
+
*
|
|
5520
|
+
* @example
|
|
5521
|
+
* // Validate the service is a Google Pay service while checking:
|
|
5522
|
+
* const result = await GooglePayOpenWalletButton.checkAvailability({
|
|
5523
|
+
* public_key_or_access_token,
|
|
5524
|
+
* service_id,
|
|
5525
|
+
* env: 'sandbox',
|
|
5526
|
+
* });
|
|
5527
|
+
*/
|
|
5528
|
+
static checkAvailability(options?: GooglePayAvailabilityOptions): Promise<GooglePayAvailabilityResult>;
|
|
5345
5529
|
/**
|
|
5346
5530
|
* Validates Google Pay-specific required metadata fields.
|
|
5347
5531
|
* Google Pay has no additional required fields beyond the base (amount, currency, country).
|
|
@@ -7256,4 +7440,4 @@ declare global {
|
|
|
7256
7440
|
}
|
|
7257
7441
|
|
|
7258
7442
|
export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CANVAS_3DS_EVENT, CHECKOUT_BUTTON_EVENT, EVENT$2 as CHECKOUT_EVENT, Canvas3ds, Canvas3dsTokenFormat, Checkout, CheckoutActionCode, ClickToPay, Configuration, ContactShippingEditingMode, ELEMENT, ERROR_OPERATION, EVENT$3 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, FRAUD_PREVENTION_EVENTS, FraudPreventionService, GooglePayOpenWalletButton, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, InstructionDebugger, MultiWidget, OpenWalletButtons, PAYMENT_EXPIRED, PAYMENT_FAILURE, PAYMENT_SUCCESSFUL, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TOKEN_TYPE, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, VaultDisplayWidget, EVENT as WALLET_BUTTONS_EXPRESS_EVENT, WALLET_TYPES, WalletButtons, ZipmoneyCheckoutButton };
|
|
7259
|
-
export type { ApplePayButtonStyle, ApplePayButtonType, ApplePayOpenWalletMeta, ApplePayWalletMeta, AppleShippingType, BaseWalletMeta, Billing, Canvas3dsAuthPayload, Canvas3dsChargeAuthEventPayload, Canvas3dsErrorEventPayload, Canvas3dsErrorPayload, Canvas3dsEventMap, Canvas3dsEventName, CheckoutIntentTokenPayload, CheckoutPaymentExpiredPayload, CheckoutPaymentFailurePayload, CheckoutPaymentSuccessPayload, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, EventTypes, FraudPreventionEvent, FraudPreventionEventType, FraudPreventionProvider, GooglePayCardConfig, GooglePayOpenWalletMeta, GooglePayOpenWalletMetaStyles, HandleResponseInterface, IApplePayShippingOption, ICheckout, IClickToPayMeta, IDetails, IElementStyleInput, IEventAfterLoadData, IEventCheckoutFinishData, IEventData$1 as IEventData, IEventError, IEventFinishData, IEventMetaData, IEventSizeData, IFormValidation, IOpenWalletProvider, IPayPalMeta, IStyles$1 as IStyles, ITexts, ITokenStandalone3DS, IWalletMeta, IWalletOnClickEvent, IWalletPaymentSuccessfulEvent, IWalletUnavailableEvent, IWalletUpdateData, IWalletUpdateEvent, OTTResponse, OnCancelEventData, OnClickEventData$1 as OnClickEventData, OnCreateOTTErrorEventData, OnCreateOTTErrorPayload, OnCreateOTTSuccessPayload, OnCreateOTTSuccessfulEventData, OnErrorEventData$1 as OnErrorEventData, OnErrorPayload, OnLoadedEventData, OnUnavailableDetails, OnUnavailableEventData$1 as OnUnavailableEventData, OnUnavailablePayload, OpenWalletBaseEvent, OpenWalletDataEvent, OpenWalletEventType, OpenWalletMeta, PaypalWalletMeta, ProcessAuthenticationResponse, Shipping, VaultDisplayStyle, OnClickEventData as WalletExpressOnClickEventData, OnCloseEventData as WalletExpressOnCloseEventData, OnErrorEventData as WalletExpressOnErrorEventData, OnPaymentErrorEventData as WalletExpressOnPaymentErrorEventData, OnPaymentInReviewEventData as WalletExpressOnPaymentInReviewEventData, OnPaymentSuccessfulEventData as WalletExpressOnPaymentSuccessfulEventData, OnShippingAddressChangeEventData as WalletExpressOnShippingAddressChangeEventData, OnShippingAddressChangeEventResponse as WalletExpressOnShippingAddressChangeEventResponse, OnShippingOptionChangeEventData as WalletExpressOnShippingOptionChangeEventData, OnShippingOptionChangeEventResponse as WalletExpressOnShippingOptionChangeEventResponse, OnUnavailableEventData as WalletExpressOnUnavailableEventData, WalletType, WidgetEventMap, WidgetEventName };
|
|
7443
|
+
export type { ApplePayAvailabilityOptions, ApplePayAvailabilityResult, ApplePayButtonStyle, ApplePayButtonType, ApplePayCapabilityToken, ApplePayCredentialStatus, ApplePayOpenWalletMeta, ApplePayWalletMeta, AppleShippingType, BaseWalletMeta, Billing, Canvas3dsAuthPayload, Canvas3dsChargeAuthEventPayload, Canvas3dsErrorEventPayload, Canvas3dsErrorPayload, Canvas3dsEventMap, Canvas3dsEventName, CheckoutIntentTokenPayload, CheckoutPaymentExpiredPayload, CheckoutPaymentFailurePayload, CheckoutPaymentSuccessPayload, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, EventTypes, FraudPreventionEvent, FraudPreventionEventType, FraudPreventionProvider, GooglePayAvailabilityOptions, GooglePayAvailabilityResult, GooglePayCardConfig, GooglePayOpenWalletMeta, GooglePayOpenWalletMetaStyles, HandleResponseInterface, IApplePayShippingOption, ICheckout, IClickToPayMeta, IDetails, IElementStyleInput, IEventAfterLoadData, IEventCheckoutFinishData, IEventData$1 as IEventData, IEventError, IEventFinishData, IEventMetaData, IEventSizeData, IFormValidation, IOpenWalletProvider, IPayPalMeta, IStyles$1 as IStyles, ITexts, ITokenStandalone3DS, IWalletMeta, IWalletOnClickEvent, IWalletPaymentSuccessfulEvent, IWalletUnavailableEvent, IWalletUpdateData, IWalletUpdateEvent, OTTResponse, OnCancelEventData, OnClickEventData$1 as OnClickEventData, OnCreateOTTErrorEventData, OnCreateOTTErrorPayload, OnCreateOTTSuccessPayload, OnCreateOTTSuccessfulEventData, OnErrorEventData$1 as OnErrorEventData, OnErrorPayload, OnLoadedEventData, OnUnavailableDetails, OnUnavailableEventData$1 as OnUnavailableEventData, OnUnavailablePayload, OpenWalletAvailabilityOptions, OpenWalletAvailabilityResult, OpenWalletBaseEvent, OpenWalletDataEvent, OpenWalletEventType, OpenWalletMeta, PaypalWalletMeta, ProcessAuthenticationResponse, Shipping, VaultDisplayStyle, OnClickEventData as WalletExpressOnClickEventData, OnCloseEventData as WalletExpressOnCloseEventData, OnErrorEventData as WalletExpressOnErrorEventData, OnPaymentErrorEventData as WalletExpressOnPaymentErrorEventData, OnPaymentInReviewEventData as WalletExpressOnPaymentInReviewEventData, OnPaymentSuccessfulEventData as WalletExpressOnPaymentSuccessfulEventData, OnShippingAddressChangeEventData as WalletExpressOnShippingAddressChangeEventData, OnShippingAddressChangeEventResponse as WalletExpressOnShippingAddressChangeEventResponse, OnShippingOptionChangeEventData as WalletExpressOnShippingOptionChangeEventData, OnShippingOptionChangeEventResponse as WalletExpressOnShippingOptionChangeEventResponse, OnUnavailableEventData as WalletExpressOnUnavailableEventData, WalletType, WidgetEventMap, WidgetEventName };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/helper/browser.ts"],"names":[],"mappings":"AAAA,qBAAa,OAAO;WACJ,UAAU,IAAI,OAAO;WAQrB,WAAW,IAAI,OAAO;WAQtB,cAAc,IAAI,OAAO;WAIzB,WAAW,IAAI,MAAM;WAIrB,iBAAiB,IAAI,MAAM;WAI3B,cAAc,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/helper/browser.ts"],"names":[],"mappings":"AAAA,qBAAa,OAAO;WACJ,UAAU,IAAI,OAAO;WAQrB,WAAW,IAAI,OAAO;WAQtB,cAAc,IAAI,OAAO;WAIzB,WAAW,IAAI,MAAM;WAIrB,iBAAiB,IAAI,MAAM;WAI3B,cAAc,IAAI,MAAM;WAkCxB,aAAa,IAAI,OAAO;WAIxB,YAAY,IAAI,MAAM;WAItB,aAAa,IAAI,MAAM;WAIvB,eAAe,IAAI,MAAM;WAIzB,cAAc,IAAI,MAAM;WAIxB,cAAc,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CAgClE"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generate a unique id compatible with HTML element id
|
|
2
|
+
* Generate a unique id compatible with HTML element id.
|
|
3
|
+
* Uses the Web Crypto API for cryptographically strong randomness, with a
|
|
4
|
+
* deterministic fallback only when crypto is unavailable.
|
|
3
5
|
*/
|
|
4
6
|
export declare function getUniqueId(): string;
|
|
5
7
|
//# sourceMappingURL=element-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-id.d.ts","sourceRoot":"","sources":["../../src/helper/element-id.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"element-id.d.ts","sourceRoot":"","sources":["../../src/helper/element-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,WAAW,WAkB1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/helper/uuid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/helper/uuid.ts"],"names":[],"mappings":"AAAA,qBAAa,IAAI;WACD,QAAQ;IAwCtB,OAAO,CAAC,MAAM,CAAC,IAAI;IAQnB,OAAO,CAAC,MAAM,CAAC,MAAM;CAatB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type GetConfigResponse } from '../api/api-service-internal';
|
|
2
2
|
import type { OpenWalletService } from './base/open-wallet.service';
|
|
3
3
|
import { OpenWalletButtons } from './base/open-wallet-buttons';
|
|
4
|
+
import type { ApplePayAvailabilityOptions, ApplePayAvailabilityResult } from './interfaces/apple-pay/apple-pay-availability.interface';
|
|
4
5
|
import type { ApplePayOpenWalletMeta } from './services/apple-pay';
|
|
5
6
|
import type { WalletType } from './types';
|
|
6
7
|
/**
|
|
@@ -41,6 +42,46 @@ import type { WalletType } from './types';
|
|
|
41
42
|
export declare class ApplePayOpenWalletButton extends OpenWalletButtons<ApplePayOpenWalletMeta> {
|
|
42
43
|
/** @private */
|
|
43
44
|
readonly walletType: WalletType;
|
|
45
|
+
/**
|
|
46
|
+
* Checks Apple Pay availability **without instantiating the button** — the single,
|
|
47
|
+
* authoritative, cross-browser-aware availability entry point.
|
|
48
|
+
*
|
|
49
|
+
* Resolves the merchant identifier (either supplied directly or fetched from the
|
|
50
|
+
* service configuration), loads Apple's web SDK if needed, then queries
|
|
51
|
+
* `ApplePaySession.applePayCapabilities()`. Returns a convenience `available` verdict
|
|
52
|
+
* (computed against `apple_pay_capabilities`), the raw device-reported
|
|
53
|
+
* `payment_credential_status`, and `has_native_session` so callers can infer the transport:
|
|
54
|
+
* `available && has_native_session` ⇒ native sheet likely; `available && !has_native_session`
|
|
55
|
+
* ⇒ cross-device / QR handoff likely.
|
|
56
|
+
*
|
|
57
|
+
* Pass `{ sync: true }` for a cheap, network-free native same-device pre-check that
|
|
58
|
+
* resolves immediately (see {@link ApplePayAvailabilityOptions.sync}).
|
|
59
|
+
*
|
|
60
|
+
* @param {ApplePayAvailabilityOptions} [options] - Merchant context, allowed capabilities, and mode.
|
|
61
|
+
* @returns {Promise<ApplePayAvailabilityResult>} The availability result.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // Lightest path — no network, when you already know the merchant identifier:
|
|
65
|
+
* const result = await ApplePayOpenWalletButton.checkAvailability({ merchant_id });
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* // Resolve the merchant identifier from the service configuration:
|
|
69
|
+
* const result = await ApplePayOpenWalletButton.checkAvailability({
|
|
70
|
+
* public_key_or_access_token,
|
|
71
|
+
* service_id,
|
|
72
|
+
* env: 'sandbox',
|
|
73
|
+
* });
|
|
74
|
+
* if (result.available) {
|
|
75
|
+
* // Render the Apple Pay button (native sheet or cross-device QR, per has_native_session).
|
|
76
|
+
* } else {
|
|
77
|
+
* console.log('Unavailable:', result.reason, result.payment_credential_status);
|
|
78
|
+
* }
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* // Synchronous native-only fast check (no network / SDK load):
|
|
82
|
+
* const { has_native_session } = await ApplePayOpenWalletButton.checkAvailability({ sync: true });
|
|
83
|
+
*/
|
|
84
|
+
static checkAvailability(options?: ApplePayAvailabilityOptions): Promise<ApplePayAvailabilityResult>;
|
|
44
85
|
/**
|
|
45
86
|
* Validates Apple Pay-specific required metadata fields.
|
|
46
87
|
* Apple Pay requires `amount_label` and `store_name` to be present and strings.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apple-pay-open-wallet-button.d.ts","sourceRoot":"","sources":["../../src/open-wallets/apple-pay-open-wallet-button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apple-pay-open-wallet-button.d.ts","sourceRoot":"","sources":["../../src/open-wallets/apple-pay-open-wallet-button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAiB,MAAM,6BAA6B,CAAC;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,yDAAyD,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAOnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,wBAAyB,SAAQ,iBAAiB,CAAC,sBAAsB,CAAC;IACrF,eAAe;IACf,SAAgB,UAAU,EAAE,UAAU,CAA0B;IAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;WACiB,iBAAiB,CACnC,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,0BAA0B,CAAC;IA+EtC;;;;;;;OAOG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAmBpC;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,iBAAiB,GAAG,IAAI;IASrE;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,iBAAiB,GAAG,iBAAiB;CAUnF"}
|
|
@@ -38,6 +38,16 @@ export declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = O
|
|
|
38
38
|
abstract readonly walletType: WalletType;
|
|
39
39
|
/** @private */
|
|
40
40
|
constructor(selector: string, publicKeyOrAccessToken: string, serviceId: string, meta: TMeta);
|
|
41
|
+
/**
|
|
42
|
+
* Invalidates the cached service configuration whenever an error or unavailable
|
|
43
|
+
* event fires, so the next `load()` re-fetches a fresh config. The cache is keyed
|
|
44
|
+
* on the service ID with a 1-day TTL; clearing it on failure means a config that
|
|
45
|
+
* changed server-side (and caused the failure) is not reused until the TTL expires.
|
|
46
|
+
* Registered once per button, independently of any merchant-registered handlers.
|
|
47
|
+
*
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
private registerCacheInvalidationOnError;
|
|
41
51
|
/**
|
|
42
52
|
* Creates the wallet-specific service instance for this button.
|
|
43
53
|
* Each concrete subclass implements this to instantiate its specific wallet service.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-wallet-buttons.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/base/open-wallet-buttons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,8BAA8B,EAC9B,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,0DAA0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;OAkCG;IACI,uBAAuB,CAC5B,OAAO,EAAE,CACP,IAAI,EAAE,gCAAgC,KAEpC,oCAAoC,GACpC,OAAO,CAAC,oCAAoC,CAAC;IAYnD;;;;;;OAMG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACI,uBAAuB,CAC5B,OAAO,EAAE,CACP,IAAI,EAAE,+BAA+B,KAEnC,mCAAmC,GACnC,OAAO,CAAC,mCAAmC,CAAC;IAalD;;;;;;OAMG;IACH,IAAW,wCAAwC,IAAI,OAAO,CAE7D;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ApiInternal } from '../../api/api-internal';
|
|
2
|
+
import type { GetConfigResponse } from '../../api/api-service-internal';
|
|
3
|
+
/**
|
|
4
|
+
* Removes the cached service configuration for the given service ID, forcing the next
|
|
5
|
+
* fetch to go to the network. Called on error / unavailable flows so a potentially
|
|
6
|
+
* stale cached config is not reused after something changed server-side. No-throw when
|
|
7
|
+
* `localStorage` is unavailable.
|
|
8
|
+
*
|
|
9
|
+
* @param serviceId - The service ID whose cached configuration should be cleared.
|
|
10
|
+
*/
|
|
11
|
+
export declare function clearServiceConfigCache(serviceId: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* Fetches the wallet service configuration, backed by a 1-day `localStorage` cache
|
|
14
|
+
* keyed on the service ID. Falls back gracefully (no caching) when `localStorage`
|
|
15
|
+
* is unavailable (e.g. private browsing). Shared by the instance `load()` flow and
|
|
16
|
+
* the static availability checks so both reuse the same cached fetch.
|
|
17
|
+
*
|
|
18
|
+
* @param api - The configured API client (env must already be set).
|
|
19
|
+
* @param serviceId - The service ID to fetch the configuration for.
|
|
20
|
+
* @returns The service configuration response.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getServiceConfigCached(api: ApiInternal, serviceId: string): Promise<GetConfigResponse>;
|
|
23
|
+
//# sourceMappingURL=service-config-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-config-cache.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/base/service-config-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAUxE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAM/D;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,iBAAiB,CAAC,CAkC5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GetConfigResponse } from '../api/api-service-internal';
|
|
2
2
|
import type { OpenWalletService } from './base/open-wallet.service';
|
|
3
3
|
import { OpenWalletButtons } from './base/open-wallet-buttons';
|
|
4
|
-
import type { GooglePayOpenWalletMeta } from './interfaces/google-pay';
|
|
4
|
+
import type { GooglePayAvailabilityOptions, GooglePayAvailabilityResult, GooglePayOpenWalletMeta } from './interfaces/google-pay';
|
|
5
5
|
import type { WalletType } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* @classdesc Google Pay wallet button that creates One-Time Tokens (OTT) via Google Pay.
|
|
@@ -39,6 +39,38 @@ import type { WalletType } from './types';
|
|
|
39
39
|
export declare class GooglePayOpenWalletButton extends OpenWalletButtons<GooglePayOpenWalletMeta> {
|
|
40
40
|
/** @private */
|
|
41
41
|
readonly walletType: WalletType;
|
|
42
|
+
/**
|
|
43
|
+
* Checks Google Pay availability **without instantiating the button** — the static
|
|
44
|
+
* availability entry point.
|
|
45
|
+
*
|
|
46
|
+
* Loads the Google Pay JS SDK if needed, then runs `PaymentsClient.isReadyToPay()` using
|
|
47
|
+
* the **default** card configuration (a button instance with a custom `card_config` may
|
|
48
|
+
* produce a different result). All options are optional — unlike Apple Pay, Google Pay's
|
|
49
|
+
* readiness check does not require a merchant identifier; supplying `service_id` +
|
|
50
|
+
* `public_key_or_access_token` additionally validates that the service is a Google Pay service.
|
|
51
|
+
*
|
|
52
|
+
* Pass `{ sync: true }` for a cheap, network-free check that only reports whether the
|
|
53
|
+
* Google Pay JS API is already present (see {@link GooglePayAvailabilityOptions.sync}).
|
|
54
|
+
*
|
|
55
|
+
* @param {GooglePayAvailabilityOptions} [options] - Optional merchant context and mode.
|
|
56
|
+
* @returns {Promise<GooglePayAvailabilityResult>} The availability result.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Simplest form — no merchant context needed:
|
|
60
|
+
* const result = await GooglePayOpenWalletButton.checkAvailability();
|
|
61
|
+
* if (result.available) {
|
|
62
|
+
* // Render the Google Pay button.
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // Validate the service is a Google Pay service while checking:
|
|
67
|
+
* const result = await GooglePayOpenWalletButton.checkAvailability({
|
|
68
|
+
* public_key_or_access_token,
|
|
69
|
+
* service_id,
|
|
70
|
+
* env: 'sandbox',
|
|
71
|
+
* });
|
|
72
|
+
*/
|
|
73
|
+
static checkAvailability(options?: GooglePayAvailabilityOptions): Promise<GooglePayAvailabilityResult>;
|
|
42
74
|
/**
|
|
43
75
|
* Validates Google Pay-specific required metadata fields.
|
|
44
76
|
* Google Pay has no additional required fields beyond the base (amount, currency, country).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-pay-open-wallet-button.d.ts","sourceRoot":"","sources":["../../src/open-wallets/google-pay-open-wallet-button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"google-pay-open-wallet-button.d.ts","sourceRoot":"","sources":["../../src/open-wallets/google-pay-open-wallet-button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAiB,MAAM,6BAA6B,CAAC;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AAOjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,yBAA0B,SAAQ,iBAAiB,CAAC,uBAAuB,CAAC;IACvF,eAAe;IACf,SAAgB,UAAU,EAAE,UAAU,CAA2B;IAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACiB,iBAAiB,CACnC,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,2BAA2B,CAAC;IAqDvC;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAMpC;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,iBAAiB,GAAG,IAAI;IASrE;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,iBAAiB,GAAG,iBAAiB;CAUnF"}
|
|
@@ -26,7 +26,7 @@ export { WALLET_TYPES } from './types/wallet-type.type';
|
|
|
26
26
|
* @param {IApplePayShippingOption[]} [shipping_options] - Array of available shipping options. The first item is used as the default selected option. Requires `request_shipping` to be `true`.
|
|
27
27
|
* @param {boolean} [show_billing_address] - Show billing address fields in the Apple Pay sheet.
|
|
28
28
|
* @param {string} store_name - The merchant's store name displayed during payment.
|
|
29
|
-
* @param {Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>} [apple_pay_capabilities] - Device
|
|
29
|
+
* @param {Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>} [apple_pay_capabilities] - Device credential statuses that make the button render. Defaults to `['credentials_available', 'credentials_status_unknown']`: `credentials_available` means the device has a confirmed Apple Pay card ready to use; `credentials_status_unknown` means a local card can't be confirmed but Apple Pay can still proceed (e.g. the cross-device QR flow used by Chrome, Edge and Firefox). Narrow to `['credentials_available']` to require a confirmed local card.
|
|
30
30
|
* @param {Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>} [merchant_capabilities] - Array of merchant capabilities influencing the transaction processing features available.
|
|
31
31
|
* @param {Array<'visa' | 'masterCard' | 'amex' | 'chinaUnionPay' | 'discover' | 'interac' | 'jcb' | 'privateLabel'>} [supported_networks] - List of payment networks supported for Apple Pay transactions.
|
|
32
32
|
* @param {Array<'email' | 'name' | 'phone' | 'postalAddress'>} [required_billing_contact_fields] - Contact fields required from the user for billing purposes. Phone and email are currently not returned by Apple.
|
|
@@ -57,6 +57,87 @@ export { WALLET_TYPES } from './types/wallet-type.type';
|
|
|
57
57
|
* @param {GooglePayButtonColor} [style.button_color] - The color of the Google Pay button (`'default'`, `'black'`, `'white'`).
|
|
58
58
|
* @param {GooglePayButtonSizeMode} [style.button_size_mode] - The size mode (`'static'`, `'fill'`).
|
|
59
59
|
**/
|
|
60
|
+
/**
|
|
61
|
+
* Base options shared by every wallet's static availability check
|
|
62
|
+
* (e.g. {@link ApplePayOpenWalletButton}.checkAvailability). Wallet-specific option
|
|
63
|
+
* interfaces (such as {@link ApplePayAvailabilityOptions}) extend this.
|
|
64
|
+
*
|
|
65
|
+
* @interface OpenWalletAvailabilityOptions
|
|
66
|
+
*
|
|
67
|
+
* @type {object}
|
|
68
|
+
* @param {string} [public_key_or_access_token] - Public key or access token used to fetch the service config when needed.
|
|
69
|
+
* @param {string} [service_id] - Service ID — used with `public_key_or_access_token` to resolve the wallet configuration.
|
|
70
|
+
* @param {string} [env] - Environment for the config fetch (e.g. `'sandbox'`). Defaults to the SDK default.
|
|
71
|
+
* @param {boolean} [sync] - When `true`, performs only the cheap, network-free synchronous check and resolves immediately — no config fetch, SDK load, or remote capability query.
|
|
72
|
+
**/
|
|
73
|
+
/**
|
|
74
|
+
* Base result shared by every wallet's static availability check. Wallet-specific
|
|
75
|
+
* result interfaces (such as {@link ApplePayAvailabilityResult}) extend this.
|
|
76
|
+
*
|
|
77
|
+
* @interface OpenWalletAvailabilityResult
|
|
78
|
+
*
|
|
79
|
+
* @type {object}
|
|
80
|
+
* @param {boolean} available - Convenience verdict: the wallet is usable for a payment in the current context.
|
|
81
|
+
* @param {boolean} supported - Whether the wallet is supported here at all (may be available via a fallback flow).
|
|
82
|
+
* @param {string} [reason] - Machine-readable reason when not available.
|
|
83
|
+
**/
|
|
84
|
+
/**
|
|
85
|
+
* Options for `ApplePayOpenWalletButton.checkAvailability`. Extends
|
|
86
|
+
* {@link OpenWalletAvailabilityOptions}. Provide `merchant_id` directly to skip the network
|
|
87
|
+
* call, **or** provide `public_key_or_access_token` + `service_id` to resolve the merchant
|
|
88
|
+
* identifier from the service configuration.
|
|
89
|
+
*
|
|
90
|
+
* @interface ApplePayAvailabilityOptions
|
|
91
|
+
* @extends OpenWalletAvailabilityOptions
|
|
92
|
+
*
|
|
93
|
+
* @type {object}
|
|
94
|
+
* @param {string} [merchant_id] - Apple merchant identifier. Provide this OR (`public_key_or_access_token` + `service_id`).
|
|
95
|
+
* @param {Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>} [apple_pay_capabilities] - Device credential statuses that count as available. Defaults to `['credentials_available', 'credentials_status_unknown']` — `credentials_status_unknown` is what third-party / cross-device (QR) browsers report, so the default keeps Apple Pay visible outside Safari.
|
|
96
|
+
* @param {boolean} [sync] - When `true`, runs only the synchronous native same-device check (`window.ApplePaySession` + `canMakePayments()`) and resolves immediately — no merchant resolution, SDK load, or `applePayCapabilities()` query. In this mode `available` reflects the native session only and `payment_credential_status` is `undefined`; it is **not** authoritative for cross-browser / QR availability.
|
|
97
|
+
**/
|
|
98
|
+
/**
|
|
99
|
+
* Result of `ApplePayOpenWalletButton.checkAvailability`. Extends
|
|
100
|
+
* {@link OpenWalletAvailabilityResult}.
|
|
101
|
+
*
|
|
102
|
+
* Infer the transport (Apple does not expose it directly): `available && has_native_session`
|
|
103
|
+
* ⇒ native sheet likely; `available && !has_native_session` ⇒ cross-device / QR handoff likely.
|
|
104
|
+
*
|
|
105
|
+
* @interface ApplePayAvailabilityResult
|
|
106
|
+
* @extends OpenWalletAvailabilityResult
|
|
107
|
+
*
|
|
108
|
+
* @type {object}
|
|
109
|
+
* @param {boolean} available - Whether the device credential status is within the allowed capability set.
|
|
110
|
+
* @param {boolean} supported - Whether Apple Pay is usable here at all (incl. the cross-device QR flow). Derived from `payment_credential_status` (anything other than `applePayUnsupported`); falls back to the native `canMakePayments()` signal when the capabilities query could not run.
|
|
111
|
+
* @param {boolean} has_native_session - Whether a native, same-device Apple Pay session is present right now (`ApplePaySession` exists and `canMakePayments()` is `true`).
|
|
112
|
+
* @param {'paymentCredentialsAvailable' | 'paymentCredentialStatusUnknown' | 'paymentCredentialsUnavailable' | 'applePayUnsupported'} [payment_credential_status] - The raw device-reported credential status. Undefined when unsupported or not queried.
|
|
113
|
+
* @param {string} [reason] - Machine-readable reason when not available: `'unsupported_browser'`, `'missing_merchant_id'`, `'service_type_mismatch'`, `'config_fetch_failed'`, `'sdk_load_failed'`, `'query_failed'`, `'no_credentials'`, or `'no_native_session'` (only from the synchronous `sync: true` check).
|
|
114
|
+
**/
|
|
115
|
+
/**
|
|
116
|
+
* Options for `GooglePayOpenWalletButton.checkAvailability`. Extends
|
|
117
|
+
* {@link OpenWalletAvailabilityOptions}. All fields are optional — Google Pay's
|
|
118
|
+
* `isReadyToPay` check does not require a merchant identifier. Supplying
|
|
119
|
+
* `public_key_or_access_token` + `service_id` additionally validates the service type.
|
|
120
|
+
*
|
|
121
|
+
* @interface GooglePayAvailabilityOptions
|
|
122
|
+
* @extends OpenWalletAvailabilityOptions
|
|
123
|
+
*
|
|
124
|
+
* @type {object}
|
|
125
|
+
* @param {string} [merchant_id] - Google Pay gateway merchant identifier. Optional; the readiness check runs without it.
|
|
126
|
+
* @param {boolean} [sync] - When `true`, reports only whether the Google Pay JS API is already present in the page (no `isReadyToPay` call). It does **not** run the device/card readiness check.
|
|
127
|
+
**/
|
|
128
|
+
/**
|
|
129
|
+
* Result of `GooglePayOpenWalletButton.checkAvailability`. Extends
|
|
130
|
+
* {@link OpenWalletAvailabilityResult}.
|
|
131
|
+
*
|
|
132
|
+
* @interface GooglePayAvailabilityResult
|
|
133
|
+
* @extends OpenWalletAvailabilityResult
|
|
134
|
+
*
|
|
135
|
+
* @type {object}
|
|
136
|
+
* @param {boolean} available - Whether Google Pay is ready to pay in the current context (from `isReadyToPay().result`).
|
|
137
|
+
* @param {boolean} supported - Whether the Google Pay JS API is present and the readiness query could run.
|
|
138
|
+
* @param {boolean} [payment_method_present] - Google's `isReadyToPay` `paymentMethodPresent` — whether the buyer already has a usable payment method. Undefined when not reported.
|
|
139
|
+
* @param {string} [reason] - Machine-readable reason when not available: `'unsupported_browser'`, `'service_type_mismatch'`, `'config_fetch_failed'`, `'sdk_load_failed'`, `'query_failed'`, `'no_payment_method'`, or `'api_not_loaded'` (only from the synchronous `sync: true` check).
|
|
140
|
+
**/
|
|
60
141
|
/**
|
|
61
142
|
* Interface for OnClickEventData.
|
|
62
143
|
* Emitted when the wallet button is clicked.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/open-wallets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAM1E,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,mBAAmB,cAAc,CAAC;AAClC,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,mDAAmD,CAAC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,GAC9B,MAAM,mDAAmD,CAAC;AAC3D,YAAY,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AACjG,mBAAmB,SAAS,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BI;AAEJ;;;;;;;;;;;;;;;;;;;IAmBI;AAEJ;;;;;;;;;;;;IAYI;AAEJ;;;;;;;;;;IAUI;AAEJ;;;;;;;;;;;;;IAaI;AAEJ;;;;;;;;;;;;;;;;IAgBI;AAEJ;;;;;;;;;;;;IAYI;AAEJ;;;;;;;;;;;;IAYI;AAEJ;;;;;;;;;;;;;;;IAeI;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCI;AAEJ;;;;;;;;;;IAUI;AAEJ;;;;;;;;;;;IAWI;AAEJ;;;;;;;;;;;IAWI;AAEJ;;;;;;;;;IASI;AAEJ;;;;;;;IAOI;AAEJ;;;;;;;;;;;;;;;;;;;;;IAqBI;AAEJ;;;;;;;;;;;;IAYI;AAEJ;;;;;;;;;;;;;;IAcI;AAEJ;;;;;;;;;;IAUI;AAEJ;;;;;;;;;;;;;;;;;;;;;IAqBI;AAEJ;;;;;;;;;;IAUI;AAEJ;;;;;;;;;IASI;AAEJ;;;;;;;;;;;;IAYI;AAEJ;;;;;;;;;;;;;GAaG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { OpenWalletAvailabilityOptions, OpenWalletAvailabilityResult } from '../open-wallet-availability.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Friendly capability tokens accepted as **input** — the same values used in
|
|
4
|
+
* `ApplePayOpenWalletMeta.apple_pay_capabilities`. They declare which device
|
|
5
|
+
* credential statuses should be treated as "available".
|
|
6
|
+
*/
|
|
7
|
+
export type ApplePayCapabilityToken = 'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable';
|
|
8
|
+
/**
|
|
9
|
+
* Device-reported credential status — the **output** of
|
|
10
|
+
* `ApplePaySession.applePayCapabilities()`.
|
|
11
|
+
*/
|
|
12
|
+
export type ApplePayCredentialStatus = 'paymentCredentialsAvailable' | 'paymentCredentialStatusUnknown' | 'paymentCredentialsUnavailable' | 'applePayUnsupported';
|
|
13
|
+
/**
|
|
14
|
+
* Options for `ApplePayOpenWalletButton.checkAvailability`. Provide `merchant_id`
|
|
15
|
+
* directly to skip the network call, **or** provide `public_key_or_access_token` +
|
|
16
|
+
* `service_id` to have the SDK resolve the merchant identifier from the service config.
|
|
17
|
+
*/
|
|
18
|
+
export interface ApplePayAvailabilityOptions extends OpenWalletAvailabilityOptions {
|
|
19
|
+
/** Apple merchant identifier. Provide this OR (`public_key_or_access_token` + `service_id`). */
|
|
20
|
+
merchant_id?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Device credential statuses that count as available. Defaults to
|
|
23
|
+
* `['credentials_available', 'credentials_status_unknown']` — `credentials_status_unknown`
|
|
24
|
+
* is what third-party / cross-device (QR) browsers report, so the default keeps Apple Pay
|
|
25
|
+
* visible outside Safari.
|
|
26
|
+
*/
|
|
27
|
+
apple_pay_capabilities?: ApplePayCapabilityToken[];
|
|
28
|
+
}
|
|
29
|
+
/** Result of `ApplePayOpenWalletButton.checkAvailability`. */
|
|
30
|
+
export interface ApplePayAvailabilityResult extends OpenWalletAvailabilityResult {
|
|
31
|
+
/**
|
|
32
|
+
* Whether a **native, same-device** Apple Pay session is present right now
|
|
33
|
+
* (`ApplePaySession` exists and `canMakePayments()` is `true`). Apple does not expose
|
|
34
|
+
* the transport directly, so use this to infer it: `available && has_native_session` ⇒
|
|
35
|
+
* native sheet likely; `available && !has_native_session` ⇒ cross-device / QR handoff likely.
|
|
36
|
+
*/
|
|
37
|
+
has_native_session: boolean;
|
|
38
|
+
/** The raw device-reported credential status. Undefined when unsupported or not queried. */
|
|
39
|
+
payment_credential_status?: ApplePayCredentialStatus;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=apple-pay-availability.interface.d.ts.map
|
package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-availability.interface.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apple-pay-availability.interface.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/interfaces/apple-pay/apple-pay-availability.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,uCAAuC,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAC/B,uBAAuB,GACvB,4BAA4B,GAC5B,yBAAyB,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,6BAA6B,GAC7B,gCAAgC,GAChC,+BAA+B,GAC/B,qBAAqB,CAAC;AAE1B;;;;GAIG;AACH,MAAM,WAAW,2BAA4B,SAAQ,6BAA6B;IAChF,gGAAgG;IAChG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACpD;AAED,8DAA8D;AAC9D,MAAM,WAAW,0BAA2B,SAAQ,4BAA4B;IAC9E;;;;;OAKG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B,4FAA4F;IAC5F,yBAAyB,CAAC,EAAE,wBAAwB,CAAC;CACtD"}
|