@solidgate/vue-sdk 1.20.0 → 1.22.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 CHANGED
@@ -142,4 +142,10 @@ Vue3 + Typescript + Vite
142
142
  1. `cd vue-sdk`
143
143
  2. `npm run build`
144
144
  3. `cd dist`
145
- 4. solid-payment.es.js is a js bundle
145
+ 4. solid-payment.es.js is a js bundle
146
+
147
+ ---
148
+
149
+ Looking for help? <a href="https://support.solidgate.com/support/tickets/new" target="_blank">Contact us</a> <br>
150
+ Want to contribute? <a href="https://github.com/solidgate-tech/vue-sdk/pulls" target="_blank">Submit a pull request</a>
151
+
@@ -59,9 +59,15 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
59
59
  label?: "paypal" | "checkout" | "buynow" | "pay" | "installment" | undefined;
60
60
  height?: number | undefined;
61
61
  } | undefined, "containerId"> | undefined;
62
+ pixButtonParams?: Omit<{
63
+ containerId?: string | undefined;
64
+ enabled?: boolean | undefined;
65
+ height?: number | undefined;
66
+ } | undefined, "containerId"> | undefined;
62
67
  googlePayContainerRef?: HTMLDivElement | undefined;
63
68
  applePayContainerRef?: HTMLDivElement | undefined;
64
69
  paypalContainerRef?: HTMLDivElement | undefined;
70
+ pixContainerRef?: HTMLDivElement | undefined;
65
71
  onReadyPaymentInstance?: ((paymentInstance: ClientSdkInstance) => void) | undefined;
66
72
  onPaymentDetails?: ((e: PaymentDetailsMessage) => void) | undefined;
67
73
  onMounted?: ((e: MountedMessage) => void) | undefined;
@@ -163,9 +169,15 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
163
169
  label?: "paypal" | "checkout" | "buynow" | "pay" | "installment" | undefined;
164
170
  height?: number | undefined;
165
171
  } | undefined, "containerId"> | undefined;
172
+ pixButtonParams?: Omit<{
173
+ containerId?: string | undefined;
174
+ enabled?: boolean | undefined;
175
+ height?: number | undefined;
176
+ } | undefined, "containerId"> | undefined;
166
177
  googlePayContainerRef?: HTMLDivElement | undefined;
167
178
  applePayContainerRef?: HTMLDivElement | undefined;
168
179
  paypalContainerRef?: HTMLDivElement | undefined;
180
+ pixContainerRef?: HTMLDivElement | undefined;
169
181
  onReadyPaymentInstance?: ((paymentInstance: ClientSdkInstance) => void) | undefined;
170
182
  onPaymentDetails?: ((e: PaymentDetailsMessage) => void) | undefined;
171
183
  onMounted?: ((e: MountedMessage) => void) | undefined;
@@ -2,4 +2,5 @@ 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 };
5
+ declare const PIX_BUTTON_CONTAINER_ID: string;
6
+ export { IFRAME_CONTAINER_ID, GOOGLE_PAY_BUTTON_CONTAINER_ID, APPLE_PAY_BUTTON_CONTAINER_ID, PAYPAL_BUTTON_CONTAINER_ID, PIX_BUTTON_CONTAINER_ID };
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- .payment-form-container[data-v-66bd61ca] iframe,.payment-form-container[data-v-77b30339] iframe{border:none}
1
+ .payment-form-container[data-v-5eddb80c] iframe,.payment-form-container[data-v-77b30339] iframe{border:none}
package/dist/index.es.js CHANGED
@@ -3,6 +3,7 @@ import './index.css';const IFRAME_CONTAINER_ID = `solid-payment-form-container_#
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
5
  const PAYPAL_BUTTON_CONTAINER_ID = `paypal-button-container_#${Math.random() * 1e4}`;
6
+ const PIX_BUTTON_CONTAINER_ID = `pix-button-container_#${Math.random() * 1e4}`;
6
7
  var MessageType;
