@bloque/payments-core 0.0.9 → 0.0.11

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 CHANGED
@@ -54,6 +54,9 @@ class BloqueCheckout {
54
54
  checkoutUrl,
55
55
  appearance: options.appearance,
56
56
  showInstallments: options.showInstallments,
57
+ paymentMethods: options.paymentMethods || [
58
+ 'card'
59
+ ],
57
60
  onReady: options.onReady,
58
61
  onSuccess: options.onSuccess,
59
62
  onError: options.onError,
@@ -72,6 +75,7 @@ class BloqueCheckout {
72
75
  if (this.options.appearance.fontFamily) params.set('fontFamily', this.options.appearance.fontFamily);
73
76
  }
74
77
  if (this.options.showInstallments) params.set('showInstallments', 'true');
78
+ if (this.options.paymentMethods && this.options.paymentMethods.length > 0) params.set('paymentMethods', this.options.paymentMethods.join(','));
75
79
  const queryString = params.toString();
76
80
  if (queryString) iframeUrl = `${iframeUrl}?${queryString}`;
77
81
  this.iframe.src = iframeUrl;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { BloqueCheckout, createCheckout, init } from './checkout';
2
- export type { AppearanceConfig, BloqueCheckoutOptions, BloqueInitOptions, CheckoutMessage, CheckoutMessageType, PaymentResult, } from './types';
2
+ export type { AppearanceConfig, BloqueCheckoutOptions, BloqueInitOptions, CheckoutMessage, CheckoutMessageType, PaymentMethod, PaymentResult, } from './types';
package/dist/index.js CHANGED
@@ -24,6 +24,9 @@ class BloqueCheckout {
24
24
  checkoutUrl,
25
25
  appearance: options.appearance,
26
26
  showInstallments: options.showInstallments,
27
+ paymentMethods: options.paymentMethods || [
28
+ 'card'
29
+ ],
27
30
  onReady: options.onReady,
28
31
  onSuccess: options.onSuccess,
29
32
  onError: options.onError,
@@ -42,6 +45,7 @@ class BloqueCheckout {
42
45
  if (this.options.appearance.fontFamily) params.set('fontFamily', this.options.appearance.fontFamily);
43
46
  }
44
47
  if (this.options.showInstallments) params.set('showInstallments', 'true');
48
+ if (this.options.paymentMethods && this.options.paymentMethods.length > 0) params.set('paymentMethods', this.options.paymentMethods.join(','));
45
49
  const queryString = params.toString();
46
50
  if (queryString) iframeUrl = `${iframeUrl}?${queryString}`;
47
51
  this.iframe.src = iframeUrl;
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export type PaymentMethod = 'card' | 'pse';
1
2
  export interface AppearanceConfig {
2
3
  /**
3
4
  * Primary color for buttons and accents
@@ -59,6 +60,14 @@ export interface BloqueCheckoutOptions {
59
60
  * @default false
60
61
  */
61
62
  showInstallments?: boolean;
63
+ /**
64
+ * Payment methods to display in the checkout
65
+ * @example ['card', 'pse'] - Both card and PSE
66
+ * @example ['pse'] - Only PSE
67
+ * @example ['card'] - Only card (default)
68
+ * @default ['card']
69
+ */
70
+ paymentMethods?: PaymentMethod[];
62
71
  /**
63
72
  * Callback fired when the checkout iframe is ready to receive the checkout ID
64
73
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloque/payments-core",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Core utilities and types for Bloque Payments.",
5
5
  "type": "module",
6
6
  "keywords": [