@paydock/client-sdk 1.139.0-beta → 1.140.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 +2573 -0
- package/bundles/index.cjs +1296 -508
- package/bundles/index.cjs.d.ts +1377 -200
- package/bundles/index.mjs +1295 -509
- package/bundles/index.mjs.d.ts +1377 -200
- package/bundles/types/checkout/checkout.d.ts.map +1 -1
- package/bundles/types/checkout/v1/instructions/instruction.card_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/v3/instructions/instruction.card_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/v3/instructions/instruction.payment_methods.show.d.ts.map +1 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts +1 -2
- package/bundles/types/checkout-button/zipmoney/zipmoney-contextual.runner.d.ts.map +1 -1
- package/bundles/types/open-wallets/apple-pay-open-wallet-button.d.ts +70 -0
- package/bundles/types/open-wallets/apple-pay-open-wallet-button.d.ts.map +1 -0
- package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts +242 -74
- package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts.map +1 -1
- package/bundles/types/open-wallets/base/open-wallet.service.d.ts +62 -4
- package/bundles/types/open-wallets/base/open-wallet.service.d.ts.map +1 -1
- package/bundles/types/open-wallets/enum/error-operation.enum.d.ts +15 -0
- package/bundles/types/open-wallets/enum/error-operation.enum.d.ts.map +1 -0
- package/bundles/types/open-wallets/enum/event.enum.d.ts +11 -3
- package/bundles/types/open-wallets/enum/event.enum.d.ts.map +1 -1
- package/bundles/types/open-wallets/enum/token-type.enum.d.ts +10 -0
- package/bundles/types/open-wallets/enum/token-type.enum.d.ts.map +1 -0
- package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts +65 -0
- package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts.map +1 -0
- package/bundles/types/open-wallets/index.d.ts +293 -0
- package/bundles/types/open-wallets/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/events.interface.d.ts +87 -14
- package/bundles/types/open-wallets/interfaces/events.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts +6 -0
- package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/index.d.ts +2 -2
- package/bundles/types/open-wallets/interfaces/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/open-wallet-meta.interface.d.ts +12 -0
- package/bundles/types/open-wallets/interfaces/open-wallet-meta.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/payment-source.interface.d.ts +28 -2
- package/bundles/types/open-wallets/interfaces/payment-source.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts +27 -2
- package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/google-pay/constants/google-pay.constants.d.ts +9 -0
- package/bundles/types/open-wallets/services/google-pay/constants/google-pay.constants.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/google-pay/google-pay.open-wallet.service.d.ts +20 -9
- 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/utils/google-pay.utils.d.ts +45 -0
- package/bundles/types/open-wallets/services/google-pay/utils/google-pay.utils.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/google-pay/utils/index.d.ts +1 -1
- package/bundles/types/open-wallets/services/google-pay/utils/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/google-pay/validation/google-pay.validation.d.ts +13 -0
- package/bundles/types/open-wallets/services/google-pay/validation/google-pay.validation.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/base-event-data.interface.d.ts +24 -2
- package/bundles/types/open-wallets/types/base-event-data.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/index.d.ts +2 -1
- package/bundles/types/open-wallets/types/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/on-shipping-address-change-event-data.interface.d.ts +16 -2
- package/bundles/types/open-wallets/types/on-shipping-address-change-event-data.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/on-shipping-address-change-event-response.interface.d.ts +20 -2
- package/bundles/types/open-wallets/types/on-shipping-address-change-event-response.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/on-shipping-option-change-event-data.interface.d.ts +13 -2
- package/bundles/types/open-wallets/types/on-shipping-option-change-event-data.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/on-shipping-option-change-event-response.interface.d.ts +12 -0
- package/bundles/types/open-wallets/types/on-shipping-option-change-event-response.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/payment-source.type.d.ts +3 -2
- package/bundles/types/open-wallets/types/payment-source.type.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/shipping-event-to-response.type.d.ts +8 -0
- package/bundles/types/open-wallets/types/shipping-event-to-response.type.d.ts.map +1 -1
- package/bundles/widget.umd.js +1296 -508
- package/bundles/widget.umd.js.d.ts +1377 -200
- package/bundles/widget.umd.js.min.d.ts +1377 -200
- package/bundles/widget.umd.min.js +1 -1
- package/docs/open-wallet-buttons-examples.md +561 -830
- package/docs/open-wallet-buttons.md +1652 -0
- package/package.json +1 -1
- package/slate.md +1673 -0
|
@@ -1,33 +1,106 @@
|
|
|
1
|
-
import type { BaseEventData } from '../../wallet-buttons-express/interfaces/base-event-data.interface';
|
|
2
1
|
import type { EVENT } from '../enum/event.enum';
|
|
2
|
+
import type { ERROR_OPERATION } from '../enum/error-operation.enum';
|
|
3
|
+
import type { OpenWalletBaseEvent, OpenWalletDataEvent } from '../types/base-event-data.interface';
|
|
3
4
|
import type { Billing, CreateOTTResponse, Shipping } from '../types/payment-source.type';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Data emitted when the wallet button is clicked.
|
|
7
|
+
*
|
|
8
|
+
* The merchant's `onClick` handler controls the payment flow via its return value:
|
|
9
|
+
* - Return `void` / `undefined` to continue normally.
|
|
10
|
+
* - Return `false` to abort the payment flow.
|
|
11
|
+
* - Return a `Promise<void>` to defer the wallet sheet until the promise resolves.
|
|
12
|
+
* - Return a `Promise<boolean>` — if it resolves to `false`, the flow is aborted.
|
|
13
|
+
* - Throwing an error also aborts the flow.
|
|
14
|
+
*/
|
|
15
|
+
export interface OnClickEventData extends OpenWalletBaseEvent {
|
|
16
|
+
event: EVENT.ON_CLICK;
|
|
8
17
|
}
|
|
9
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Payload for the onSuccess event data.
|
|
20
|
+
*/
|
|
21
|
+
export interface OnCreateOTTSuccessPayload {
|
|
22
|
+
/** The created OTT response containing the temporary token. */
|
|
10
23
|
token: CreateOTTResponse;
|
|
24
|
+
/** The payment amount. */
|
|
11
25
|
amount: number;
|
|
26
|
+
/** The shipping address and contact information, if provided. */
|
|
12
27
|
shipping?: Shipping;
|
|
28
|
+
/** The billing address, if provided. */
|
|
13
29
|
billing?: Billing;
|
|
14
30
|
}
|
|
15
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Data emitted when the OTT (One-Time Token) creation is successful.
|
|
33
|
+
*/
|
|
34
|
+
export interface OnCreateOTTSuccessfulEventData extends OpenWalletDataEvent<OnCreateOTTSuccessPayload> {
|
|
35
|
+
event: EVENT.SUCCESS;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Payload for the OTT error event data.
|
|
39
|
+
*/
|
|
40
|
+
export interface OnCreateOTTErrorPayload {
|
|
41
|
+
/** Error message from the API. */
|
|
16
42
|
message?: string;
|
|
43
|
+
/** Error code from the API. */
|
|
17
44
|
code?: string;
|
|
18
|
-
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Data emitted when the OTT creation fails.
|
|
48
|
+
*/
|
|
49
|
+
export interface OnCreateOTTErrorEventData extends OpenWalletDataEvent<OnCreateOTTErrorPayload> {
|
|
19
50
|
event: EVENT.ERROR;
|
|
20
51
|
}
|
|
21
|
-
|
|
22
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Typed details for the unavailable event.
|
|
54
|
+
*/
|
|
55
|
+
export interface OnUnavailableDetails {
|
|
56
|
+
/** The service ID that was checked. */
|
|
57
|
+
service_id: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Payload for the onUnavailable event data.
|
|
61
|
+
*/
|
|
62
|
+
export interface OnUnavailablePayload {
|
|
63
|
+
/** A human-readable reason why the wallet is unavailable. */
|
|
23
64
|
reason: string;
|
|
24
|
-
details
|
|
65
|
+
/** Additional details about the unavailability. */
|
|
66
|
+
details?: OnUnavailableDetails;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Data emitted when the wallet is not available on the current device or browser.
|
|
70
|
+
*/
|
|
71
|
+
export interface OnUnavailableEventData extends OpenWalletDataEvent<OnUnavailablePayload> {
|
|
72
|
+
event: EVENT.UNAVAILABLE;
|
|
25
73
|
}
|
|
26
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Payload for the onError event data.
|
|
76
|
+
*/
|
|
77
|
+
export interface OnErrorPayload {
|
|
78
|
+
/** The Error object describing what went wrong. */
|
|
27
79
|
error: Error;
|
|
80
|
+
/** Context about the error. */
|
|
28
81
|
context?: {
|
|
29
|
-
operation
|
|
30
|
-
|
|
82
|
+
/** The operation that failed. */
|
|
83
|
+
operation?: ERROR_OPERATION;
|
|
31
84
|
};
|
|
32
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Data emitted when an error occurs during wallet operation.
|
|
88
|
+
*/
|
|
89
|
+
export interface OnErrorEventData extends OpenWalletDataEvent<OnErrorPayload> {
|
|
90
|
+
event: EVENT.ERROR;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Data emitted when the wallet button has been loaded and rendered in the DOM.
|
|
94
|
+
* No payload — the specific wallet type is determined by the concrete button class.
|
|
95
|
+
*/
|
|
96
|
+
export interface OnLoadedEventData extends OpenWalletBaseEvent {
|
|
97
|
+
event: EVENT.LOADED;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Data emitted when the wallet checkout is cancelled or closed by the user.
|
|
101
|
+
* No payload — matches WalletButtonsExpress `OnCloseEventData` convention.
|
|
102
|
+
*/
|
|
103
|
+
export interface OnCancelEventData extends OpenWalletBaseEvent {
|
|
104
|
+
event: EVENT.CHECKOUT_CLOSE;
|
|
105
|
+
}
|
|
33
106
|
//# sourceMappingURL=events.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/events.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"events.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/events.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACV,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAMtC;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC;CACvB;AAMD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,+DAA+D;IAC/D,KAAK,EAAE,iBAAiB,CAAC;IACzB,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,wCAAwC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;CACn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AC,cAAc,CAAC;CAC7B"}
|
|
@@ -11,8 +11,14 @@ export interface GooglePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
|
|
|
11
11
|
}
|
|
12
12
|
export interface GooglePayOpenWalletMeta extends OpenWalletMeta {
|
|
13
13
|
merchant_name?: string;
|
|
14
|
+
/** Whether shipping address collection is required. */
|
|
14
15
|
request_shipping?: boolean;
|
|
15
16
|
show_billing_address?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Available shipping options to display in the payment sheet.
|
|
19
|
+
* The first item in the array is used as the default selected option.
|
|
20
|
+
* Requires `request_shipping` to be `true`.
|
|
21
|
+
*/
|
|
16
22
|
shipping_options?: IGooglePayShippingOption[];
|
|
17
23
|
amount_label?: string;
|
|
18
24
|
style?: GooglePayOpenWalletMetaStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-pay-meta.interface.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/interfaces/google-pay/google-pay-meta.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAChE,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,UAAU,GACV,UAAU,GACV,KAAK,GACL,WAAW,GACX,SAAS,GACT,KAAK,GACL,SAAS,GACT,YAAY,GACZ,MAAM,CAAC;AACX,KAAK,oBAAoB,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,6BAA8B,SAAQ,oBAAoB;IACzE,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3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,CAAC;CACP"}
|
|
1
|
+
{"version":3,"file":"google-pay-meta.interface.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/interfaces/google-pay/google-pay-meta.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAChE,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,UAAU,GACV,UAAU,GACV,KAAK,GACL,WAAW,GACX,SAAS,GACT,KAAK,GACL,SAAS,GACT,YAAY,GACZ,MAAM,CAAC;AACX,KAAK,oBAAoB,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,6BAA8B,SAAQ,oBAAoB;IACzE,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,YAAY,CAAC,EAAE,oBAAoB,CAAC;CACrC;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,6BAA6B,CAAC;IACtC,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,UAAU,EAAE;QACV,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;QAC5C,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;QAC9C,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,0BAA0B,CAAC,EAAE,OAAO,CAAC;QACrC,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC,0BAA0B,CAAC,EAAE;YAC3B,MAAM,EAAE,oBAAoB,CAAC;YAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;SACjC,CAAC;QACF,uBAAuB,CAAC,EAAE;YACxB,YAAY,EAAE,oBAAoB,CAAC;YACnC,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;SAC/B,EAAE,CAAC;KACL,CAAC;IAEF,0BAA0B,CAAC,EACvB;QACE,IAAI,EAAE,iBAAiB,CAAC;QACxB,UAAU,EAAE;YACV,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;SACvB,CAAC;KACH,GACD;QACE,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE;YACV,gBAAgB,EAAE,MAAM,CAAC;YACzB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;KACH,CAAC;CACP"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { WalletType } from '../types/wallet-type.type';
|
|
2
2
|
export { WALLET_TYPES } from '../types/wallet-type.type';
|
|
3
|
-
export type {
|
|
3
|
+
export type { OnCancelEventData, OnClickEventData, OnCreateOTTErrorEventData, OnCreateOTTErrorPayload, OnCreateOTTSuccessfulEventData, OnCreateOTTSuccessPayload, OnErrorEventData, OnErrorPayload, OnLoadedEventData, OnUnavailableDetails, OnUnavailableEventData, OnUnavailablePayload, } from './events.interface';
|
|
4
4
|
export type { OpenWalletMeta } from './open-wallet-meta.interface';
|
|
5
|
-
export type {
|
|
5
|
+
export type { IOpenWalletProvider } from './payment-source.interface';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EACV,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,EAC9B,yBAAyB,EACzB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base metadata required to configure an OpenWallet button.
|
|
3
|
+
*/
|
|
1
4
|
export interface OpenWalletMeta {
|
|
5
|
+
/** The payment amount as a number (e.g. `19.99`). */
|
|
2
6
|
amount: number;
|
|
7
|
+
/** The ISO 4217 currency code (e.g. `'AUD'`, `'USD'`). */
|
|
3
8
|
currency: string;
|
|
9
|
+
/** The ISO 3166-1 alpha-2 country code (e.g. `'AU'`, `'US'`). */
|
|
4
10
|
country: string;
|
|
11
|
+
/** Optional styling configuration for the wallet button. */
|
|
5
12
|
style?: OpenWalletMetaStyles;
|
|
6
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Styling options for the wallet button appearance.
|
|
16
|
+
*/
|
|
7
17
|
export interface OpenWalletMetaStyles {
|
|
18
|
+
/** The button type variant (wallet-specific values). */
|
|
8
19
|
button_type?: string;
|
|
20
|
+
/** The button color/style variant (wallet-specific values). */
|
|
9
21
|
button_style?: string;
|
|
10
22
|
}
|
|
11
23
|
//# sourceMappingURL=open-wallet-meta.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-wallet-meta.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/open-wallet-meta.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
1
|
+
{"version":3,"file":"open-wallet-meta.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/open-wallet-meta.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { OpenWalletMeta } from './open-wallet-meta.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Internal contract for wallet-specific service providers (Apple Pay, Google Pay, etc.).
|
|
4
|
+
*
|
|
5
|
+
* This interface defines the operations that the wallet-specific button classes
|
|
6
|
+
* ({@link ApplePayOpenWalletButton}, {@link GooglePayOpenWalletButton}) delegate
|
|
7
|
+
* to the resolved wallet service after fetching the service configuration.
|
|
8
|
+
*
|
|
9
|
+
* **Note:** This is NOT the merchant-facing API. Merchants interact with
|
|
10
|
+
* {@link ApplePayOpenWalletButton} or {@link GooglePayOpenWalletButton} directly,
|
|
11
|
+
* which orchestrate these providers internally.
|
|
12
|
+
*/
|
|
13
|
+
export interface IOpenWalletProvider {
|
|
14
|
+
/**
|
|
15
|
+
* Loads the wallet SDK, checks availability, and renders the wallet button.
|
|
16
|
+
* If the wallet is not available, emits the `unavailable` event instead.
|
|
17
|
+
*/
|
|
18
|
+
load(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Removes the wallet button from the DOM and releases resources.
|
|
21
|
+
*/
|
|
22
|
+
destroy(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Updates the wallet metadata (e.g. when order amount or currency changes).
|
|
25
|
+
*
|
|
26
|
+
* @param meta - The updated metadata.
|
|
27
|
+
*/
|
|
28
|
+
setMeta(meta: OpenWalletMeta): void;
|
|
3
29
|
}
|
|
4
30
|
//# sourceMappingURL=payment-source.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-source.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/payment-source.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,IAAI,IAAI,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"payment-source.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/payment-source.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;CACrC"}
|
|
@@ -19,21 +19,45 @@ interface ApplePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
|
|
|
19
19
|
button_style?: ApplePayButtonStyle;
|
|
20
20
|
}
|
|
21
21
|
export interface ApplePayOpenWalletMeta extends OpenWalletMeta, ApplePayPaymentRequest {
|
|
22
|
+
amount_label: string;
|
|
23
|
+
store_name: string;
|
|
24
|
+
/** Whether shipping address collection is required. */
|
|
22
25
|
request_shipping?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Available shipping options to display in the payment sheet.
|
|
28
|
+
* The first item in the array is used as the default selected option.
|
|
29
|
+
* Requires `request_shipping` to be `true`.
|
|
30
|
+
*/
|
|
23
31
|
shipping_options?: IApplePayShippingOption[];
|
|
24
|
-
amount_label: string;
|
|
25
32
|
show_billing_address?: boolean;
|
|
26
33
|
style?: ApplePayOpenWalletMetaStyles;
|
|
27
34
|
apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
|
|
28
|
-
store_name?: string;
|
|
29
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Apple Pay implementation of the OpenWallet service.
|
|
38
|
+
*
|
|
39
|
+
* Handles loading the Apple Pay SDK, checking device/browser availability,
|
|
40
|
+
* rendering the Apple Pay button, and managing the full Apple Pay payment session
|
|
41
|
+
* lifecycle including merchant validation, payment authorization, and shipping updates.
|
|
42
|
+
*
|
|
43
|
+
* @extends OpenWalletService
|
|
44
|
+
*/
|
|
30
45
|
export declare class ApplePayOpenWalletService extends OpenWalletService {
|
|
31
46
|
private meta;
|
|
32
47
|
private serviceConfig;
|
|
33
48
|
private latestShippingData;
|
|
34
49
|
private paymentSession;
|
|
35
50
|
private selectedShippingOption;
|
|
51
|
+
/**
|
|
52
|
+
* @param api - API client for backend communication.
|
|
53
|
+
* @param eventEmitter - Shared event emitter for wallet lifecycle events.
|
|
54
|
+
* @param serviceId - The service ID for the Apple Pay configuration.
|
|
55
|
+
* @param container - The DOM container that will hold the Apple Pay button.
|
|
56
|
+
* @param meta - Apple Pay-specific metadata (amount, currency, shipping config, etc.).
|
|
57
|
+
* @param serviceConfig - The service configuration response from the API.
|
|
58
|
+
*/
|
|
36
59
|
constructor(api: ApiInternal, eventEmitter: EventEmitter, serviceId: string, container: Container, meta: ApplePayOpenWalletMeta, serviceConfig: GetConfigResponse);
|
|
60
|
+
setMeta(meta: ApplePayOpenWalletMeta): void;
|
|
37
61
|
private adaptMeta;
|
|
38
62
|
private getMerchantId;
|
|
39
63
|
private getMetaStyles;
|
|
@@ -51,6 +75,7 @@ export declare class ApplePayOpenWalletService extends OpenWalletService {
|
|
|
51
75
|
private onPaymentAuthorized;
|
|
52
76
|
private formatShippingOptions;
|
|
53
77
|
private formatCapabilities;
|
|
78
|
+
private formatErrorFields;
|
|
54
79
|
private createButtonStyle;
|
|
55
80
|
private onShippingContactUpdated;
|
|
56
81
|
private parseShippingContactUpdateEvent;
|
package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apple-pay.open-wallet.service.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/apple-pay/apple-pay.open-wallet.service.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"apple-pay.open-wallet.service.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/apple-pay/apple-pay.open-wallet.service.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAExF,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIrF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,eAAe,EAAE,eAAe,CAAC;KAClC;CACF;AAOD,UAAU,4BAA6B,SAAQ,oBAAoB;IACjE,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc,EAAE,sBAAsB;IACpF,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAC7C,oBAAoB,CAAC,EAAE,OAAO,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B,CA+C7B;IAEF,OAAO,CAAC,8BAA8B;IAWtC,OAAO,CAAC,yCAAyC;IA2BjD,OAAO,CAAC,+BAA+B;CAqExC"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
/// <reference types="googlepay" />
|
|
2
|
+
/** URL for the Google Pay JavaScript SDK. */
|
|
2
3
|
export declare const GOOGLE_PAY_SCRIPT_URL = "https://pay.google.com/gp/p/js/pay.js";
|
|
4
|
+
/** The default gateway identifier for Paydock. */
|
|
3
5
|
export declare const GOOGLE_PAY_GATEWAY = "paydock";
|
|
6
|
+
/** Google Pay API version configuration. */
|
|
4
7
|
export declare const GOOGLE_PAY_API_CONFIG: {
|
|
5
8
|
readonly apiVersion: 2;
|
|
6
9
|
readonly apiVersionMinor: 0;
|
|
7
10
|
};
|
|
11
|
+
/** Default allowed authentication methods for Google Pay card payments. */
|
|
8
12
|
export declare const GOOGLE_PAY_AUTH_METHODS: string[];
|
|
13
|
+
/** Default allowed card networks for Google Pay payments. */
|
|
9
14
|
export declare const GOOGLE_PAY_CARD_NETWORKS: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Maps Google Pay callback triggers to OpenWallet event names.
|
|
17
|
+
* Used to translate shipping-related Google Pay events to the unified event system.
|
|
18
|
+
*/
|
|
10
19
|
export declare const GOOGLE_EVENT_TO_WALLET_EVENT: Record<Extract<google.payments.api.CallbackTrigger, 'SHIPPING_ADDRESS' | 'SHIPPING_OPTION'>, string>;
|
|
11
20
|
//# sourceMappingURL=google-pay.constants.d.ts.map
|
package/bundles/types/open-wallets/services/google-pay/constants/google-pay.constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-pay.constants.d.ts","sourceRoot":"","sources":["../../../../../src/open-wallets/services/google-pay/constants/google-pay.constants.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,qBAAqB,0CAA0C,CAAC;AAE7E,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,eAAO,MAAM,qBAAqB;;;CAGxB,CAAC;AAEX,eAAO,MAAM,uBAAuB,UAAiC,CAAC;AAEtE,eAAO,MAAM,wBAAwB,UAOpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAC/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,EAAE,kBAAkB,GAAG,iBAAiB,CAAC,EACpF,MAAM,CAIE,CAAC"}
|
|
1
|
+
{"version":3,"file":"google-pay.constants.d.ts","sourceRoot":"","sources":["../../../../../src/open-wallets/services/google-pay/constants/google-pay.constants.ts"],"names":[],"mappings":";AAEA,6CAA6C;AAC7C,eAAO,MAAM,qBAAqB,0CAA0C,CAAC;AAE7E,kDAAkD;AAClD,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C,4CAA4C;AAC5C,eAAO,MAAM,qBAAqB;;;CAGxB,CAAC;AAEX,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,UAAiC,CAAC;AAEtE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,UAOpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAC/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,EAAE,kBAAkB,GAAG,iBAAiB,CAAC,EACpF,MAAM,CAIE,CAAC"}
|
|
@@ -2,16 +2,24 @@
|
|
|
2
2
|
import type { ApiInternal } from '../../../api/api-internal';
|
|
3
3
|
import { type GetConfigResponse } from '../../../api/api-service-internal';
|
|
4
4
|
import type { Container } from '../../../components/container';
|
|
5
|
-
import type { IGooglePayShippingOption } from '../../../components/param';
|
|
6
5
|
import type { EventEmitter } from '../../../helper/event-emitter';
|
|
7
6
|
import { OpenWalletService } from '../../base/open-wallet.service';
|
|
8
|
-
import { WALLET_TYPES } from '../../interfaces';
|
|
9
7
|
import type { GooglePayOpenWalletMeta } from '../../interfaces/google-pay';
|
|
8
|
+
import { WALLET_TYPES } from '../../types';
|
|
10
9
|
declare global {
|
|
11
10
|
interface Window {
|
|
12
11
|
google: typeof google;
|
|
13
12
|
}
|
|
14
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Google Pay implementation of the OpenWallet service.
|
|
16
|
+
*
|
|
17
|
+
* Handles loading the Google Pay SDK, checking device/browser availability,
|
|
18
|
+
* rendering the Google Pay button, and managing the full payment lifecycle
|
|
19
|
+
* including payment authorization, shipping address/option changes, and OTT creation.
|
|
20
|
+
*
|
|
21
|
+
* @extends OpenWalletService
|
|
22
|
+
*/
|
|
15
23
|
export declare class GooglePayOpenWalletService extends OpenWalletService {
|
|
16
24
|
private meta;
|
|
17
25
|
private serviceConfig;
|
|
@@ -22,6 +30,14 @@ export declare class GooglePayOpenWalletService extends OpenWalletService {
|
|
|
22
30
|
private selectedShippingOption;
|
|
23
31
|
private processingButtonClick;
|
|
24
32
|
private isProcessingAuthorization;
|
|
33
|
+
/**
|
|
34
|
+
* @param api - API client for backend communication.
|
|
35
|
+
* @param eventEmitter - Shared event emitter for wallet lifecycle events.
|
|
36
|
+
* @param serviceId - The service ID for the Google Pay configuration.
|
|
37
|
+
* @param container - The DOM container that will hold the Google Pay button.
|
|
38
|
+
* @param meta - Google Pay-specific metadata (amount, currency, card config, etc.).
|
|
39
|
+
* @param serviceConfig - The service configuration response from the API.
|
|
40
|
+
*/
|
|
25
41
|
constructor(api: ApiInternal, eventEmitter: EventEmitter, serviceId: string, container: Container, meta: GooglePayOpenWalletMeta, serviceConfig: GetConfigResponse);
|
|
26
42
|
load(): Promise<void>;
|
|
27
43
|
setMeta(meta: GooglePayOpenWalletMeta): void;
|
|
@@ -35,6 +51,7 @@ export declare class GooglePayOpenWalletService extends OpenWalletService {
|
|
|
35
51
|
private loadPaymentData;
|
|
36
52
|
private onPaymentAuthorized;
|
|
37
53
|
private onPaymentDataChanged;
|
|
54
|
+
private autoAcceptWithCurrentData;
|
|
38
55
|
private createRequest;
|
|
39
56
|
private createPaymentDataRequest;
|
|
40
57
|
private createTokenizationSpecification;
|
|
@@ -44,12 +61,6 @@ export declare class GooglePayOpenWalletService extends OpenWalletService {
|
|
|
44
61
|
private getMetaStyles;
|
|
45
62
|
private isShippingRequired;
|
|
46
63
|
private hasShippingOptions;
|
|
47
|
-
update
|
|
48
|
-
success: boolean;
|
|
49
|
-
body?: {
|
|
50
|
-
amount?: number;
|
|
51
|
-
shipping_options?: IGooglePayShippingOption[];
|
|
52
|
-
};
|
|
53
|
-
}): void;
|
|
64
|
+
private update;
|
|
54
65
|
}
|
|
55
66
|
//# sourceMappingURL=google-pay.open-wallet.service.d.ts.map
|
package/bundles/types/open-wallets/services/google-pay/google-pay.open-wallet.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-pay.open-wallet.service.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/google-pay/google-pay.open-wallet.service.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"google-pay.open-wallet.service.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/google-pay/google-pay.open-wallet.service.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,KAAK,EAIV,uBAAuB,EAExB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE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O,CAAC,MAAM;CAoEf"}
|
|
@@ -3,6 +3,14 @@ import type { IGooglePayShippingOption } from '../../../../components/param';
|
|
|
3
3
|
import type { GooglePayCardConfig, GooglePayOpenWalletMeta } from '../../../interfaces/google-pay';
|
|
4
4
|
import type { CreateOTTData } from '../../../types';
|
|
5
5
|
import { WALLET_TYPES } from '../../../types';
|
|
6
|
+
/**
|
|
7
|
+
* Parses intermediate payment data from Google Pay into a normalized format
|
|
8
|
+
* for use in shipping address/option change events.
|
|
9
|
+
*
|
|
10
|
+
* @param data - The intermediate payment data from the Google Pay callback.
|
|
11
|
+
* @param meta - The current Google Pay wallet metadata.
|
|
12
|
+
* @returns Parsed shipping address and selected shipping option data.
|
|
13
|
+
*/
|
|
6
14
|
export declare const parseUpdateData: (data: google.payments.api.IntermediatePaymentData, meta: GooglePayOpenWalletMeta) => {
|
|
7
15
|
selected_shipping_option: IGooglePayShippingOption;
|
|
8
16
|
wallet_type: WALLET_TYPES;
|
|
@@ -13,8 +21,45 @@ export declare const parseUpdateData: (data: google.payments.api.IntermediatePay
|
|
|
13
21
|
address_country: string;
|
|
14
22
|
};
|
|
15
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Converts an array of shipping options from the internal format
|
|
26
|
+
* to Google Pay's `SelectionOption` format.
|
|
27
|
+
*
|
|
28
|
+
* @param shipping_options - The shipping options in internal format.
|
|
29
|
+
* @returns An array of Google Pay selection options.
|
|
30
|
+
*/
|
|
16
31
|
export declare const formatShippingOptions: (shipping_options: IGooglePayShippingOption[]) => google.payments.api.SelectionOption[];
|
|
32
|
+
/**
|
|
33
|
+
* Maps Google Pay payment data to the format required for OTT creation.
|
|
34
|
+
* Extracts billing/shipping addresses, card info, and the tokenization token.
|
|
35
|
+
*
|
|
36
|
+
* @param paymentData - The payment data from Google Pay's `onPaymentAuthorized` callback.
|
|
37
|
+
* @param meta - The current Google Pay wallet metadata.
|
|
38
|
+
* @returns The data required to create an OTT.
|
|
39
|
+
*/
|
|
17
40
|
export declare const mapGooglePayData: (paymentData: google.payments.api.PaymentData, meta: GooglePayOpenWalletMeta) => CreateOTTData;
|
|
41
|
+
/**
|
|
42
|
+
* Maps a Paydock-defined shipping error code to the corresponding
|
|
43
|
+
* Google Pay {@link google.payments.api.ErrorReason}.
|
|
44
|
+
*
|
|
45
|
+
* @param errorCode - The error code from the merchant's shipping change response.
|
|
46
|
+
* @returns The Google Pay error reason string.
|
|
47
|
+
*/
|
|
48
|
+
export declare const mapShippingErrorCodeToGooglePayReason: (errorCode: string) => google.payments.api.ErrorReason;
|
|
49
|
+
/**
|
|
50
|
+
* Maps billing address parameters from internal snake_case format
|
|
51
|
+
* to Google Pay's camelCase format.
|
|
52
|
+
*
|
|
53
|
+
* @param billingAddressParams - The billing address parameters in internal format.
|
|
54
|
+
* @returns Google Pay billing address parameters, or `undefined` if input is falsy.
|
|
55
|
+
*/
|
|
18
56
|
export declare const mapBillingAddressParameters: (billingAddressParams: GooglePayCardConfig['parameters']['billing_address_parameters']) => google.payments.api.BillingAddressParameters | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Maps card network parameters from internal snake_case format
|
|
59
|
+
* to Google Pay's camelCase format.
|
|
60
|
+
*
|
|
61
|
+
* @param cardNetworkParams - The card network parameters in internal format.
|
|
62
|
+
* @returns Google Pay card network parameters, or `undefined` if input is falsy.
|
|
63
|
+
*/
|
|
19
64
|
export declare const mapCardNetworkParameters: (cardNetworkParams: GooglePayCardConfig['parameters']['card_network_parameters']) => google.payments.api.CardNetworkParameters[] | undefined;
|
|
20
65
|
//# sourceMappingURL=google-pay.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-pay.utils.d.ts","sourceRoot":"","sources":["../../../../../src/open-wallets/services/google-pay/utils/google-pay.utils.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,eAAe,SACpB,OAAO,QAAQ,CAAC,GAAG,CAAC,uBAAuB,QAC3C,uBAAuB;;;;;;;;;CAuB9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,qBACd,wBAAwB,EAAE,KAC3C,OAAO,QAAQ,CAAC,GAAG,CAAC,eAAe,EAKjC,CAAC;AAEN,eAAO,MAAM,gBAAgB,gBACd,OAAO,QAAQ,CAAC,GAAG,CAAC,WAAW,QACtC,uBAAuB,KAC5B,aA6CF,CAAC;AAEF,eAAO,MAAM,2BAA2B,yBAChB,mBAAmB,CAAC,YAAY,CAAC,CAAC,4BAA4B,CAAC,KACpF,OAAO,QAAQ,CAAC,GAAG,CAAC,wBAAwB,GAAG,SAWjD,CAAC;AAEF,eAAO,MAAM,wBAAwB,sBAChB,mBAAmB,CAAC,YAAY,CAAC,CAAC,yBAAyB,CAAC,KAC9E,OAAO,QAAQ,CAAC,GAAG,CAAC,qBAAqB,EAAE,GAAG,SAYhD,CAAC"}
|
|
1
|
+
{"version":3,"file":"google-pay.utils.d.ts","sourceRoot":"","sources":["../../../../../src/open-wallets/services/google-pay/utils/google-pay.utils.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,SACpB,OAAO,QAAQ,CAAC,GAAG,CAAC,uBAAuB,QAC3C,uBAAuB;;;;;;;;;CAuB9B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,qBACd,wBAAwB,EAAE,KAC3C,OAAO,QAAQ,CAAC,GAAG,CAAC,eAAe,EAKjC,CAAC;AAEN;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,gBACd,OAAO,QAAQ,CAAC,GAAG,CAAC,WAAW,QACtC,uBAAuB,KAC5B,aA6CF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC,cACrC,MAAM,KAChB,OAAO,QAAQ,CAAC,GAAG,CAAC,WAgBtB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,yBAChB,mBAAmB,CAAC,YAAY,CAAC,CAAC,4BAA4B,CAAC,KACpF,OAAO,QAAQ,CAAC,GAAG,CAAC,wBAAwB,GAAG,SAWjD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,sBAChB,mBAAmB,CAAC,YAAY,CAAC,CAAC,yBAAyB,CAAC,KAC9E,OAAO,QAAQ,CAAC,GAAG,CAAC,qBAAqB,EAAE,GAAG,SAYhD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { formatShippingOptions, mapBillingAddressParameters, mapCardNetworkParameters, mapGooglePayData, parseUpdateData, } from './google-pay.utils';
|
|
1
|
+
export { formatShippingOptions, mapBillingAddressParameters, mapCardNetworkParameters, mapGooglePayData, mapShippingErrorCodeToGooglePayReason, parseUpdateData, } from './google-pay.utils';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/open-wallets/services/google-pay/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,GAChB,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/open-wallets/services/google-pay/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,gBAAgB,EAChB,qCAAqC,EACrC,eAAe,GAChB,MAAM,oBAAoB,CAAC"}
|
package/bundles/types/open-wallets/services/google-pay/validation/google-pay.validation.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
import type { GooglePayCardConfig } from '../../../interfaces/google-pay';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a Google Pay card configuration object.
|
|
4
|
+
*
|
|
5
|
+
* Checks that required fields are present and correctly structured:
|
|
6
|
+
* - `allowed_auth_methods` must be a non-empty array.
|
|
7
|
+
* - `allowed_card_networks` must be a non-empty array.
|
|
8
|
+
* - If a `tokenization_specification` is provided:
|
|
9
|
+
* - `DIRECT` requires `protocol_version` and `public_key`.
|
|
10
|
+
* - `PAYMENT_GATEWAY` requires non-empty `parameters`.
|
|
11
|
+
*
|
|
12
|
+
* @param cardConfig - The Google Pay card configuration to validate.
|
|
13
|
+
* @returns An array of human-readable error messages. Empty array means valid.
|
|
14
|
+
*/
|
|
2
15
|
export declare const validateCardConfiguration: (cardConfig: GooglePayCardConfig) => string[];
|
|
3
16
|
//# sourceMappingURL=google-pay.validation.d.ts.map
|
package/bundles/types/open-wallets/services/google-pay/validation/google-pay.validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-pay.validation.d.ts","sourceRoot":"","sources":["../../../../../src/open-wallets/services/google-pay/validation/google-pay.validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,yBAAyB,eACxB,mBAAmB,KAC9B,MAAM,EAkCR,CAAC"}
|
|
1
|
+
{"version":3,"file":"google-pay.validation.d.ts","sourceRoot":"","sources":["../../../../../src/open-wallets/services/google-pay/validation/google-pay.validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,eACxB,mBAAmB,KAC9B,MAAM,EAkCR,CAAC"}
|
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { EVENT } from '../enum/event.enum';
|
|
2
|
+
/**
|
|
3
|
+
* Base interface for all OpenWallet event data payloads.
|
|
4
|
+
* Every event emitted during the OpenWallet lifecycle carries an `event` identifier
|
|
5
|
+
* that corresponds to a value from the {@link EVENT} enum.
|
|
6
|
+
*
|
|
7
|
+
* All concrete event interfaces (e.g. {@link OnClickEventData}, {@link OnErrorEventData})
|
|
8
|
+
* extend this base.
|
|
9
|
+
*/
|
|
10
|
+
export interface OpenWalletBaseEvent {
|
|
11
|
+
/** The event name identifier. */
|
|
12
|
+
event: EVENT;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Extended base interface for OpenWallet events that carry a typed data payload
|
|
16
|
+
* in addition to the event identifier.
|
|
17
|
+
*
|
|
18
|
+
* Used by events whose payload is wrapped in a `data` field
|
|
19
|
+
* (e.g. shipping change events, OTT error events).
|
|
20
|
+
*
|
|
21
|
+
* @template T - The type of the event-specific data payload.
|
|
22
|
+
*/
|
|
23
|
+
export interface OpenWalletDataEvent<T> extends OpenWalletBaseEvent {
|
|
24
|
+
/** The event-specific data payload. */
|
|
3
25
|
data?: T | undefined;
|
|
4
26
|
}
|
|
5
27
|
//# sourceMappingURL=base-event-data.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-event-data.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/types/base-event-data.interface.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"base-event-data.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/types/base-event-data.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,CAAE,SAAQ,mBAAmB;IACjE,uCAAuC;IACvC,IAAI,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;CACtB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { OpenWalletBaseEvent, OpenWalletDataEvent } from './base-event-data.interface';
|
|
2
|
+
export type { Billing, CheckoutActionCode, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, OTTResponse, Shipping, } from './payment-source.type';
|
|
2
3
|
export type { WalletType } from './wallet-type.type';
|
|
3
4
|
export { WALLET_TYPES } from './wallet-type.type';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAC5F,YAAY,EACV,OAAO,EACP,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,QAAQ,GACT,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
package/bundles/types/open-wallets/types/on-shipping-address-change-event-data.interface.d.ts
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import type { EVENT } from '../enum/event.enum';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { OpenWalletDataEvent } from './base-event-data.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Event data emitted when the customer selects or updates their shipping address
|
|
5
|
+
* in the wallet payment sheet.
|
|
6
|
+
*/
|
|
7
|
+
export interface OnShippingAddressChangeEventData extends OpenWalletDataEvent<AddressChangeEventData> {
|
|
4
8
|
event: EVENT.ON_SHIPPING_ADDRESS_CHANGE;
|
|
5
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* The shipping address data provided by the wallet.
|
|
12
|
+
*/
|
|
6
13
|
interface AddressChangeEventData {
|
|
14
|
+
/** Postal/zip code of the shipping address. */
|
|
7
15
|
address_postcode?: string;
|
|
16
|
+
/** City of the shipping address. */
|
|
8
17
|
address_city?: string;
|
|
18
|
+
/** State or administrative area of the shipping address. */
|
|
9
19
|
address_state?: string;
|
|
20
|
+
/** Country code of the shipping address. */
|
|
10
21
|
address_country?: string;
|
|
22
|
+
/** Street address line 1 (Apple Pay only). */
|
|
11
23
|
address_line1?: string;
|
|
24
|
+
/** Street address line 2 (Apple Pay only). */
|
|
12
25
|
address_line2?: string;
|
|
26
|
+
/** Contact information for the shipping recipient (Apple Pay only). */
|
|
13
27
|
contact?: {
|
|
14
28
|
phone?: string;
|
|
15
29
|
email?: string;
|
package/bundles/types/open-wallets/types/on-shipping-address-change-event-data.interface.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-shipping-address-change-event-data.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/types/on-shipping-address-change-event-data.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"on-shipping-address-change-event-data.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/types/on-shipping-address-change-event-data.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,gCACf,SAAQ,mBAAmB,CAAC,sBAAsB,CAAC;IACnD,KAAK,EAAE,KAAK,CAAC,0BAA0B,CAAC;CACzC;AAED;;GAEG;AACH,UAAU,sBAAsB;IAC9B,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|