@henrylabs-interview/payment-processor 0.2.8 → 0.2.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.
@@ -38,16 +38,16 @@ export async function renderEmbeddedCheckout(containerElementId, checkoutId, cal
38
38
 
39
39
  <div style="display:flex; flex-direction:column; gap:14px;">
40
40
 
41
- ${inputBlock('card-number', 'Card Number', '4242 4242 4242 4242')}
41
+ ${inputBlock('card-number', 'Card Number', '4242 4242 4242 4242', 16)}
42
42
  <div style="display:flex; gap:10px;">
43
43
  <div style="flex:1;">
44
- ${inputBlock('exp-month', 'Exp. Month', '12')}
44
+ ${inputBlock('exp-month', 'Exp. Month', '12', 2)}
45
45
  </div>
46
46
  <div style="flex:1;">
47
- ${inputBlock('exp-year', 'Exp. Year', '2030')}
47
+ ${inputBlock('exp-year', 'Exp. Year', '2030', 4)}
48
48
  </div>
49
49
  </div>
50
- ${inputBlock('cvc', 'CVC', '123')}
50
+ ${inputBlock('cvc', 'CVC', '123', 3)}
51
51
 
52
52
  <button id="confirm-btn"
53
53
  style="
@@ -73,7 +73,7 @@ export async function renderEmbeddedCheckout(containerElementId, checkoutId, cal
73
73
  </div>
74
74
  </div>
75
75
  `;
76
- function inputBlock(id, label, placeholder) {
76
+ function inputBlock(id, label, placeholder, maxLength) {
77
77
  return `
78
78
  <div style="display:flex; flex-direction:column;">
79
79
  <label style="font-size:12px; color:#6b7280; margin-bottom:6px;">
@@ -81,9 +81,11 @@ export async function renderEmbeddedCheckout(containerElementId, checkoutId, cal
81
81
  </label>
82
82
  <input
83
83
  id="${id}"
84
- type="tel"
84
+ type="text"
85
+ inputmode="numeric"
86
+ maxlength="${maxLength}"
87
+ pattern="[0-9]*"
85
88
  placeholder="${placeholder}"
86
- inputmode="numeric"
87
89
  style="
88
90
  padding:10px 12px;
89
91
  border-radius:10px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henrylabs-interview/payment-processor",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",