@getopenpay/openpay-js 0.5.9 → 0.5.12
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/dist/{Resource-DdfT9Qgs.js → Resource-BuOHZplj.js} +2 -2
- package/dist/{SimpleSpanProcessor-CawKbjQf.js → SimpleSpanProcessor-CKDfef5-.js} +6 -6
- package/dist/{detect-resources-L_FS0vCv.js → detect-resources-Urwgta9U.js} +6 -6
- package/dist/{diag-api-BQgG0RgX.js → diag-api-BuzSOOAx.js} +1 -1
- package/dist/{index-C7QQCPZm.js → index-BqrzDvwu.js} +5 -5
- package/dist/{index-BxkqQAR8.js → index-CThdiqXg.js} +1 -1
- package/dist/{index-DPnc8HRA.js → index-Cmhheoif.js} +1 -1
- package/dist/{index-m6o0K8op.js → index-CtJ_6odH.js} +1 -1
- package/dist/{index-CqWJjO-F.js → index-Cy4-6zU_.js} +5 -5
- package/dist/{index-CunYG5q8.js → index-DJFwqrzf.js} +4 -4
- package/dist/index-DT5HAS-D.js +7078 -0
- package/dist/{index-CK7R3I_S.js → index-G1_XDLLH.js} +4 -4
- package/dist/{index-BHpe6-5x.js → index-itSBKTvN.js} +4 -4
- package/dist/{index-vclJPHqd.js → index-uEbBPgmd.js} +1 -1
- package/dist/index.d.ts +87 -26
- package/dist/index.es.js +5 -4
- package/dist/index.umd.js +6 -6
- package/dist/{metrics-api-cAjroTqE.js → metrics-api-BykyaVIX.js} +1 -1
- package/dist/{sdk-info-rz-T2MNr.js → sdk-info-B2Z1fEhT.js} +1 -1
- package/dist/{url-B-V82H68.js → url-WXqZ-_PR.js} +1 -1
- package/dist/{utils-Dq30RtPb.js → utils-BZK1_jBh.js} +3 -3
- package/dist/{utils-Bcm865JD.js → utils-CkxL0WCq.js} +1 -1
- package/package.json +1 -1
- package/dist/index-D_vBvWer.js +0 -7037
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z as de, p as T, r as _e, w as ye, j as ve, n as he, y as me, dJ as ge, h as Se, dK as Ae, l as Ee, q as Te, i as Pe, m as Re, o as Oe, t as be, u as Ce } from "./url-
|
|
2
|
-
import { b as k, t as O, i as Y, T as b, d as Ie, c as B } from "./index-
|
|
3
|
-
import { d as _ } from "./diag-api-
|
|
1
|
+
import { z as de, p as T, r as _e, w as ye, j as ve, n as he, y as me, dJ as ge, h as Se, dK as Ae, l as Ee, q as Te, i as Pe, m as Re, o as Oe, t as be, u as Ce } from "./url-WXqZ-_PR.js";
|
|
2
|
+
import { b as k, t as O, i as Y, T as b, d as Ie, c as B } from "./index-DT5HAS-D.js";
|
|
3
|
+
import { d as _ } from "./diag-api-BuzSOOAx.js";
|
|
4
4
|
import { h as X, E as je } from "./ExportResult-B-YLKMaU.js";
|
|
5
|
-
import { D as Me, j as Ne, br as we, bs as De, bt as Le, b as xe, T as Ge, bu as Be, h as Ve, i as Ue, bv as He } from "./sdk-info-
|
|
5
|
+
import { D as Me, j as Ne, br as we, bs as De, bt as Le, b as xe, T as Ge, bu as Be, h as Ve, i as Ue, bv as He } from "./sdk-info-B2Z1fEhT.js";
|
|
6
6
|
import { _ as Ke } from "./utils-CX5YT7yI.js";
|
|
7
7
|
var p;
|
|
8
8
|
(function(e) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as u } from "./index-
|
|
2
|
-
import { B as c } from "./SimpleSpanProcessor-
|
|
3
|
-
import { A as g, b as x, a as S, C as b, F as w, I as P, N as C, P as T, R as O, d as M, S as A, e as E, c as R, T as N } from "./SimpleSpanProcessor-
|
|
4
|
-
import { P as F, a as j, b as k, g as I, c as W, h as U, n as X, p as z, s as D, d as G } from "./utils-
|
|
1
|
+
import { R as u } from "./index-DT5HAS-D.js";
|
|
2
|
+
import { B as c } from "./SimpleSpanProcessor-CKDfef5-.js";
|
|
3
|
+
import { A as g, b as x, a as S, C as b, F as w, I as P, N as C, P as T, R as O, d as M, S as A, e as E, c as R, T as N } from "./SimpleSpanProcessor-CKDfef5-.js";
|
|
4
|
+
import { P as F, a as j, b as k, g as I, c as W, h as U, n as X, p as z, s as D, d as G } from "./utils-CkxL0WCq.js";
|
|
5
5
|
var l = function(n, r) {
|
|
6
6
|
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
7
7
|
if (!e) return n;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as r, b as e, B as o, a as p, C as n, F as S, I as c, N as l, P as m, R as t, d, S as i, e as P, c as B, T as I } from "./SimpleSpanProcessor-
|
|
1
|
+
import { A as r, b as e, B as o, a as p, C as n, F as S, I as c, N as l, P as m, R as t, d, S as i, e as P, c as B, T as I } from "./SimpleSpanProcessor-CKDfef5-.js";
|
|
2
2
|
export {
|
|
3
3
|
r as AlwaysOffSampler,
|
|
4
4
|
e as AlwaysOnSampler,
|
package/dist/index.d.ts
CHANGED
|
@@ -92,6 +92,34 @@ declare type ApplePayPaymentRequest =
|
|
|
92
92
|
| ((current: ApplePayJS.ApplePayPaymentRequest) => Partial<ApplePayJS.ApplePayPaymentRequest>)
|
|
93
93
|
| Partial<ApplePayJS.ApplePayPaymentRequest>;
|
|
94
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Styles
|
|
97
|
+
*/
|
|
98
|
+
declare const BaseElementsStyle = z.object({
|
|
99
|
+
backgroundColor: OptionalString,
|
|
100
|
+
color: OptionalString,
|
|
101
|
+
fontFamily: OptionalString,
|
|
102
|
+
fontSize: OptionalString,
|
|
103
|
+
fontWeight: OptionalString,
|
|
104
|
+
margin: OptionalString,
|
|
105
|
+
padding: OptionalString,
|
|
106
|
+
letterSpacing: OptionalString,
|
|
107
|
+
lineHeight: OptionalString,
|
|
108
|
+
hideIcon: OptionalString,
|
|
109
|
+
placeholderStyle: z
|
|
110
|
+
.object({
|
|
111
|
+
color: OptionalString,
|
|
112
|
+
fontSize: OptionalString,
|
|
113
|
+
fontWeight: OptionalString,
|
|
114
|
+
fontFamily: OptionalString,
|
|
115
|
+
letterSpacing: OptionalString,
|
|
116
|
+
lineHeight: OptionalString,
|
|
117
|
+
})
|
|
118
|
+
.optional(),
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
declare type BaseElementsStyle = z.infer<typeof BaseElementsStyle>;
|
|
122
|
+
|
|
95
123
|
declare enum Blockchain {
|
|
96
124
|
EVM = 'EVM',
|
|
97
125
|
SOL = 'Solana',
|
|
@@ -99,6 +127,41 @@ declare enum Blockchain {
|
|
|
99
127
|
|
|
100
128
|
declare type BlockchainNetwork = keyof typeof Blockchain;
|
|
101
129
|
|
|
130
|
+
declare const CardCvcElementStyle = BaseElementsStyle.extend({
|
|
131
|
+
disableAutoFill: OptionalString,
|
|
132
|
+
placeholder: z.string().optional(),
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
declare const CardElementStyle = BaseElementsStyle.extend({
|
|
136
|
+
disableAutoFill: OptionalString,
|
|
137
|
+
placeholder: z
|
|
138
|
+
.object({
|
|
139
|
+
cardNumber: OptionalString,
|
|
140
|
+
expiry: OptionalString,
|
|
141
|
+
cvc: OptionalString,
|
|
142
|
+
})
|
|
143
|
+
.optional(),
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
declare const CardExpiryElementStyle = BaseElementsStyle.extend({
|
|
147
|
+
disableAutoFill: OptionalString,
|
|
148
|
+
placeholder: z.string().optional(),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
declare const CardNumberElementStyle = BaseElementsStyle.extend({
|
|
152
|
+
disableAutoFill: OptionalString,
|
|
153
|
+
placeholder: z.string().optional(),
|
|
154
|
+
/**
|
|
155
|
+
* The card icon at the start of the card number input field
|
|
156
|
+
* It won't affect after the icon changed to card brand after the user input the card number
|
|
157
|
+
*/
|
|
158
|
+
icon: z
|
|
159
|
+
.object({
|
|
160
|
+
color: z.string().optional(),
|
|
161
|
+
})
|
|
162
|
+
.optional(),
|
|
163
|
+
});
|
|
164
|
+
|
|
102
165
|
declare type CCSubmitParams = {
|
|
103
166
|
paymentRouteId?: string;
|
|
104
167
|
};
|
|
@@ -203,8 +266,8 @@ declare type DefaultFieldValues = Partial<Record<FieldNameEnum, string>> & {
|
|
|
203
266
|
require_full_shipping_address?: boolean;
|
|
204
267
|
};
|
|
205
268
|
|
|
206
|
-
declare type ElementProps<
|
|
207
|
-
styles?: ElementsStyle<
|
|
269
|
+
declare type ElementProps<T extends ElementType> = {
|
|
270
|
+
styles?: ElementsStyle<T>;
|
|
208
271
|
};
|
|
209
272
|
|
|
210
273
|
declare type ElementsFormProps = {
|
|
@@ -221,28 +284,17 @@ declare type ElementsFormProps = {
|
|
|
221
284
|
preventNavigationDuringSubmission?: boolean;
|
|
222
285
|
};
|
|
223
286
|
|
|
224
|
-
declare
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
fontWeight: OptionalString,
|
|
232
|
-
fontFamily: OptionalString,
|
|
233
|
-
letterSpacing: OptionalString,
|
|
234
|
-
lineHeight: OptionalString,
|
|
235
|
-
})
|
|
236
|
-
.optional(),
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
declare type ElementsStyle<T extends z.ZodTypeAny> = z.infer<ReturnType<typeof ElementsStyle<T>>>;
|
|
240
|
-
|
|
241
|
-
declare const ElementType = z.nativeEnum(ElementTypeEnum);
|
|
287
|
+
declare type ElementsStyle<T extends ElementType = ElementType> = {
|
|
288
|
+
card: z.infer<typeof CardElementStyle>;
|
|
289
|
+
'card-number': z.infer<typeof CardNumberElementStyle>;
|
|
290
|
+
'card-expiry': z.infer<typeof CardExpiryElementStyle>;
|
|
291
|
+
'card-cvc': z.infer<typeof CardCvcElementStyle>;
|
|
292
|
+
'cde-bridge': z.infer<typeof BaseElementsStyle>;
|
|
293
|
+
}[T];
|
|
242
294
|
|
|
243
|
-
declare type ElementType = z.infer<typeof
|
|
295
|
+
export declare type ElementType = z.infer<typeof _ElementTypeEnumZod>;
|
|
244
296
|
|
|
245
|
-
declare enum ElementTypeEnum {
|
|
297
|
+
export declare enum ElementTypeEnum {
|
|
246
298
|
CARD = 'card',
|
|
247
299
|
CARD_NUMBER = 'card-number',
|
|
248
300
|
CARD_EXPIRY = 'card-expiry',
|
|
@@ -250,7 +302,7 @@ declare enum ElementTypeEnum {
|
|
|
250
302
|
CDE_BRIDGE = 'cde-bridge',
|
|
251
303
|
}
|
|
252
304
|
|
|
253
|
-
declare
|
|
305
|
+
declare const _ElementTypeEnumZod = z.enum(['card', 'card-number', 'card-expiry', 'card-cvc', 'cde-bridge']);
|
|
254
306
|
|
|
255
307
|
declare enum Environment {
|
|
256
308
|
Local = 'local',
|
|
@@ -783,7 +835,8 @@ declare type OnCheckoutSuccess = (
|
|
|
783
835
|
invoiceUrls: string[],
|
|
784
836
|
subscriptionIds: string[],
|
|
785
837
|
customerId: string,
|
|
786
|
-
processorsUsed: string[]
|
|
838
|
+
processorsUsed: string[],
|
|
839
|
+
paymentMethodId: string
|
|
787
840
|
) => void;
|
|
788
841
|
|
|
789
842
|
declare type OnSetupPaymentMethodSuccess = (paymentMethodId: string) => void;
|
|
@@ -883,8 +936,8 @@ export declare class OpenPayForm {
|
|
|
883
936
|
setFormHeight: (height: string) => void;
|
|
884
937
|
onCdeLoaded: (payload: LoadedEventPayload) => void;
|
|
885
938
|
onCdeLoadError: (errMsg: string) => void;
|
|
886
|
-
createElement: (
|
|
887
|
-
registerIframe: (type:
|
|
939
|
+
createElement: <T extends ElementType>(elementType: T, options?: ElementProps<T>) => RegisteredElement;
|
|
940
|
+
registerIframe: (type: ElementType, frame: HTMLIFrameElement) => RegisteredElement;
|
|
888
941
|
private buildQueryString;
|
|
889
942
|
private connectToElement;
|
|
890
943
|
private getFormDiv;
|
|
@@ -902,7 +955,13 @@ export declare class OpenPayForm {
|
|
|
902
955
|
processors: PaymentProcessor[];
|
|
903
956
|
isAvailable: boolean;
|
|
904
957
|
}[]>;
|
|
958
|
+
/**
|
|
959
|
+
* @deprecated
|
|
960
|
+
* We're normalizing the submit method to be the same in both React and Vanilla versions.
|
|
961
|
+
* Please use `submitWith` instead.
|
|
962
|
+
*/
|
|
905
963
|
generalSubmit: GeneralSubmit;
|
|
964
|
+
submitWith: GeneralSubmit;
|
|
906
965
|
/**
|
|
907
966
|
* Alias for submitCard
|
|
908
967
|
*/
|
|
@@ -1056,6 +1115,7 @@ declare type PaypalFlowCustomParams = {
|
|
|
1056
1115
|
};
|
|
1057
1116
|
|
|
1058
1117
|
declare type ProcessorSpecificSubmitSettings<T extends SubmitMethod = SubmitMethod> = {
|
|
1118
|
+
[SubmitMethods.card]: CCSubmitParams;
|
|
1059
1119
|
[SubmitMethods.pockytPaypal]: { useRedirectFlow?: boolean };
|
|
1060
1120
|
[SubmitMethods.applePay]: ApplePayFlowCustomParams;
|
|
1061
1121
|
[SubmitMethods.googlePay]: GooglePayFlowCustomParams;
|
|
@@ -1099,6 +1159,7 @@ declare const SubmitMethod = z.nativeEnum(SubmitMethods);
|
|
|
1099
1159
|
declare type SubmitMethod = z.infer<typeof SubmitMethod>;
|
|
1100
1160
|
|
|
1101
1161
|
export declare enum SubmitMethods {
|
|
1162
|
+
card = 'card',
|
|
1102
1163
|
pockytPaypal = 'pockyt-paypal',
|
|
1103
1164
|
applePay = 'apple-pay',
|
|
1104
1165
|
googlePay = 'google-pay',
|
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { F as
|
|
1
|
+
import { E as p, F as r, O as i, l as s } from "./index-DT5HAS-D.js";
|
|
2
2
|
import "penpal";
|
|
3
3
|
import "uuid";
|
|
4
4
|
import "zod";
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as ElementTypeEnum,
|
|
7
|
+
r as FieldName,
|
|
7
8
|
i as OpenPayForm,
|
|
8
|
-
|
|
9
|
+
s as SubmitMethods
|
|
9
10
|
};
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiaW5kZXguZXMuanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImV4cG9ydCB7IEUgYXMgRWxlbWVudFR5cGVFbnVtLCBGIGFzIEZpZWxkTmFtZSwgTyBhcyBPcGVuUGF5Rm9ybSwgbCBhcyBTdWJtaXRNZXRob2RzIH0gZnJvbSAnLi9pbmRleC0hfnswMDZ9fi5qcyc7XG5pbXBvcnQgJ3BlbnBhbCc7XG5pbXBvcnQgJ3V1aWQnO1xuaW1wb3J0ICd6b2QnOyJdLAogICJtYXBwaW5ncyI6ICJBQUFBLFNBQWMsS0FBTEEsR0FBMkIsS0FBTEMsR0FBcUIsS0FBTEMsR0FBdUIsS0FBTEMsU0FBMEI7QUFDM0YsT0FBTztBQUNQLE9BQU87QUFDUCxPQUFPOyIsCiAgIm5hbWVzIjogWyJFIiwgIkYiLCAiTyIsICJsIl0KfQo=
|