@solidgate/vue-sdk 1.24.0 → 1.26.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 +25 -22
- package/dist/Payment.vue.d.ts +26 -0
- package/dist/constants/index.d.ts +3 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +41 -3
- package/dist/interfaces/PaymentProps.d.ts +4 -0
- package/dist/utils/getPayButtonParams.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This repository is a Vue 3 wrapper for the Solidgate Client Software Development Kit (SDK).
|
|
4
4
|
|
|
5
|
-
It supports rendering payment forms and resign forms, including custom container elements for <a href="https://docs.solidgate.com/payments/integrate/payment-form/google-pay-button/" target="_blank">Google Pay</a>, <a href="https://docs.solidgate.com/payments/integrate/payment-form/apple-pay-button/" target="_blank">Apple Pay</a>, or <a href="https://docs.solidgate.com/payments/integrate/payment-form/
|
|
5
|
+
It supports rendering payment forms and resign forms, including custom container elements for <a href="https://docs.solidgate.com/payments/integrate/payment-form/google-pay-button/" target="_blank">Google Pay</a>, <a href="https://docs.solidgate.com/payments/integrate/payment-form/apple-pay-button/" target="_blank">Apple Pay</a>, or alternative payment method (<a href="https://docs.solidgate.com/payments/integrate/payment-form/apm-buttons/" target="_blank">APM</a>) buttons.
|
|
6
6
|
|
|
7
7
|
Check our
|
|
8
8
|
* <a href="https://docs.solidgate.com/" target="_blank">Payment guide</a> to understand business value better
|
|
@@ -72,35 +72,38 @@ const merchantData: InitConfig['merchantData'] = {
|
|
|
72
72
|
|
|
73
73
|
#### Custom containers
|
|
74
74
|
|
|
75
|
-
To render <a href="https://docs.solidgate.com/payments/integrate/payment-form/google-pay-button/" target="_blank">Google Pay</a>, <a href="https://docs.solidgate.com/payments/integrate/payment-form/apple-pay-button/" target="_blank">Apple Pay</a>, or <a href="https://docs.solidgate.com/payments/integrate/payment-form/paypal-button
|
|
75
|
+
To render <a href="https://docs.solidgate.com/payments/integrate/payment-form/google-pay-button/" target="_blank">Google Pay</a>, <a href="https://docs.solidgate.com/payments/integrate/payment-form/apple-pay-button/" target="_blank">Apple Pay</a>, or <a href="https://docs.solidgate.com/payments/integrate/payment-form/apm-buttons/#paypal-button" target="_blank">PayPal</a> buttons in separate containers, define payment as an asynchronous component and pass references to the container elements.
|
|
76
76
|
|
|
77
77
|
```vue
|
|
78
78
|
<template>
|
|
79
79
|
<Payment
|
|
80
|
-
:
|
|
80
|
+
:merchant-data="merchantData"
|
|
81
81
|
:google-pay-container-ref="googleButton"
|
|
82
82
|
:apple-pay-container-ref="appleButton"
|
|
83
83
|
:paypal-container-ref="paypalButton"
|
|
84
|
+
:mbway-container-ref="mbwayButton"
|
|
84
85
|
/>
|
|
85
86
|
<div ref="googleButton" />
|
|
86
87
|
<div ref="appleButton" />
|
|
87
88
|
<div ref="paypalButton" />
|
|
89
|
+
<div ref="mbwayButton" />
|
|
88
90
|
</template>
|
|
89
91
|
|
|
90
92
|
<script lang="ts" setup>
|
|
91
|
-
import { ref, defineAsyncComponent } from 'vue'
|
|
92
|
-
import { InitConfig } from '@solidgate/vue-sdk'
|
|
93
|
-
const Payment = defineAsyncComponent(() => import('@solidgate/vue-sdk'))
|
|
94
|
-
|
|
95
|
-
const googleButton = ref<HTMLDivElement>()
|
|
96
|
-
const appleButton = ref<HTMLDivElement>()
|
|
97
|
-
const paypalButton = ref<HTMLDivElement>()
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
import { ref, defineAsyncComponent } from 'vue'
|
|
94
|
+
import { InitConfig } from '@solidgate/vue-sdk'
|
|
95
|
+
const Payment = defineAsyncComponent(() => import('@solidgate/vue-sdk'))
|
|
96
|
+
|
|
97
|
+
const googleButton = ref<HTMLDivElement>()
|
|
98
|
+
const appleButton = ref<HTMLDivElement>()
|
|
99
|
+
const paypalButton = ref<HTMLDivElement>()
|
|
100
|
+
const mbwayButton = ref<HTMLDivElement>()
|
|
101
|
+
|
|
102
|
+
const merchantData: InitConfig['merchantData'] = {
|
|
103
|
+
merchant: '<<--YOUR MERCHANT ID-->>',
|
|
104
|
+
signature: '<<--YOUR SIGNATURE OF THE REQUEST-->>',
|
|
105
|
+
paymentIntent: '<<--YOUR PAYMENT INTENT-->>'
|
|
106
|
+
}
|
|
104
107
|
</script>
|
|
105
108
|
```
|
|
106
109
|
|
|
@@ -114,13 +117,13 @@ Render a <a href="https://docs.solidgate.com/payments/integrate/payment-form/res
|
|
|
114
117
|
</template>
|
|
115
118
|
|
|
116
119
|
<script lang="ts" setup>
|
|
117
|
-
import { Resign, ResignRequest } from '@solidgate/vue-sdk'
|
|
120
|
+
import { Resign, ResignRequest } from '@solidgate/vue-sdk'
|
|
118
121
|
|
|
119
|
-
const resignRequest: ResignRequest = {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
122
|
+
const resignRequest: ResignRequest = {
|
|
123
|
+
merchant: '<<--YOUR MERCHANT ID-->>',
|
|
124
|
+
signature: '<<--YOUR SIGNATURE OF THE REQUEST-->>',
|
|
125
|
+
resignIntent: '<<--YOUR RESIGN INTENT-->>'
|
|
126
|
+
}
|
|
124
127
|
</script>
|
|
125
128
|
```
|
|
126
129
|
|
package/dist/Payment.vue.d.ts
CHANGED
|
@@ -69,11 +69,24 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
69
69
|
enabled?: boolean | undefined;
|
|
70
70
|
height?: number | undefined;
|
|
71
71
|
} | undefined, "containerId"> | undefined;
|
|
72
|
+
blikButtonParams?: Omit<{
|
|
73
|
+
containerId?: string | undefined;
|
|
74
|
+
enabled?: boolean | undefined;
|
|
75
|
+
theme?: "dark" | "light" | undefined;
|
|
76
|
+
height?: number | undefined;
|
|
77
|
+
} | undefined, "containerId"> | undefined;
|
|
78
|
+
mbwayButtonParams?: Omit<{
|
|
79
|
+
containerId?: string | undefined;
|
|
80
|
+
enabled?: boolean | undefined;
|
|
81
|
+
height?: number | undefined;
|
|
82
|
+
} | undefined, "containerId"> | undefined;
|
|
72
83
|
googlePayContainerRef?: HTMLDivElement | undefined;
|
|
73
84
|
applePayContainerRef?: HTMLDivElement | undefined;
|
|
74
85
|
paypalContainerRef?: HTMLDivElement | undefined;
|
|
75
86
|
pixContainerRef?: HTMLDivElement | undefined;
|
|
76
87
|
bizumContainerRef?: HTMLDivElement | undefined;
|
|
88
|
+
blikContainerRef?: HTMLDivElement | undefined;
|
|
89
|
+
mbwayContainerRef?: HTMLDivElement | undefined;
|
|
77
90
|
onReadyPaymentInstance?: ((paymentInstance: ClientSdkInstance) => void) | undefined;
|
|
78
91
|
onPaymentDetails?: ((e: PaymentDetailsMessage) => void) | undefined;
|
|
79
92
|
onMounted?: ((e: MountedMessage) => void) | undefined;
|
|
@@ -185,11 +198,24 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
185
198
|
enabled?: boolean | undefined;
|
|
186
199
|
height?: number | undefined;
|
|
187
200
|
} | undefined, "containerId"> | undefined;
|
|
201
|
+
blikButtonParams?: Omit<{
|
|
202
|
+
containerId?: string | undefined;
|
|
203
|
+
enabled?: boolean | undefined;
|
|
204
|
+
theme?: "dark" | "light" | undefined;
|
|
205
|
+
height?: number | undefined;
|
|
206
|
+
} | undefined, "containerId"> | undefined;
|
|
207
|
+
mbwayButtonParams?: Omit<{
|
|
208
|
+
containerId?: string | undefined;
|
|
209
|
+
enabled?: boolean | undefined;
|
|
210
|
+
height?: number | undefined;
|
|
211
|
+
} | undefined, "containerId"> | undefined;
|
|
188
212
|
googlePayContainerRef?: HTMLDivElement | undefined;
|
|
189
213
|
applePayContainerRef?: HTMLDivElement | undefined;
|
|
190
214
|
paypalContainerRef?: HTMLDivElement | undefined;
|
|
191
215
|
pixContainerRef?: HTMLDivElement | undefined;
|
|
192
216
|
bizumContainerRef?: HTMLDivElement | undefined;
|
|
217
|
+
blikContainerRef?: HTMLDivElement | undefined;
|
|
218
|
+
mbwayContainerRef?: HTMLDivElement | undefined;
|
|
193
219
|
onReadyPaymentInstance?: ((paymentInstance: ClientSdkInstance) => void) | undefined;
|
|
194
220
|
onPaymentDetails?: ((e: PaymentDetailsMessage) => void) | undefined;
|
|
195
221
|
onMounted?: ((e: MountedMessage) => void) | undefined;
|
|
@@ -4,4 +4,6 @@ declare const APPLE_PAY_BUTTON_CONTAINER_ID: string;
|
|
|
4
4
|
declare const PAYPAL_BUTTON_CONTAINER_ID: string;
|
|
5
5
|
declare const PIX_BUTTON_CONTAINER_ID: string;
|
|
6
6
|
declare const BIZUM_BUTTON_CONTAINER_ID: string;
|
|
7
|
-
|
|
7
|
+
declare const BLIK_BUTTON_CONTAINER_ID: string;
|
|
8
|
+
declare const MBWAY_BUTTON_CONTAINER_ID: string;
|
|
9
|
+
export { IFRAME_CONTAINER_ID, GOOGLE_PAY_BUTTON_CONTAINER_ID, APPLE_PAY_BUTTON_CONTAINER_ID, PAYPAL_BUTTON_CONTAINER_ID, PIX_BUTTON_CONTAINER_ID, BIZUM_BUTTON_CONTAINER_ID, BLIK_BUTTON_CONTAINER_ID, MBWAY_BUTTON_CONTAINER_ID };
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.payment-form-container[data-v-
|
|
1
|
+
.payment-form-container[data-v-757b2e2e] iframe,.payment-form-container[data-v-77b30339] iframe{border:none}
|
package/dist/index.es.js
CHANGED
|
@@ -5,6 +5,8 @@ const APPLE_PAY_BUTTON_CONTAINER_ID = `apple-pay-button-container_#${Math.random
|
|
|
5
5
|
const PAYPAL_BUTTON_CONTAINER_ID = `paypal-button-container_#${Math.random() * 1e4}`;
|
|
6
6
|
const PIX_BUTTON_CONTAINER_ID = `pix-button-container_#${Math.random() * 1e4}`;
|
|
7
7
|
const BIZUM_BUTTON_CONTAINER_ID = `bizum-button-container_#${Math.random() * 1e4}`;
|
|
8
|
+
const BLIK_BUTTON_CONTAINER_ID = `blik-button-container_#${Math.random() * 1e4}`;
|
|
9
|
+
const MBWAY_BUTTON_CONTAINER_ID = `mbway-button-container_#${Math.random() * 1e4}`;
|
|
8
10
|
var MessageType;
|
|
9
11
|
(function(MessageType2) {
|
|
10
12
|
MessageType2["Mounted"] = "mounted";
|
|
@@ -85,6 +87,8 @@ var PayableEntity;
|
|
|
85
87
|
PayableEntity2["Paypal"] = "paypal";
|
|
86
88
|
PayableEntity2["Pix"] = "pix";
|
|
87
89
|
PayableEntity2["Bizum"] = "bizum";
|
|
90
|
+
PayableEntity2["Blik"] = "blik";
|
|
91
|
+
PayableEntity2["Mbway"] = "mbway";
|
|
88
92
|
})(PayableEntity || (PayableEntity = {}));
|
|
89
93
|
var PayableEntity$1 = PayableEntity;
|
|
90
94
|
var InteractionType;
|
|
@@ -234,6 +238,14 @@ const payButtonIds = {
|
|
|
234
238
|
bizumButtonParams: {
|
|
235
239
|
title: "Bizum",
|
|
236
240
|
id: BIZUM_BUTTON_CONTAINER_ID
|
|
241
|
+
},
|
|
242
|
+
blikButtonParams: {
|
|
243
|
+
title: "Blik",
|
|
244
|
+
id: BLIK_BUTTON_CONTAINER_ID
|
|
245
|
+
},
|
|
246
|
+
mbwayButtonParams: {
|
|
247
|
+
title: "MBWay",
|
|
248
|
+
id: MBWAY_BUTTON_CONTAINER_ID
|
|
237
249
|
}
|
|
238
250
|
};
|
|
239
251
|
function getPayButtonParams(config, key, container) {
|
|
@@ -267,7 +279,9 @@ const initPaymentForm = async (props) => {
|
|
|
267
279
|
applePayContainerRef,
|
|
268
280
|
paypalContainerRef,
|
|
269
281
|
pixContainerRef,
|
|
270
|
-
bizumContainerRef
|
|
282
|
+
bizumContainerRef,
|
|
283
|
+
blikContainerRef,
|
|
284
|
+
mbwayContainerRef
|
|
271
285
|
} = props;
|
|
272
286
|
if (!merchantData) {
|
|
273
287
|
throw new Error("Attribute 'merchantData' is required");
|
|
@@ -325,6 +339,22 @@ const initPaymentForm = async (props) => {
|
|
|
325
339
|
if (bizumButtonParams) {
|
|
326
340
|
initConfig.bizumButtonParams = bizumButtonParams;
|
|
327
341
|
}
|
|
342
|
+
const blikButtonParams = getPayButtonParams(
|
|
343
|
+
props,
|
|
344
|
+
"blikButtonParams",
|
|
345
|
+
blikContainerRef
|
|
346
|
+
);
|
|
347
|
+
if (blikButtonParams) {
|
|
348
|
+
initConfig.blikButtonParams = blikButtonParams;
|
|
349
|
+
}
|
|
350
|
+
const mbwayButtonParams = getPayButtonParams(
|
|
351
|
+
props,
|
|
352
|
+
"mbwayButtonParams",
|
|
353
|
+
mbwayContainerRef
|
|
354
|
+
);
|
|
355
|
+
if (mbwayButtonParams) {
|
|
356
|
+
initConfig.mbwayButtonParams = mbwayButtonParams;
|
|
357
|
+
}
|
|
328
358
|
return clientSdk.init(initConfig);
|
|
329
359
|
};
|
|
330
360
|
const onSubscribe = (sdkInstanceValue, callbacks) => {
|
|
@@ -399,11 +429,15 @@ const _sfc_main$1 = defineComponent({
|
|
|
399
429
|
paypalButtonParams: {},
|
|
400
430
|
pixButtonParams: {},
|
|
401
431
|
bizumButtonParams: {},
|
|
432
|
+
blikButtonParams: {},
|
|
433
|
+
mbwayButtonParams: {},
|
|
402
434
|
googlePayContainerRef: {},
|
|
403
435
|
applePayContainerRef: {},
|
|
404
436
|
paypalContainerRef: {},
|
|
405
437
|
pixContainerRef: {},
|
|
406
438
|
bizumContainerRef: {},
|
|
439
|
+
blikContainerRef: {},
|
|
440
|
+
mbwayContainerRef: {},
|
|
407
441
|
onReadyPaymentInstance: {},
|
|
408
442
|
onPaymentDetails: { type: Function, default: () => {
|
|
409
443
|
} },
|
|
@@ -446,11 +480,15 @@ const _sfc_main$1 = defineComponent({
|
|
|
446
480
|
paypalButtonParams: props.paypalButtonParams,
|
|
447
481
|
pixButtonParams: props.pixButtonParams,
|
|
448
482
|
bizumButtonParams: props.bizumButtonParams,
|
|
483
|
+
blikButtonParams: props.blikButtonParams,
|
|
484
|
+
mbwayButtonParams: props.mbwayButtonParams,
|
|
449
485
|
googlePayContainerRef: props.googlePayContainerRef,
|
|
450
486
|
applePayContainerRef: props.applePayContainerRef,
|
|
451
487
|
paypalContainerRef: props.paypalContainerRef,
|
|
452
488
|
pixContainerRef: props.pixContainerRef,
|
|
453
|
-
bizumContainerRef: props.bizumContainerRef
|
|
489
|
+
bizumContainerRef: props.bizumContainerRef,
|
|
490
|
+
blikContainerRef: props.blikContainerRef,
|
|
491
|
+
mbwayContainerRef: props.mbwayContainerRef
|
|
454
492
|
};
|
|
455
493
|
const callbacks = {
|
|
456
494
|
onMounted: (e) => props.onMounted && props.onMounted(e),
|
|
@@ -495,7 +533,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
495
533
|
};
|
|
496
534
|
}
|
|
497
535
|
});
|
|
498
|
-
var Payment = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
536
|
+
var Payment = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-757b2e2e"]]);
|
|
499
537
|
const initResignForm = async (config) => {
|
|
500
538
|
if (!config.resignRequest) {
|
|
501
539
|
throw new Error("Attribute 'resignRequest' is required");
|
|
@@ -10,11 +10,15 @@ interface PaymentProps extends Partial<ClientSdkEventsProvider> {
|
|
|
10
10
|
paypalButtonParams?: Omit<InitConfig['paypalButtonParams'], 'containerId'>;
|
|
11
11
|
pixButtonParams?: Omit<InitConfig['pixButtonParams'], 'containerId'>;
|
|
12
12
|
bizumButtonParams?: Omit<InitConfig['bizumButtonParams'], 'containerId'>;
|
|
13
|
+
blikButtonParams?: Omit<InitConfig['blikButtonParams'], 'containerId'>;
|
|
14
|
+
mbwayButtonParams?: Omit<InitConfig['mbwayButtonParams'], 'containerId'>;
|
|
13
15
|
googlePayContainerRef?: HTMLDivElement;
|
|
14
16
|
applePayContainerRef?: HTMLDivElement;
|
|
15
17
|
paypalContainerRef?: HTMLDivElement;
|
|
16
18
|
pixContainerRef?: HTMLDivElement;
|
|
17
19
|
bizumContainerRef?: HTMLDivElement;
|
|
20
|
+
blikContainerRef?: HTMLDivElement;
|
|
21
|
+
mbwayContainerRef?: HTMLDivElement;
|
|
18
22
|
onReadyPaymentInstance?: (paymentInstance: ClientSdkInstance) => void;
|
|
19
23
|
}
|
|
20
24
|
export default PaymentProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InitConfig } from '@solidgate/client-sdk-loader';
|
|
2
|
-
declare function getPayButtonParams<T extends 'googlePayButtonParams' | 'applePayButtonParams' | 'paypalButtonParams' | 'pixButtonParams' | 'bizumButtonParams'>(config: InitConfig, key: T, container: HTMLElement | undefined): NonNullable<InitConfig[T]> | undefined;
|
|
2
|
+
declare function getPayButtonParams<T extends 'googlePayButtonParams' | 'applePayButtonParams' | 'paypalButtonParams' | 'pixButtonParams' | 'bizumButtonParams' | 'blikButtonParams' | 'mbwayButtonParams'>(config: InitConfig, key: T, container: HTMLElement | undefined): NonNullable<InitConfig[T]> | undefined;
|
|
3
3
|
export default getPayButtonParams;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidgate/vue-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.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.26.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/types": "^7.24.5",
|
|
@@ -51,4 +51,4 @@
|
|
|
51
51
|
"vue": "^3.2.25",
|
|
52
52
|
"vue-tsc": "^1.5.1"
|
|
53
53
|
}
|
|
54
|
-
}
|
|
54
|
+
}
|