@monei-js/components 1.7.10 → 2.0.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.
Files changed (56) hide show
  1. package/README.md +72 -9
  2. package/dist/chunk.js +13 -0
  3. package/dist/index.cjs +1623 -0
  4. package/dist/index.d.cts +510 -0
  5. package/dist/index.d.ts +508 -14
  6. package/dist/index.js +1596 -7
  7. package/dist/monei.umd.production.min.js +64 -0
  8. package/dist/monei.umd.production.min.js.map +1 -0
  9. package/package.json +41 -65
  10. package/src/bridge/types.ts +102 -0
  11. package/dist/api.d.ts +0 -13
  12. package/dist/bizum/container.d.ts +0 -4
  13. package/dist/bizum/index.d.ts +0 -5
  14. package/dist/bizum/modal.d.ts +0 -3
  15. package/dist/bizum/types.d.ts +0 -30
  16. package/dist/cardInput/index.d.ts +0 -8
  17. package/dist/cardInput/types.d.ts +0 -51
  18. package/dist/click2pay/container.d.ts +0 -4
  19. package/dist/click2pay/index.d.ts +0 -5
  20. package/dist/click2pay/modal.d.ts +0 -3
  21. package/dist/click2pay/types.d.ts +0 -23
  22. package/dist/cofidis/container.d.ts +0 -4
  23. package/dist/cofidis/index.d.ts +0 -6
  24. package/dist/cofidis/modal.d.ts +0 -3
  25. package/dist/cofidis/types.d.ts +0 -45
  26. package/dist/cofidis/widget.d.ts +0 -3
  27. package/dist/cofidisLoan/container.d.ts +0 -4
  28. package/dist/cofidisLoan/index.d.ts +0 -7
  29. package/dist/cofidisLoan/modal.d.ts +0 -4
  30. package/dist/cofidisLoan/types.d.ts +0 -45
  31. package/dist/cofidisLoan/widget.d.ts +0 -4
  32. package/dist/components.cjs.development.js +0 -18997
  33. package/dist/components.cjs.development.js.map +0 -1
  34. package/dist/components.cjs.production.min.js +0 -2
  35. package/dist/components.cjs.production.min.js.map +0 -1
  36. package/dist/components.esm.js +0 -18979
  37. package/dist/components.esm.js.map +0 -1
  38. package/dist/config.d.ts +0 -28
  39. package/dist/container.d.ts +0 -1
  40. package/dist/enums.d.ts +0 -4
  41. package/dist/googlePay/index.d.ts +0 -4
  42. package/dist/googlePay/types.d.ts +0 -21
  43. package/dist/paymentModal/container.d.ts +0 -4
  44. package/dist/paymentModal/index.d.ts +0 -6
  45. package/dist/paymentModal/types.d.ts +0 -28
  46. package/dist/paymentRequest/index.d.ts +0 -4
  47. package/dist/paymentRequest/types.d.ts +0 -22
  48. package/dist/paypal/index.d.ts +0 -4
  49. package/dist/paypal/types.d.ts +0 -27
  50. package/dist/types.d.ts +0 -194
  51. package/dist/utils.d.ts +0 -11
  52. package/types/belter.d.ts +0 -1
  53. package/types/component.d.ts +0 -196
  54. package/types/css.d.ts +0 -9
  55. package/types/global.d.ts +0 -3
  56. package/types/post-robot.d.ts +0 -1
package/README.md CHANGED
@@ -1,16 +1,79 @@
1
- # MONEI Components
1
+ # @monei-js/components
2
2
 
3
- MONEI UI Components enable you to collect sensitive payment information using customizable UI components.
3
+ MONEI UI Components drop-in payment UI for the web. Renders secure iframes for card input, PayPal, Bizum, Google Pay, Apple Pay, and a full payment modal. Works with any framework or vanilla JS.
4
4
 
5
- UI components include features like:
5
+ ## Install
6
6
 
7
- Formatting card information automatically as it’s entered
8
- Translating placeholders into your customer’s preferred language
9
- Using responsive design to fit the width of your customer’s screen or mobile device
10
- Customizing the styling to match the look and feel of your checkout flow
7
+ ```bash
8
+ npm install @monei-js/components
9
+ ```
11
10
 
12
- For creating payments on your server, use [@monei-js/node-sdk](https://github.com/MONEI/monei-node-sdk)
11
+ Or load via CDN:
12
+
13
+ ```html
14
+ <script src="https://js.monei.com/v3/monei.js"></script>
15
+ ```
16
+
17
+ ## Components
18
+
19
+ | Component | Description |
20
+ | ---------------- | -------------------------------------------- |
21
+ | `CardInput` | Secure card number/expiry/CVC input (iframe) |
22
+ | `PaymentModal` | Full-screen payment flow modal |
23
+ | `Bizum` | Bizum button + phone verification modal |
24
+ | `PayPal` | PayPal checkout button |
25
+ | `GooglePay` | Google Pay button |
26
+ | `PaymentRequest` | Apple Pay / browser Payment Request button |
27
+
28
+ ## Quick Start
29
+
30
+ ```js
31
+ import {CardInput, createToken, confirmPayment} from '@monei-js/components';
32
+
33
+ // Render card input
34
+ const cardInput = CardInput({
35
+ paymentId: 'pay_...',
36
+ onChange({isTouched, error, cardType}) {
37
+ // handle validation state
38
+ },
39
+ onLoad() {
40
+ // component ready
41
+ }
42
+ });
43
+ cardInput.render('#card-input');
44
+
45
+ // Tokenize and confirm
46
+ const {token} = await createToken(cardInput);
47
+ const result = await confirmPayment({paymentId: 'pay_...', paymentToken: token});
48
+ ```
49
+
50
+ ## API
51
+
52
+ Exported via `api` namespace:
53
+
54
+ - `createToken(request)` — tokenize a payment method (card, PayPal, Google Pay, Apple Pay, Bizum)
55
+ - `confirmPayment({paymentId, ...})` — confirm a payment with token
56
+ - `getPaymentMethods({accountId | paymentId})` — list available payment methods
57
+ - `getPayment(paymentId)` — fetch payment status
58
+ - `createPayment({accountId, amount, currency, ...})` — create a client-side payment (POS)
59
+ - `sendPaymentReceipt({paymentId, customerEmail, ...})` — send receipt email
60
+
61
+ ## Framework Drivers
62
+
63
+ Built-in rendering drivers for React, Vue 3, and Angular via `.driver()`:
64
+
65
+ ```js
66
+ const MoneiCardInput = CardInput.driver('react');
67
+ ```
68
+
69
+ ## Server-Side
70
+
71
+ For creating payments on your server, use [@monei-js/node-sdk](https://github.com/MONEI/monei-node-sdk).
13
72
 
14
73
  ## Documentation
15
74
 
16
- Check full documentation in our [Documentation portal](https://docs.monei.com/docs/monei-js-overview)
75
+ Full docs: [docs.monei.com/docs/monei-js-overview](https://docs.monei.com/docs/monei-js-overview)
76
+
77
+ ## License
78
+
79
+ MIT
package/dist/chunk.js ADDED
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };