@solidgate/vue-sdk 1.10.1 → 1.12.0
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 +4 -1
- package/dist/Payment.vue.d.ts +28 -1
- package/dist/Resign.vue.d.ts +8 -1
- package/dist/constants/index.d.ts +2 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +48 -7
- package/dist/interfaces/PaymentProps.d.ts +2 -0
- package/dist/utils/getPayButtonParams.d.ts +1 -1
- package/dist/utils/initPaymentForm.d.ts +1 -1
- package/dist/utils/initResignForm.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -35,16 +35,18 @@ const merchantData: InitConfig['merchantData'] = {
|
|
|
35
35
|
</script>
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
In order to render google/apple button in custom container define Payment as async component and pass link to container element
|
|
38
|
+
In order to render google/apple/paypal button in custom container define Payment as async component and pass link to container element
|
|
39
39
|
```vue
|
|
40
40
|
<template>
|
|
41
41
|
<Payment
|
|
42
42
|
:merchan-data="merchantData"
|
|
43
43
|
:google-pay-container-ref="googleButton"
|
|
44
44
|
:apple-pay-container-ref="appleButton"
|
|
45
|
+
:paypal-container-ref="paypalButton"
|
|
45
46
|
/>
|
|
46
47
|
<div ref="googleButton" />
|
|
47
48
|
<div ref="appleButton" />
|
|
49
|
+
<div ref="paypalButton" />
|
|
48
50
|
</template>
|
|
49
51
|
|
|
50
52
|
<script lang="ts" setup>
|
|
@@ -54,6 +56,7 @@ const Payment = defineAsyncComponent(() => import('@solidgate/vue-sdk'))
|
|
|
54
56
|
|
|
55
57
|
const googleButton = ref<HTMLDivElement>()
|
|
56
58
|
const appleButton = ref<HTMLDivElement>()
|
|
59
|
+
const paypalButton = ref<HTMLDivElement>()
|
|
57
60
|
|
|
58
61
|
const merchantData: InitConfig['merchantData'] = {
|
|
59
62
|
merchant: '<<--YOUR MERCHANT ID-->>',
|
package/dist/Payment.vue.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** __vue_virtual_code_placeholder */
|
|
2
|
-
import { CustomStylesAppendedMessage, OrderStatusMessage, InteractionMessage, RedirectMessage, MountedMessage, SuccessMessage, ResizeMessage, VerifyMessage, SubmitMessage, ErrorMessage, FailMessage, CardMessage, ClientSdkInstance } from '@solidgate/client-sdk-loader';
|
|
2
|
+
import { CustomStylesAppendedMessage, PaymentDetailsMessage, OrderStatusMessage, InteractionMessage, RedirectMessage, MountedMessage, SuccessMessage, ResizeMessage, VerifyMessage, SubmitMessage, ErrorMessage, FailMessage, CardMessage, ClientSdkInstance } from '@solidgate/client-sdk-loader';
|
|
3
3
|
import './boot';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
5
|
merchantData: {
|
|
@@ -46,13 +46,24 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
46
46
|
}> | undefined, "containerId"> | undefined;
|
|
47
47
|
applePayButtonParams?: Omit<Partial<{
|
|
48
48
|
enabled: false;
|
|
49
|
+
integrationType?: "css" | "js" | undefined;
|
|
49
50
|
containerId: string;
|
|
50
51
|
color: string;
|
|
51
52
|
type: string;
|
|
52
53
|
}> | undefined, "containerId"> | undefined;
|
|
54
|
+
paypalButtonParams?: Omit<{
|
|
55
|
+
enabled?: boolean | undefined;
|
|
56
|
+
containerId?: string | undefined;
|
|
57
|
+
color?: "black" | "blue" | "gold" | "silver" | undefined;
|
|
58
|
+
shape?: "rect" | "pill" | "sharp" | undefined;
|
|
59
|
+
label?: "paypal" | "checkout" | "buynow" | "pay" | "installment" | undefined;
|
|
60
|
+
height?: number | undefined;
|
|
61
|
+
} | undefined, "containerId"> | undefined;
|
|
53
62
|
googlePayContainerRef?: HTMLDivElement | undefined;
|
|
54
63
|
applePayContainerRef?: HTMLDivElement | undefined;
|
|
64
|
+
paypalContainerRef?: HTMLDivElement | undefined;
|
|
55
65
|
onReadyPaymentInstance?: ((paymentInstance: ClientSdkInstance) => void) | undefined;
|
|
66
|
+
onPaymentDetails?: ((e: PaymentDetailsMessage) => void) | undefined;
|
|
56
67
|
onMounted?: ((e: MountedMessage) => void) | undefined;
|
|
57
68
|
onError?: ((e: ErrorMessage) => void) | undefined;
|
|
58
69
|
onSuccess?: ((e: SuccessMessage) => void) | undefined;
|
|
@@ -73,6 +84,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
73
84
|
onSubmit: () => void;
|
|
74
85
|
onVerify: () => void;
|
|
75
86
|
onCustomStylesAppended: () => void;
|
|
87
|
+
onPaymentDetails: () => void;
|
|
76
88
|
onFormRedirect: () => void;
|
|
77
89
|
onInteraction: () => void;
|
|
78
90
|
onOrderStatus: () => void;
|
|
@@ -86,6 +98,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
86
98
|
submit: (payload: SubmitMessage) => void;
|
|
87
99
|
verify: (payload: VerifyMessage) => void;
|
|
88
100
|
customStylesAppended: (payload: CustomStylesAppendedMessage) => void;
|
|
101
|
+
paymentDetails: (payload: PaymentDetailsMessage) => void;
|
|
89
102
|
formRedirect: (payload: RedirectMessage) => void;
|
|
90
103
|
interaction: (payload: InteractionMessage) => void;
|
|
91
104
|
orderStatus: (payload: OrderStatusMessage) => void;
|
|
@@ -137,13 +150,24 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
137
150
|
}> | undefined, "containerId"> | undefined;
|
|
138
151
|
applePayButtonParams?: Omit<Partial<{
|
|
139
152
|
enabled: false;
|
|
153
|
+
integrationType?: "css" | "js" | undefined;
|
|
140
154
|
containerId: string;
|
|
141
155
|
color: string;
|
|
142
156
|
type: string;
|
|
143
157
|
}> | undefined, "containerId"> | undefined;
|
|
158
|
+
paypalButtonParams?: Omit<{
|
|
159
|
+
enabled?: boolean | undefined;
|
|
160
|
+
containerId?: string | undefined;
|
|
161
|
+
color?: "black" | "blue" | "gold" | "silver" | undefined;
|
|
162
|
+
shape?: "rect" | "pill" | "sharp" | undefined;
|
|
163
|
+
label?: "paypal" | "checkout" | "buynow" | "pay" | "installment" | undefined;
|
|
164
|
+
height?: number | undefined;
|
|
165
|
+
} | undefined, "containerId"> | undefined;
|
|
144
166
|
googlePayContainerRef?: HTMLDivElement | undefined;
|
|
145
167
|
applePayContainerRef?: HTMLDivElement | undefined;
|
|
168
|
+
paypalContainerRef?: HTMLDivElement | undefined;
|
|
146
169
|
onReadyPaymentInstance?: ((paymentInstance: ClientSdkInstance) => void) | undefined;
|
|
170
|
+
onPaymentDetails?: ((e: PaymentDetailsMessage) => void) | undefined;
|
|
147
171
|
onMounted?: ((e: MountedMessage) => void) | undefined;
|
|
148
172
|
onError?: ((e: ErrorMessage) => void) | undefined;
|
|
149
173
|
onSuccess?: ((e: SuccessMessage) => void) | undefined;
|
|
@@ -164,6 +188,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
164
188
|
onSubmit: () => void;
|
|
165
189
|
onVerify: () => void;
|
|
166
190
|
onCustomStylesAppended: () => void;
|
|
191
|
+
onPaymentDetails: () => void;
|
|
167
192
|
onFormRedirect: () => void;
|
|
168
193
|
onInteraction: () => void;
|
|
169
194
|
onOrderStatus: () => void;
|
|
@@ -182,6 +207,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
182
207
|
onInteraction?: ((payload: InteractionMessage) => any) | undefined;
|
|
183
208
|
onCustomStylesAppended?: ((payload: CustomStylesAppendedMessage) => any) | undefined;
|
|
184
209
|
onCard?: ((payload: CardMessage) => any) | undefined;
|
|
210
|
+
onPaymentDetails?: ((payload: PaymentDetailsMessage) => any) | undefined;
|
|
185
211
|
onReadyPaymentInstance?: ((payload: ClientSdkInstance) => any) | undefined;
|
|
186
212
|
}, {
|
|
187
213
|
onError: (e: ErrorMessage) => void;
|
|
@@ -196,6 +222,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
196
222
|
onInteraction: (e: InteractionMessage) => void;
|
|
197
223
|
onCustomStylesAppended: (e: CustomStylesAppendedMessage) => void;
|
|
198
224
|
onCard: (e: CardMessage) => void;
|
|
225
|
+
onPaymentDetails: (e: PaymentDetailsMessage) => void;
|
|
199
226
|
}, {}>;
|
|
200
227
|
export default _default;
|
|
201
228
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
package/dist/Resign.vue.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** __vue_virtual_code_placeholder */
|
|
2
|
-
import { CustomStylesAppendedMessage, OrderStatusMessage, InteractionMessage, RedirectMessage, MountedMessage, SuccessMessage, ResizeMessage, VerifyMessage, SubmitMessage, ErrorMessage, FailMessage, ClientSdkInstance } from '@solidgate/client-sdk-loader';
|
|
2
|
+
import { CustomStylesAppendedMessage, PaymentDetailsMessage, OrderStatusMessage, InteractionMessage, RedirectMessage, MountedMessage, SuccessMessage, ResizeMessage, VerifyMessage, SubmitMessage, ErrorMessage, FailMessage, ClientSdkInstance } from '@solidgate/client-sdk-loader';
|
|
3
3
|
import './boot';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
5
|
resignRequest: import("@solidgate/client-sdk-loader").ResignRequest;
|
|
@@ -26,6 +26,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
26
26
|
onSubmit?: ((e: SubmitMessage) => void) | undefined;
|
|
27
27
|
onVerify?: ((e: VerifyMessage) => void) | undefined;
|
|
28
28
|
onCustomStylesAppended?: ((e: CustomStylesAppendedMessage) => void) | undefined;
|
|
29
|
+
onPaymentDetails?: ((e: PaymentDetailsMessage) => void) | undefined;
|
|
29
30
|
onFormRedirect?: ((e: RedirectMessage) => void) | undefined;
|
|
30
31
|
onInteraction?: ((e: InteractionMessage) => void) | undefined;
|
|
31
32
|
onOrderStatus?: ((e: OrderStatusMessage) => void) | undefined;
|
|
@@ -38,6 +39,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
38
39
|
onSubmit: () => void;
|
|
39
40
|
onVerify: () => void;
|
|
40
41
|
onCustomStylesAppended: () => void;
|
|
42
|
+
onPaymentDetails: () => void;
|
|
41
43
|
onFormRedirect: () => void;
|
|
42
44
|
onInteraction: () => void;
|
|
43
45
|
onOrderStatus: () => void;
|
|
@@ -50,6 +52,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
50
52
|
submit: (payload: SubmitMessage) => void;
|
|
51
53
|
verify: (payload: VerifyMessage) => void;
|
|
52
54
|
customStylesAppended: (payload: CustomStylesAppendedMessage) => void;
|
|
55
|
+
paymentDetails: (payload: PaymentDetailsMessage) => void;
|
|
53
56
|
formRedirect: (payload: RedirectMessage) => void;
|
|
54
57
|
interaction: (payload: InteractionMessage) => void;
|
|
55
58
|
orderStatus: (payload: OrderStatusMessage) => void;
|
|
@@ -81,6 +84,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
81
84
|
onSubmit?: ((e: SubmitMessage) => void) | undefined;
|
|
82
85
|
onVerify?: ((e: VerifyMessage) => void) | undefined;
|
|
83
86
|
onCustomStylesAppended?: ((e: CustomStylesAppendedMessage) => void) | undefined;
|
|
87
|
+
onPaymentDetails?: ((e: PaymentDetailsMessage) => void) | undefined;
|
|
84
88
|
onFormRedirect?: ((e: RedirectMessage) => void) | undefined;
|
|
85
89
|
onInteraction?: ((e: InteractionMessage) => void) | undefined;
|
|
86
90
|
onOrderStatus?: ((e: OrderStatusMessage) => void) | undefined;
|
|
@@ -93,6 +97,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
93
97
|
onSubmit: () => void;
|
|
94
98
|
onVerify: () => void;
|
|
95
99
|
onCustomStylesAppended: () => void;
|
|
100
|
+
onPaymentDetails: () => void;
|
|
96
101
|
onFormRedirect: () => void;
|
|
97
102
|
onInteraction: () => void;
|
|
98
103
|
onOrderStatus: () => void;
|
|
@@ -109,6 +114,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
109
114
|
onVerify?: ((payload: VerifyMessage) => any) | undefined;
|
|
110
115
|
onInteraction?: ((payload: InteractionMessage) => any) | undefined;
|
|
111
116
|
onCustomStylesAppended?: ((payload: CustomStylesAppendedMessage) => any) | undefined;
|
|
117
|
+
onPaymentDetails?: ((payload: PaymentDetailsMessage) => any) | undefined;
|
|
112
118
|
onReadyResignInstance?: ((payload: ClientSdkInstance) => any) | undefined;
|
|
113
119
|
onResignInitFailed?: ((payload: Error) => any) | undefined;
|
|
114
120
|
}, {
|
|
@@ -123,6 +129,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
123
129
|
onVerify: (e: VerifyMessage) => void;
|
|
124
130
|
onInteraction: (e: InteractionMessage) => void;
|
|
125
131
|
onCustomStylesAppended: (e: CustomStylesAppendedMessage) => void;
|
|
132
|
+
onPaymentDetails: (e: PaymentDetailsMessage) => void;
|
|
126
133
|
}, {}>;
|
|
127
134
|
export default _default;
|
|
128
135
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const IFRAME_CONTAINER_ID: string;
|
|
2
2
|
declare const GOOGLE_PAY_BUTTON_CONTAINER_ID: string;
|
|
3
3
|
declare const APPLE_PAY_BUTTON_CONTAINER_ID: string;
|
|
4
|
-
|
|
4
|
+
declare const PAYPAL_BUTTON_CONTAINER_ID: string;
|
|
5
|
+
export { IFRAME_CONTAINER_ID, GOOGLE_PAY_BUTTON_CONTAINER_ID, APPLE_PAY_BUTTON_CONTAINER_ID, PAYPAL_BUTTON_CONTAINER_ID };
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.payment-form-container[data-v-
|
|
1
|
+
.payment-form-container[data-v-66bd61ca] iframe,.payment-form-container[data-v-77b30339] iframe{border:none}
|
package/dist/index.es.js
CHANGED
|
@@ -2,6 +2,7 @@ import { defineComponent, ref, onMounted, onUnmounted, watch, isReactive, openBl
|
|
|
2
2
|
import './index.css';const IFRAME_CONTAINER_ID = `solid-payment-form-container_#${Math.random() * 1e4}`;
|
|
3
3
|
const GOOGLE_PAY_BUTTON_CONTAINER_ID = `google-pay-button-container_#${Math.random() * 1e4}`;
|
|
4
4
|
const APPLE_PAY_BUTTON_CONTAINER_ID = `apple-pay-button-container_#${Math.random() * 1e4}`;
|
|
5
|
+
const PAYPAL_BUTTON_CONTAINER_ID = `paypal-button-container_#${Math.random() * 1e4}`;
|
|
5
6
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
6
7
|
var dist = {};
|
|
7
8
|
var MessageType$2 = {};
|
|
@@ -20,6 +21,7 @@ var MessageType$1;
|
|
|
20
21
|
MessageType2["Submit"] = "submit";
|
|
21
22
|
MessageType2["CustomStylesAppended"] = "customStylesAppended";
|
|
22
23
|
MessageType2["Card"] = "card";
|
|
24
|
+
MessageType2["PaymentDetails"] = "paymentDetails";
|
|
23
25
|
})(MessageType$1 || (MessageType$1 = {}));
|
|
24
26
|
MessageType$2.default = MessageType$1;
|
|
25
27
|
var FieldName$2 = {};
|
|
@@ -94,6 +96,7 @@ var PayableEntity$1;
|
|
|
94
96
|
PayableEntity2["GooglePay"] = "googlebtn";
|
|
95
97
|
PayableEntity2["Form"] = "form";
|
|
96
98
|
PayableEntity2["Resign"] = "resign";
|
|
99
|
+
PayableEntity2["Paypal"] = "paypal";
|
|
97
100
|
})(PayableEntity$1 || (PayableEntity$1 = {}));
|
|
98
101
|
PayableEntity$2.default = PayableEntity$1;
|
|
99
102
|
var InteractionType$2 = {};
|
|
@@ -185,6 +188,9 @@ var _a, _SdkLoader_CloudfrontSrc, _SdkLoader_loadAttempt;
|
|
|
185
188
|
Object.defineProperty(SdkLoader$2, "__esModule", { value: true });
|
|
186
189
|
class SdkLoader$1 {
|
|
187
190
|
static load() {
|
|
191
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
192
|
+
return Promise.resolve(null);
|
|
193
|
+
}
|
|
188
194
|
if (window.PaymentFormSdk) {
|
|
189
195
|
return Promise.resolve(window.PaymentFormSdk);
|
|
190
196
|
}
|
|
@@ -251,6 +257,10 @@ const payButtonIds = {
|
|
|
251
257
|
applePayButtonParams: {
|
|
252
258
|
title: "ApplePay",
|
|
253
259
|
id: APPLE_PAY_BUTTON_CONTAINER_ID
|
|
260
|
+
},
|
|
261
|
+
paypalButtonParams: {
|
|
262
|
+
title: "PayPal",
|
|
263
|
+
id: PAYPAL_BUTTON_CONTAINER_ID
|
|
254
264
|
}
|
|
255
265
|
};
|
|
256
266
|
function getPayButtonParams(config, key, container) {
|
|
@@ -281,12 +291,16 @@ const initPaymentForm = async (props) => {
|
|
|
281
291
|
styles,
|
|
282
292
|
formParams,
|
|
283
293
|
googlePayContainerRef,
|
|
284
|
-
applePayContainerRef
|
|
294
|
+
applePayContainerRef,
|
|
295
|
+
paypalContainerRef
|
|
285
296
|
} = props;
|
|
286
297
|
if (!merchantData) {
|
|
287
298
|
throw new Error("Attribute 'merchantData' is required");
|
|
288
299
|
}
|
|
289
300
|
const clientSdk = await SdkLoader.load();
|
|
301
|
+
if (!clientSdk) {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
290
304
|
const initConfig = {
|
|
291
305
|
merchantData,
|
|
292
306
|
iframeParams: {
|
|
@@ -312,6 +326,14 @@ const initPaymentForm = async (props) => {
|
|
|
312
326
|
if (appleButtonParams) {
|
|
313
327
|
initConfig.applePayButtonParams = appleButtonParams;
|
|
314
328
|
}
|
|
329
|
+
const paypalButtonParams = getPayButtonParams(
|
|
330
|
+
props,
|
|
331
|
+
"paypalButtonParams",
|
|
332
|
+
paypalContainerRef
|
|
333
|
+
);
|
|
334
|
+
if (paypalButtonParams) {
|
|
335
|
+
initConfig.paypalButtonParams = paypalButtonParams;
|
|
336
|
+
}
|
|
315
337
|
return clientSdk.init(initConfig);
|
|
316
338
|
};
|
|
317
339
|
const onSubscribe = (sdkInstanceValue, callbacks) => {
|
|
@@ -330,6 +352,8 @@ const onSubscribe = (sdkInstanceValue, callbacks) => {
|
|
|
330
352
|
},
|
|
331
353
|
onCustomStylesAppended = () => {
|
|
332
354
|
},
|
|
355
|
+
onPaymentDetails = () => {
|
|
356
|
+
},
|
|
333
357
|
onFormRedirect = () => {
|
|
334
358
|
},
|
|
335
359
|
onInteraction = () => {
|
|
@@ -351,6 +375,10 @@ const onSubscribe = (sdkInstanceValue, callbacks) => {
|
|
|
351
375
|
MessageType.CustomStylesAppended,
|
|
352
376
|
(e) => onCustomStylesAppended(e.data)
|
|
353
377
|
);
|
|
378
|
+
sdkInstanceValue.on(
|
|
379
|
+
MessageType.PaymentDetails,
|
|
380
|
+
(e) => onPaymentDetails(e.data)
|
|
381
|
+
);
|
|
354
382
|
sdkInstanceValue.on(MessageType.Redirect, (e) => onFormRedirect(e.data));
|
|
355
383
|
sdkInstanceValue.on(MessageType.Interaction, (e) => onInteraction(e.data));
|
|
356
384
|
sdkInstanceValue.on(MessageType.OrderStatus, (e) => onOrderStatus(e.data));
|
|
@@ -377,9 +405,13 @@ const _sfc_main$1 = defineComponent({
|
|
|
377
405
|
formParams: {},
|
|
378
406
|
googlePayButtonParams: {},
|
|
379
407
|
applePayButtonParams: {},
|
|
408
|
+
paypalButtonParams: {},
|
|
380
409
|
googlePayContainerRef: {},
|
|
381
410
|
applePayContainerRef: {},
|
|
411
|
+
paypalContainerRef: {},
|
|
382
412
|
onReadyPaymentInstance: {},
|
|
413
|
+
onPaymentDetails: { type: Function, default: () => {
|
|
414
|
+
} },
|
|
383
415
|
onMounted: { type: Function, default: () => {
|
|
384
416
|
} },
|
|
385
417
|
onError: { type: Function, default: () => {
|
|
@@ -405,7 +437,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
405
437
|
onCard: { type: Function, default: () => {
|
|
406
438
|
} }
|
|
407
439
|
},
|
|
408
|
-
emits: ["mounted", "error", "success", "fail", "submit", "verify", "customStylesAppended", "formRedirect", "interaction", "orderStatus", "resize", "card", "readyPaymentInstance"],
|
|
440
|
+
emits: ["mounted", "error", "success", "fail", "submit", "verify", "customStylesAppended", "paymentDetails", "formRedirect", "interaction", "orderStatus", "resize", "card", "readyPaymentInstance"],
|
|
409
441
|
setup(__props, { emit }) {
|
|
410
442
|
const props = __props;
|
|
411
443
|
const sdkInstance = ref();
|
|
@@ -416,8 +448,10 @@ const _sfc_main$1 = defineComponent({
|
|
|
416
448
|
formParams: props.formParams,
|
|
417
449
|
googlePayButtonParams: props.googlePayButtonParams,
|
|
418
450
|
applePayButtonParams: props.applePayButtonParams,
|
|
451
|
+
paypalButtonParams: props.paypalButtonParams,
|
|
419
452
|
googlePayContainerRef: props.googlePayContainerRef,
|
|
420
|
-
applePayContainerRef: props.applePayContainerRef
|
|
453
|
+
applePayContainerRef: props.applePayContainerRef,
|
|
454
|
+
paypalContainerRef: props.paypalContainerRef
|
|
421
455
|
};
|
|
422
456
|
const callbacks = {
|
|
423
457
|
onMounted: (e) => props.onMounted && props.onMounted(e),
|
|
@@ -427,6 +461,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
427
461
|
onSubmit: (e) => props.onSubmit && props.onSubmit(e),
|
|
428
462
|
onVerify: (e) => props.onVerify && props.onVerify(e),
|
|
429
463
|
onCustomStylesAppended: (e) => props.onCustomStylesAppended && props.onCustomStylesAppended(e),
|
|
464
|
+
onPaymentDetails: (e) => props.onPaymentDetails && props.onPaymentDetails(e),
|
|
430
465
|
onFormRedirect: (e) => props.onFormRedirect && props.onFormRedirect(e),
|
|
431
466
|
onInteraction: (e) => props.onInteraction && props.onInteraction(e),
|
|
432
467
|
onOrderStatus: (e) => props.onOrderStatus && props.onOrderStatus(e),
|
|
@@ -461,12 +496,15 @@ const _sfc_main$1 = defineComponent({
|
|
|
461
496
|
};
|
|
462
497
|
}
|
|
463
498
|
});
|
|
464
|
-
var Payment = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
499
|
+
var Payment = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-66bd61ca"]]);
|
|
465
500
|
const initResignForm = async (config) => {
|
|
466
501
|
if (!config.resignRequest) {
|
|
467
502
|
throw new Error("Attribute 'resignRequest' is required");
|
|
468
503
|
}
|
|
469
504
|
const clientSdk = await SdkLoader.load();
|
|
505
|
+
if (!clientSdk) {
|
|
506
|
+
return null;
|
|
507
|
+
}
|
|
470
508
|
const { appearance, styles, container } = config;
|
|
471
509
|
const formConfig = {
|
|
472
510
|
container: {
|
|
@@ -507,6 +545,8 @@ const _sfc_main = defineComponent({
|
|
|
507
545
|
} },
|
|
508
546
|
onCustomStylesAppended: { type: Function, default: () => {
|
|
509
547
|
} },
|
|
548
|
+
onPaymentDetails: { type: Function, default: () => {
|
|
549
|
+
} },
|
|
510
550
|
onFormRedirect: { type: Function, default: () => {
|
|
511
551
|
} },
|
|
512
552
|
onInteraction: { type: Function, default: () => {
|
|
@@ -516,7 +556,7 @@ const _sfc_main = defineComponent({
|
|
|
516
556
|
onResize: { type: Function, default: () => {
|
|
517
557
|
} }
|
|
518
558
|
},
|
|
519
|
-
emits: ["mounted", "error", "success", "fail", "submit", "verify", "customStylesAppended", "formRedirect", "interaction", "orderStatus", "resize", "readyResignInstance", "resignInitFailed"],
|
|
559
|
+
emits: ["mounted", "error", "success", "fail", "submit", "verify", "customStylesAppended", "paymentDetails", "formRedirect", "interaction", "orderStatus", "resize", "readyResignInstance", "resignInitFailed"],
|
|
520
560
|
setup(__props, { emit }) {
|
|
521
561
|
const props = __props;
|
|
522
562
|
const sdkInstance = ref();
|
|
@@ -537,7 +577,8 @@ const _sfc_main = defineComponent({
|
|
|
537
577
|
onFormRedirect: (e) => props.onFormRedirect && props.onFormRedirect(e),
|
|
538
578
|
onInteraction: (e) => props.onInteraction && props.onInteraction(e),
|
|
539
579
|
onOrderStatus: (e) => props.onOrderStatus && props.onOrderStatus(e),
|
|
540
|
-
onResize: (e) => props.onResize && props.onResize(e)
|
|
580
|
+
onResize: (e) => props.onResize && props.onResize(e),
|
|
581
|
+
onPaymentDetails: (e) => props.onPaymentDetails && props.onPaymentDetails(e)
|
|
541
582
|
};
|
|
542
583
|
onMounted(async () => {
|
|
543
584
|
var _a2, _b;
|
|
@@ -576,5 +617,5 @@ const _sfc_main = defineComponent({
|
|
|
576
617
|
};
|
|
577
618
|
}
|
|
578
619
|
});
|
|
579
|
-
var Resign = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
620
|
+
var Resign = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-77b30339"]]);
|
|
580
621
|
export { AdditionalFieldName, CardBrand, FieldName, FormButtonType, FormType, InteractionTargetType, InteractionType, MessageType, PayableEntity, Resign, SdkLoader, SecureBrand, Payment as default };
|
|
@@ -7,8 +7,10 @@ interface PaymentProps extends Partial<ClientSdkEventsProvider> {
|
|
|
7
7
|
formParams?: InitConfig['formParams'];
|
|
8
8
|
googlePayButtonParams?: Omit<InitConfig['googlePayButtonParams'], 'containerId'>;
|
|
9
9
|
applePayButtonParams?: Omit<InitConfig['applePayButtonParams'], 'containerId'>;
|
|
10
|
+
paypalButtonParams?: Omit<InitConfig['paypalButtonParams'], 'containerId'>;
|
|
10
11
|
googlePayContainerRef?: HTMLDivElement;
|
|
11
12
|
applePayContainerRef?: HTMLDivElement;
|
|
13
|
+
paypalContainerRef?: HTMLDivElement;
|
|
12
14
|
onReadyPaymentInstance?: (paymentInstance: ClientSdkInstance) => void;
|
|
13
15
|
}
|
|
14
16
|
export default PaymentProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InitConfig } from '@solidgate/client-sdk-loader';
|
|
2
|
-
declare function getPayButtonParams<T extends 'googlePayButtonParams' | 'applePayButtonParams'>(config: InitConfig, key: T, container: HTMLElement | undefined): NonNullable<InitConfig[T]> | undefined;
|
|
2
|
+
declare function getPayButtonParams<T extends 'googlePayButtonParams' | 'applePayButtonParams' | 'paypalButtonParams'>(config: InitConfig, key: T, container: HTMLElement | undefined): NonNullable<InitConfig[T]> | undefined;
|
|
3
3
|
export default getPayButtonParams;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ClientSdkInstance } from '@solidgate/client-sdk-loader';
|
|
2
2
|
import PaymentProps from '../interfaces/PaymentProps';
|
|
3
|
-
declare const initPaymentForm: (props: PaymentProps) => Promise<ClientSdkInstance>;
|
|
3
|
+
declare const initPaymentForm: (props: PaymentProps) => Promise<ClientSdkInstance | null>;
|
|
4
4
|
export default initPaymentForm;
|
|
@@ -4,5 +4,5 @@ declare const initResignForm: (config: {
|
|
|
4
4
|
appearance?: ResignFormConfig['appearance'];
|
|
5
5
|
container?: ResignFormConfig['container'];
|
|
6
6
|
styles?: ResignFormConfig['styles'];
|
|
7
|
-
}) => Promise<ClientSdkInstance>;
|
|
7
|
+
}) => Promise<ClientSdkInstance | null>;
|
|
8
8
|
export default initResignForm;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidgate/vue-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"repository": "https://github.com/solidgate-tech/vue-sdk",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"vue": "^3.2.25"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@solidgate/client-sdk-loader": "^1.
|
|
31
|
+
"@solidgate/client-sdk-loader": "^1.11.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/types": "^7.24.5",
|