@bloque/payments-core 0.0.8 → 0.0.9
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/index.cjs +5 -3
- package/dist/index.js +5 -3
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -53,6 +53,7 @@ class BloqueCheckout {
|
|
|
53
53
|
mode,
|
|
54
54
|
checkoutUrl,
|
|
55
55
|
appearance: options.appearance,
|
|
56
|
+
showInstallments: options.showInstallments,
|
|
56
57
|
onReady: options.onReady,
|
|
57
58
|
onSuccess: options.onSuccess,
|
|
58
59
|
onError: options.onError,
|
|
@@ -64,14 +65,15 @@ class BloqueCheckout {
|
|
|
64
65
|
if (this.iframe) return this.iframe;
|
|
65
66
|
this.iframe = document.createElement('iframe');
|
|
66
67
|
let iframeUrl = this.options.checkoutUrl;
|
|
68
|
+
const params = new URLSearchParams();
|
|
67
69
|
if (this.options.appearance) {
|
|
68
|
-
const params = new URLSearchParams();
|
|
69
70
|
if (this.options.appearance.primaryColor) params.set('primaryColor', this.options.appearance.primaryColor);
|
|
70
71
|
if (this.options.appearance.borderRadius) params.set('borderRadius', this.options.appearance.borderRadius);
|
|
71
72
|
if (this.options.appearance.fontFamily) params.set('fontFamily', this.options.appearance.fontFamily);
|
|
72
|
-
const queryString = params.toString();
|
|
73
|
-
if (queryString) iframeUrl = `${iframeUrl}?${queryString}`;
|
|
74
73
|
}
|
|
74
|
+
if (this.options.showInstallments) params.set('showInstallments', 'true');
|
|
75
|
+
const queryString = params.toString();
|
|
76
|
+
if (queryString) iframeUrl = `${iframeUrl}?${queryString}`;
|
|
75
77
|
this.iframe.src = iframeUrl;
|
|
76
78
|
this.iframe.setAttribute('frameborder', '0');
|
|
77
79
|
this.iframe.setAttribute('allowtransparency', 'true');
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ class BloqueCheckout {
|
|
|
23
23
|
mode,
|
|
24
24
|
checkoutUrl,
|
|
25
25
|
appearance: options.appearance,
|
|
26
|
+
showInstallments: options.showInstallments,
|
|
26
27
|
onReady: options.onReady,
|
|
27
28
|
onSuccess: options.onSuccess,
|
|
28
29
|
onError: options.onError,
|
|
@@ -34,14 +35,15 @@ class BloqueCheckout {
|
|
|
34
35
|
if (this.iframe) return this.iframe;
|
|
35
36
|
this.iframe = document.createElement('iframe');
|
|
36
37
|
let iframeUrl = this.options.checkoutUrl;
|
|
38
|
+
const params = new URLSearchParams();
|
|
37
39
|
if (this.options.appearance) {
|
|
38
|
-
const params = new URLSearchParams();
|
|
39
40
|
if (this.options.appearance.primaryColor) params.set('primaryColor', this.options.appearance.primaryColor);
|
|
40
41
|
if (this.options.appearance.borderRadius) params.set('borderRadius', this.options.appearance.borderRadius);
|
|
41
42
|
if (this.options.appearance.fontFamily) params.set('fontFamily', this.options.appearance.fontFamily);
|
|
42
|
-
const queryString = params.toString();
|
|
43
|
-
if (queryString) iframeUrl = `${iframeUrl}?${queryString}`;
|
|
44
43
|
}
|
|
44
|
+
if (this.options.showInstallments) params.set('showInstallments', 'true');
|
|
45
|
+
const queryString = params.toString();
|
|
46
|
+
if (queryString) iframeUrl = `${iframeUrl}?${queryString}`;
|
|
45
47
|
this.iframe.src = iframeUrl;
|
|
46
48
|
this.iframe.setAttribute('frameborder', '0');
|
|
47
49
|
this.iframe.setAttribute('allowtransparency', 'true');
|
package/dist/types.d.ts
CHANGED
|
@@ -54,6 +54,11 @@ export interface BloqueCheckoutOptions {
|
|
|
54
54
|
* Appearance configuration for the checkout
|
|
55
55
|
*/
|
|
56
56
|
appearance?: AppearanceConfig;
|
|
57
|
+
/**
|
|
58
|
+
* Whether to show installment options in the checkout
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
showInstallments?: boolean;
|
|
57
62
|
/**
|
|
58
63
|
* Callback fired when the checkout iframe is ready to receive the checkout ID
|
|
59
64
|
*/
|