7
8
  (function(MessageType2) {
8
9
  MessageType2["Mounted"] = "mounted";
@@ -222,6 +223,10 @@ const payButtonIds = {
222
223
  paypalButtonParams: {
223
224
  title: "PayPal",
224
225
  id: PAYPAL_BUTTON_CONTAINER_ID
226
+ },
227
+ pixButtonParams: {
228
+ title: "Pix",
229
+ id: PIX_BUTTON_CONTAINER_ID
225
230
  }
226
231
  };
227
232
  function getPayButtonParams(config, key, container) {
@@ -253,7 +258,8 @@ const initPaymentForm = async (props) => {
253
258
  formParams,
254
259
  googlePayContainerRef,
255
260
  applePayContainerRef,
256
- paypalContainerRef
261
+ paypalContainerRef,
262
+ pixContainerRef
257
263
  } = props;
258
264
  if (!merchantData) {
259
265
  throw new Error("Attribute 'merchantData' is required");
@@ -295,6 +301,14 @@ const initPaymentForm = async (props) => {
295
301
  if (paypalButtonParams) {
296
302
  initConfig.paypalButtonParams = paypalButtonParams;
297
303
  }
304
+ const pixButtonParams = getPayButtonParams(
305
+ props,
306
+ "pixButtonParams",
307
+ pixContainerRef
308
+ );
309
+ if (pixButtonParams) {
310
+ initConfig.pixButtonParams = pixButtonParams;
311
+ }
298
312
  return clientSdk.init(initConfig);
299
313
  };
300
314
  const onSubscribe = (sdkInstanceValue, callbacks) => {
@@ -367,9 +381,11 @@ const _sfc_main$1 = defineComponent({
367
381
  googlePayButtonParams: {},
368
382
  applePayButtonParams: {},
369
383
  paypalButtonParams: {},
384
+ pixButtonParams: {},
370
385
  googlePayContainerRef: {},
371
386
  applePayContainerRef: {},
372
387
  paypalContainerRef: {},
388
+ pixContainerRef: {},
373
389
  onReadyPaymentInstance: {},
374
390
  onPaymentDetails: { type: Function, default: () => {
375
391
  } },
@@ -410,9 +426,11 @@ const _sfc_main$1 = defineComponent({
410
426
  googlePayButtonParams: props.googlePayButtonParams,
411
427
  applePayButtonParams: props.applePayButtonParams,
412
428
  paypalButtonParams: props.paypalButtonParams,
429
+ pixButtonParams: props.pixButtonParams,
413
430
  googlePayContainerRef: props.googlePayContainerRef,
414
431
  applePayContainerRef: props.applePayContainerRef,
415
- paypalContainerRef: props.paypalContainerRef
432
+ paypalContainerRef: props.paypalContainerRef,
433
+ pixContainerRef: props.pixContainerRef
416
434
  };
417
435
  const callbacks = {
418
436
  onMounted: (e) => props.onMounted && props.onMounted(e),
@@ -457,7 +475,7 @@ const _sfc_main$1 = defineComponent({
457
475
  };
458
476
  }
459
477
  });
460
- var Payment = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-66bd61ca"]]);
478
+ var Payment = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-5eddb80c"]]);
461
479
  const initResignForm = async (config) => {
462
480
  if (!config.resignRequest) {
463
481
  throw new Error("Attribute 'resignRequest' is required");
@@ -8,9 +8,11 @@ interface PaymentProps extends Partial<ClientSdkEventsProvider> {
8
8
  googlePayButtonParams?: Omit<InitConfig['googlePayButtonParams'], 'containerId'>;
9
9
  applePayButtonParams?: Omit<InitConfig['applePayButtonParams'], 'containerId'>;
10
10
  paypalButtonParams?: Omit<InitConfig['paypalButtonParams'], 'containerId'>;
11
+ pixButtonParams?: Omit<InitConfig['pixButtonParams'], 'containerId'>;
11
12
  googlePayContainerRef?: HTMLDivElement;
12
13
  applePayContainerRef?: HTMLDivElement;
13
14
  paypalContainerRef?: HTMLDivElement;
15
+ pixContainerRef?: HTMLDivElement;
14
16
  onReadyPaymentInstance?: (paymentInstance: ClientSdkInstance) => void;
15
17
  }
16
18
  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'>(config: InitConfig, key: T, container: HTMLElement | undefined): NonNullable<InitConfig[T]> | undefined;
2
+ declare function getPayButtonParams<T extends 'googlePayButtonParams' | 'applePayButtonParams' | 'paypalButtonParams' | 'pixButtonParams'>(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.20.0",
3
+ "version": "1.22.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.20.0"
31
+ "@solidgate/client-sdk-loader": "^1.22.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
+ }