@devheit/paydeet-pay-by-app-plugin 0.0.6
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 +75 -0
- package/const/app-constants.js +11 -0
- package/data/currencies.js +1084 -0
- package/index.html +13 -0
- package/index.js +8 -0
- package/lib/dom-setup.js +31 -0
- package/lib/main.js +70 -0
- package/lib/widget.js +121 -0
- package/package.json +36 -0
- package/public/vite.svg +1 -0
- package/style.css +49 -0
- package/util/validate-props.js +37 -0
package/Readme.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Paydeet Pay By App Plugin
|
|
2
|
+
|
|
3
|
+
A JavaScript plugin that enables seamless integration of [Paydeet's](https://www.paydeet.com/) pay-by-app checkout experience into your web application.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
```
|
|
7
|
+
npm install paydeet-pay-by-app-plugin
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- Seamless iframe-based checkout experience
|
|
13
|
+
- Smooth animations for opening and closing
|
|
14
|
+
- Responsive design that works across all devices
|
|
15
|
+
- View transition API support for modern browsers
|
|
16
|
+
- Customizable payment flow
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Implementation
|
|
21
|
+
```javascript
|
|
22
|
+
import PaydeetPlugin from 'paydeet-pay-by-app-plugin';
|
|
23
|
+
// Initialize checkout
|
|
24
|
+
await PaydeetPlugin.checkout({
|
|
25
|
+
amount: 1000, // Amount in cents
|
|
26
|
+
apiKey: 'your-merchant-id',
|
|
27
|
+
currency: 'USD'
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Required Props
|
|
33
|
+
|
|
34
|
+
| Prop | Type | Description |
|
|
35
|
+
|------|------|-------------|
|
|
36
|
+
| `amount` | number | The payment amount in cents |
|
|
37
|
+
| `apiKey` | string | Your unique merchant identifier |
|
|
38
|
+
| `currency` | string | A currency that matches the keys in [this list of currencies](https://gist.github.com/ksafranski/2973986)|
|
|
39
|
+
|
|
40
|
+
## Styling
|
|
41
|
+
|
|
42
|
+
The plugin comes with built-in styles for the modal overlay and animations. The checkout interface will be displayed in a responsive iframe that adapts to different screen sizes.
|
|
43
|
+
|
|
44
|
+
## Browser Support
|
|
45
|
+
|
|
46
|
+
The plugin supports all modern browsers and includes fallbacks for browsers that don't support the [View Transitions API.](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition)
|
|
47
|
+
|
|
48
|
+
## Development
|
|
49
|
+
|
|
50
|
+
To run the project locally:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Install dependencies
|
|
54
|
+
npm install
|
|
55
|
+
# Start development server
|
|
56
|
+
npm run dev
|
|
57
|
+
# Build for production
|
|
58
|
+
npm run build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## Technical Details
|
|
63
|
+
|
|
64
|
+
The plugin is built using:
|
|
65
|
+
- [Vite](https://vite.dev/) for building and development
|
|
66
|
+
- [Zoid](https://www.npmjs.com/package/@krakenjs/zoid) for cross-domain component communication
|
|
67
|
+
- CSS animations for smooth transitions
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
Private - All rights reserved
|
|
72
|
+
|
|
73
|
+
## Support
|
|
74
|
+
|
|
75
|
+
For support or inquiries, please visit https://www.paydeet.com/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import currencies from "../data/currencies.js";
|
|
2
|
+
export const appUrl =
|
|
3
|
+
"https://staging.d1hcmrwpxa0xw3.amplifyapp.com/" || "http://localhost:5173/";
|
|
4
|
+
|
|
5
|
+
export const appRootId = "pay-by-app";
|
|
6
|
+
|
|
7
|
+
export const frameInClass = "frame-in";
|
|
8
|
+
|
|
9
|
+
export const frameOutClass = "frame-out";
|
|
10
|
+
|
|
11
|
+
export const validCurrencyMap = currencies;
|