@spot-flow/checkout-inline-js 0.1.14 → 0.1.21
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 +53 -55
- package/dist/checkout-class.d.ts +5 -3
- package/dist/checkout-inline.es.js +24261 -1387
- package/dist/checkout-inline.js +508 -531
- package/dist/data/countryStateCode.json.d.ts +22019 -0
- package/dist/data.d.ts +17 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/modules/Card.d.ts +14 -13
- package/dist/modules/Transfer.d.ts +23 -6
- package/dist/modules/Ussd.d.ts +3 -1
- package/dist/types/types.d.ts +29 -3
- package/dist/types.d.ts +16 -0
- package/dist/utils/number-format.d.ts +6 -0
- package/dist/utils/stringTransform.d.ts +8 -0
- package/dist/views/card/avs-validation.d.ts +25 -0
- package/dist/views/card/card-detail-form.d.ts +14 -7
- package/dist/views/card/card-otp-validation-form.d.ts +13 -1
- package/dist/views/card/card-pin-form.d.ts +12 -1
- package/dist/views/shared/main-footer.d.ts +15 -0
- package/dist/views/shared/main-header.d.ts +17 -0
- package/dist/views/shared/main-page.d.ts +35 -6
- package/dist/views/shared/main-sidebar.d.ts +17 -0
- package/dist/views/shared/payment-success.d.ts +7 -0
- package/dist/views/shared/payment-warning.d.ts +9 -0
- package/dist/views/shared/shared-main-option.d.ts +21 -0
- package/dist/views/transfer/transfer-confirmation-one.d.ts +13 -0
- package/dist/views/transfer/transfer-confirmation-two.d.ts +13 -0
- package/dist/views/transfer/transfer-confirmtation-progress.d.ts +30 -0
- package/dist/views/transfer/transfer-details.d.ts +23 -0
- package/dist/views/transfer/transfer-expired.d.ts +11 -0
- package/package.json +15 -5
package/README.md
CHANGED
|
@@ -3,36 +3,52 @@
|
|
|
3
3
|
|
|
4
4
|
This project is an inline library that enables users to make payments seamlessly. It integrates smoothly into your application, providing a streamlined checkout experience.
|
|
5
5
|
|
|
6
|
-
For React components and usage, [
|
|
6
|
+
For React components and usage, [React NPM Package](https://www.npmjs.com/package/@spot-flow/react-spotflow-checkout)
|
|
7
7
|
|
|
8
|
-
For Vue.js components and usage, [
|
|
9
|
-
|
|
10
|
-
For Angular components and usage, [link](https://github.com/Spotflow-One/angular-spotflow-checkout)
|
|
8
|
+
For Vue.js components and usage, [Vue NPM Package](https://www.npmjs.com/package/@spot-flow/vue-spotflow-checkout)
|
|
11
9
|
|
|
10
|
+
For Angular components and usage, [Angular NPM Package](https://www.npmjs.com/package/@spot-flow/ng-spotflow-checkout)
|
|
12
11
|
|
|
13
12
|
## Demo
|
|
14
|
-
<img width="808" alt="Screenshot 2024-07-26 at 16 05 52" src="https://github.com/user-attachments/assets/4dbb0b2e-2142-4f04-994a-5c352de7d30e">
|
|
15
13
|
|
|
14
|
+
<img width="808" alt="Screenshot 2024-07-26 at 16 05 52" src="https://github.com/user-attachments/assets/4dbb0b2e-2142-4f04-994a-5c352de7d30e">
|
|
16
15
|
|
|
17
16
|
## Installation
|
|
17
|
+
|
|
18
18
|
```sh
|
|
19
19
|
npm install @spot-flow/checkout-inline-js
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Usage
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
24
25
|
import { CheckoutForm } from "@spot-flow/checkout-inline-js";
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
const { CheckoutForm } = SpotflowCheckout
|
|
28
|
+
const checkout = new CheckoutForm({}
|
|
29
|
+
// merchantKey = "sk_test_d968XXXXXXXXXX69",
|
|
30
|
+
// encryption = "g4ryTjP3VAGwl8Bk9r0foFtgoY64Ba4gZQ701OAAbB4=",
|
|
31
|
+
// email = "oldsdkdk@youmain.com",
|
|
32
|
+
// amount = 10,
|
|
33
|
+
// plandId = "3c902af2-XXXXj-XXXX-XXX88d4"
|
|
34
|
+
|
|
35
|
+
);
|
|
36
|
+
// N
|
|
37
|
+
checkout.setup({
|
|
38
|
+
email: "oludkhsdksn@gmail.com",
|
|
39
|
+
encryptionKey: "g4ryXXXXXXXXXXXX=",
|
|
40
|
+
merchantKey: "sk_test_d96889XXXXXXX684adXXXXX5b69",
|
|
41
|
+
planId: "3c902af2-3333-333-xxxxxxx,
|
|
42
|
+
amount: 5,
|
|
43
|
+
onSuccess: (value) => {
|
|
44
|
+
console.log("Fully Success", { value })
|
|
45
|
+
}
|
|
46
|
+
});
|
|
32
47
|
```
|
|
33
48
|
|
|
34
49
|
Alternatively, you can include it directly in your HTML via a CDN:
|
|
35
|
-
|
|
50
|
+
|
|
51
|
+
```sh
|
|
36
52
|
<script src="https://dr4h9151gox1m.cloudfront.net/dist/checkout-inline.js"></script>
|
|
37
53
|
```
|
|
38
54
|
|
|
@@ -41,50 +57,32 @@ Alternatively, you can include it directly in your HTML via a CDN:
|
|
|
41
57
|
Make Payment
|
|
42
58
|
</button>
|
|
43
59
|
```
|
|
44
|
-
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
45
62
|
<script>
|
|
63
|
+
|
|
46
64
|
const openCheckout = () => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
65
|
+
const { CheckoutForm } = SpotflowCheckout
|
|
66
|
+
const checkout = new CheckoutForm({}
|
|
67
|
+
// merchantKey = "sk_test_d968XXXXXXXXXX69",
|
|
68
|
+
// encryption = "g4ryTjP373849849494949OAAbB4=",
|
|
69
|
+
// email = "oldsdkdk@youmain.com",
|
|
70
|
+
// amount = 10,
|
|
71
|
+
// plandId = "3c902af2-XXXXj-XXXX-XXX88d4"
|
|
72
|
+
|
|
73
|
+
);
|
|
74
|
+
// N
|
|
75
|
+
checkout.setup({
|
|
76
|
+
email: "oludkhsdksn@gmail.com",
|
|
77
|
+
encryptionKey: "g4ryXXXXXXXXXXXX=",
|
|
78
|
+
merchantKey: "sk_test_d96889XXXXXXX684adXXXXX5b69",
|
|
79
|
+
planId: "3c902af2-3333-333-xxxxxxx,
|
|
80
|
+
amount: 5,
|
|
81
|
+
onSuccess: (value) => {
|
|
82
|
+
console.log("Fully Success", { value })
|
|
83
|
+
}
|
|
84
|
+
});
|
|
54
85
|
};
|
|
86
|
+
|
|
55
87
|
</script>
|
|
56
88
|
```
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
## Contributing
|
|
60
|
-
|
|
61
|
-
We welcome contributions! Follow the steps below to get started:
|
|
62
|
-
|
|
63
|
-
### Getting Started
|
|
64
|
-
|
|
65
|
-
1. **Clone the repository:**
|
|
66
|
-
|
|
67
|
-
```sh
|
|
68
|
-
git clone https://github.com/Spotflow-One/spotflow-checkout.git
|
|
69
|
-
cd your-repo
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
2. **Install dependencies:**
|
|
73
|
-
|
|
74
|
-
```sh
|
|
75
|
-
npm install
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Example Usage
|
|
79
|
-
|
|
80
|
-
You can see an example of how to use the library in `index.html`. Open this file in your browser to see it in action.
|
|
81
|
-
|
|
82
|
-
### Building the Project
|
|
83
|
-
|
|
84
|
-
To build the project, run:
|
|
85
|
-
|
|
86
|
-
```sh
|
|
87
|
-
npm run build
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
This will compile the source files and generate the output in the `dist` directory.
|
package/dist/checkout-class.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { MainPageScreen } from './views/shared/main-page';
|
|
2
2
|
import { SharedErrorScreen } from './views/shared/shared-error-page';
|
|
3
3
|
import { PageLoader } from './views/shared/page-loader';
|
|
4
|
+
import { SpotflowProps } from './types';
|
|
4
5
|
|
|
5
6
|
declare class CheckoutForm {
|
|
6
7
|
modalContainer: HTMLDivElement;
|
|
7
8
|
currentPaymentMethod: number;
|
|
8
9
|
currentStep: number;
|
|
9
10
|
mainLayout: HTMLDivElement;
|
|
11
|
+
private onSuccess;
|
|
12
|
+
private onClose;
|
|
10
13
|
encryption: string;
|
|
11
|
-
container: HTMLDivElement;
|
|
12
14
|
mainScreen: MainPageScreen;
|
|
13
15
|
mainError: SharedErrorScreen;
|
|
14
16
|
mainLoader: PageLoader;
|
|
@@ -18,9 +20,9 @@ declare class CheckoutForm {
|
|
|
18
20
|
email: string;
|
|
19
21
|
amount: number;
|
|
20
22
|
isMobile: boolean;
|
|
21
|
-
constructor(
|
|
23
|
+
constructor(config: Partial<SpotflowProps>);
|
|
22
24
|
closeBTN(): void;
|
|
23
|
-
setup(): void;
|
|
25
|
+
setup(config: Partial<SpotflowProps>): void;
|
|
24
26
|
private getPlanDetails;
|
|
25
27
|
closeModal(): void;
|
|
26
28
|
}
|