@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.
- package/README.md +72 -9
- package/dist/chunk.js +13 -0
- package/dist/index.cjs +1623 -0
- package/dist/index.d.cts +510 -0
- package/dist/index.d.ts +508 -14
- package/dist/index.js +1596 -7
- package/dist/monei.umd.production.min.js +64 -0
- package/dist/monei.umd.production.min.js.map +1 -0
- package/package.json +41 -65
- package/src/bridge/types.ts +102 -0
- package/dist/api.d.ts +0 -13
- package/dist/bizum/container.d.ts +0 -4
- package/dist/bizum/index.d.ts +0 -5
- package/dist/bizum/modal.d.ts +0 -3
- package/dist/bizum/types.d.ts +0 -30
- package/dist/cardInput/index.d.ts +0 -8
- package/dist/cardInput/types.d.ts +0 -51
- package/dist/click2pay/container.d.ts +0 -4
- package/dist/click2pay/index.d.ts +0 -5
- package/dist/click2pay/modal.d.ts +0 -3
- package/dist/click2pay/types.d.ts +0 -23
- package/dist/cofidis/container.d.ts +0 -4
- package/dist/cofidis/index.d.ts +0 -6
- package/dist/cofidis/modal.d.ts +0 -3
- package/dist/cofidis/types.d.ts +0 -45
- package/dist/cofidis/widget.d.ts +0 -3
- package/dist/cofidisLoan/container.d.ts +0 -4
- package/dist/cofidisLoan/index.d.ts +0 -7
- package/dist/cofidisLoan/modal.d.ts +0 -4
- package/dist/cofidisLoan/types.d.ts +0 -45
- package/dist/cofidisLoan/widget.d.ts +0 -4
- package/dist/components.cjs.development.js +0 -18997
- package/dist/components.cjs.development.js.map +0 -1
- package/dist/components.cjs.production.min.js +0 -2
- package/dist/components.cjs.production.min.js.map +0 -1
- package/dist/components.esm.js +0 -18979
- package/dist/components.esm.js.map +0 -1
- package/dist/config.d.ts +0 -28
- package/dist/container.d.ts +0 -1
- package/dist/enums.d.ts +0 -4
- package/dist/googlePay/index.d.ts +0 -4
- package/dist/googlePay/types.d.ts +0 -21
- package/dist/paymentModal/container.d.ts +0 -4
- package/dist/paymentModal/index.d.ts +0 -6
- package/dist/paymentModal/types.d.ts +0 -28
- package/dist/paymentRequest/index.d.ts +0 -4
- package/dist/paymentRequest/types.d.ts +0 -22
- package/dist/paypal/index.d.ts +0 -4
- package/dist/paypal/types.d.ts +0 -27
- package/dist/types.d.ts +0 -194
- package/dist/utils.d.ts +0 -11
- package/types/belter.d.ts +0 -1
- package/types/component.d.ts +0 -196
- package/types/css.d.ts +0 -9
- package/types/global.d.ts +0 -3
- package/types/post-robot.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,16 +1,79 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @monei-js/components
|
|
2
2
|
|
|
3
|
-
MONEI 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
|
-
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|