sslcommerz-js 1.0.0 → 1.0.5
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/LICENSE +57 -21
- package/README.md +33 -10
- package/dist/cjs/helpers/httpCall.js +0 -1
- package/dist/cjs/helpers/httpCall.js.map +1 -1
- package/dist/esm/helpers/httpCall.js +0 -1
- package/dist/esm/helpers/httpCall.js.map +1 -1
- package/package.json +2 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
LICENSE
|
|
2
|
+
Version 1.0 — 2026
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 Siam Ahnaf ([siamahnaf.com](https://siamahnaf.com/))
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
1) Definitions
|
|
8
|
+
"Software" means the source code, binaries, assets, and documentation in this repository.
|
|
9
|
+
"Product" means a larger work or application that incorporates the Software as a component.
|
|
10
|
+
"You" means the individual or entity using the Software.
|
|
11
|
+
"Public" includes any distribution to third parties, including public repositories, mirrors, reposts, or file sharing.
|
|
12
|
+
|
|
13
|
+
2) Permission Granted
|
|
14
|
+
Subject to the restrictions below, You are granted a limited, non-exclusive, non-transferable license to:
|
|
15
|
+
(a) use the Software for personal learning and internal development; and
|
|
16
|
+
(b) use, modify, and integrate the Software into a Product, including Products that are commercial.
|
|
17
|
+
|
|
18
|
+
3) Distribution of Your Product
|
|
19
|
+
You may distribute or sell Your Product that includes the Software only if ALL of the following are true:
|
|
20
|
+
(a) the Software is included only as part of Your Product and not offered as a standalone product or package; and
|
|
21
|
+
(b) You do NOT publish, redistribute, or provide the Software’s source code (or substantial portions of it) to the public; and
|
|
22
|
+
(c) You include the copyright notice in your Product’s documentation, legal notices, or “About” screen.
|
|
23
|
+
|
|
24
|
+
4) What You MAY NOT Do Without Written Permission
|
|
25
|
+
Unless you have prior written permission from the copyright holder, You may NOT:
|
|
26
|
+
(a) sell, license, or distribute the Software itself (or any substantial portion) as a standalone item,
|
|
27
|
+
including as a template, starter kit, boilerplate, SDK, library, plugin, course material, or “my own version”;
|
|
28
|
+
(b) publish, mirror, repost, or redistribute the Software (source or modified source) publicly;
|
|
29
|
+
(c) create or maintain a public fork as an alternative/competing project;
|
|
30
|
+
(d) package and distribute the Software by itself via registries or marketplaces (e.g., npm/pip/composer, theme stores,
|
|
31
|
+
code marketplaces), except when you have written permission;
|
|
32
|
+
(e) remove or alter copyright, license, or attribution notices.
|
|
33
|
+
|
|
34
|
+
5) Contribution-Only Forking
|
|
35
|
+
Public forks are permitted only when reasonably necessary to submit contributions back to the original repository
|
|
36
|
+
(e.g., via pull requests). Forks must not be promoted or maintained as separate projects and should be deleted or
|
|
37
|
+
made private after the contribution is merged or abandoned.
|
|
38
|
+
|
|
39
|
+
6) Ownership
|
|
40
|
+
The Software is licensed, not sold. All rights, title, and interest remain with the copyright holder.
|
|
41
|
+
|
|
42
|
+
7) Termination
|
|
43
|
+
Any violation of this license automatically terminates your rights. Upon termination, You must stop using the Software
|
|
44
|
+
and delete all copies under your control.
|
|
45
|
+
|
|
46
|
+
8) Disclaimer of Warranty
|
|
47
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
48
|
+
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
49
|
+
|
|
50
|
+
9) Limitation of Liability
|
|
51
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
52
|
+
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
53
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
54
|
+
|
|
55
|
+
10) Permission Requests
|
|
56
|
+
For permissions beyond this license (public redistribution, standalone resale, publishing modified source, etc.), contact:
|
|
57
|
+
mail@siamahnaf.com
|
package/README.md
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
<!-- sslcommerz-nodesdk -->
|
|
2
|
+
<!-- sslcommerz-js -->
|
|
3
|
+
<!-- @siamf/sslcommerz -->
|
|
4
|
+
|
|
1
5
|
<br/>
|
|
2
6
|
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://
|
|
4
|
-
<source media="(prefers-color-scheme: light)" srcset="https://
|
|
5
|
-
<img alt="Siam Ahnaf" src="https://
|
|
6
|
-
</picture>
|
|
7
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/logo/logo-white.png">
|
|
8
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/logo/logo-black.png">
|
|
9
|
+
<img alt="Siam Ahnaf" src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/logo/logo-black.png" height="auto" width="240">
|
|
10
|
+
</picture>
|
|
7
11
|
<br/> <br/>
|
|
8
12
|
|
|
9
13
|
# @siamf/sslcommerz
|
|
10
14
|
A well-maintained, unofficial Node.js package for integrating SSLCommerz payments. Provides reliable support for initiating and handling transactions with minimal setup.
|
|
11
15
|
|
|
16
|
+
## This is 100% secure and build with official docs. It doesn't contain any unwanted activity code and the full code is open source.
|
|
17
|
+
|
|
18
|
+
### Note: `@siamf/sslcommerz`, `sslcommerz-js`, `sslcommerz-nodesdk` all published from a single codebase, so you can use any of this 3 package
|
|
19
|
+
|
|
12
20
|
# Installation
|
|
13
21
|
```javascript
|
|
14
22
|
npm i @siamf/sslcommerz
|
|
@@ -17,8 +25,10 @@ yarn add @siamf/sslcommerz
|
|
|
17
25
|
```
|
|
18
26
|
|
|
19
27
|
# Usage
|
|
28
|
+
|
|
29
|
+
### Initialize Package
|
|
20
30
|
```javascript
|
|
21
|
-
import { SslCommerz } from "
|
|
31
|
+
import { SslCommerz } from "@siamf/sslcommerz";
|
|
22
32
|
|
|
23
33
|
const store_id = "<store_id>"
|
|
24
34
|
const store_passwd = "<store_password>"
|
|
@@ -26,6 +36,7 @@ const is_live = false;
|
|
|
26
36
|
export const sslcz = new SslCommerz(store_id, store_passwd, is_live);
|
|
27
37
|
```
|
|
28
38
|
|
|
39
|
+
### Init the payment
|
|
29
40
|
```javascript
|
|
30
41
|
const data = {
|
|
31
42
|
total_amount: 100,
|
|
@@ -66,6 +77,7 @@ const data = {
|
|
|
66
77
|
const sslResponse = await sslcz.init(data);
|
|
67
78
|
```
|
|
68
79
|
|
|
80
|
+
### Validate the payment
|
|
69
81
|
```javascript
|
|
70
82
|
const data = {
|
|
71
83
|
val_id:ADGAHHGDAKJ456454 //that you go from sslcommerz response
|
|
@@ -74,6 +86,7 @@ const data = {
|
|
|
74
86
|
const sslResponse = await sslcz.validate(data)
|
|
75
87
|
```
|
|
76
88
|
|
|
89
|
+
### Initiate Refund
|
|
77
90
|
```javascript
|
|
78
91
|
const data = {
|
|
79
92
|
refund_amount:10,
|
|
@@ -85,6 +98,7 @@ const data = {
|
|
|
85
98
|
const sslResponse = await sslcz.initiateRefund(data)
|
|
86
99
|
```
|
|
87
100
|
|
|
101
|
+
### Query the refund
|
|
88
102
|
```javascript
|
|
89
103
|
const data = {
|
|
90
104
|
refund_ref_id: "SL4561445410"
|
|
@@ -93,6 +107,7 @@ const data = {
|
|
|
93
107
|
const sslResponse = await sslcz.refundQuery(data)
|
|
94
108
|
```
|
|
95
109
|
|
|
110
|
+
### Query transaction by session ID
|
|
96
111
|
```javascript
|
|
97
112
|
const data = {
|
|
98
113
|
sessionkey: "AKHLAKJS5456454"
|
|
@@ -101,6 +116,7 @@ const data = {
|
|
|
101
116
|
const sslResponse = await sslcz.transactionQueryBySessionId(data);
|
|
102
117
|
```
|
|
103
118
|
|
|
119
|
+
### Query transaction by transaction ID
|
|
104
120
|
```javascript
|
|
105
121
|
const data = {
|
|
106
122
|
tran_id: "AKHLAKJS5456454"
|
|
@@ -109,8 +125,15 @@ const data = {
|
|
|
109
125
|
const sslResponse = await sslcz.transactionQueryByTransactionId(data);
|
|
110
126
|
```
|
|
111
127
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
128
|
+
### Suggestions, improvements, and pull requests are always welcome.
|
|
129
|
+
|
|
130
|
+
## Connect with me
|
|
131
|
+
<div style="display: flex; align-items: center; gap: 3px;">
|
|
132
|
+
<a href="https://wa.me/8801611994403"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/whatsapp.png" width="40" height="40"></a>
|
|
133
|
+
<a href="https://siamahnaf.com/" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/web.png" width="40" height="40"></a>
|
|
134
|
+
<a href="https://www.linkedin.com/in/siamahnaf/" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/linkedin.png" width="40" height="40"></a>
|
|
135
|
+
<a href="https://x.com/siamahnaf198" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/x.png" width="40" height="40"></a>
|
|
136
|
+
<a href="https://www.facebook.com/siamahnaf198/" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/facebook.png" width="40" height="40"></a>
|
|
137
|
+
<a href="https://t.me/siamahnaf198" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/telegram.png" width="40" height="40"></a>
|
|
138
|
+
<a href="https://www.npmjs.com/~siamahnaf" style="margin-right: 8px"><img src="https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/npm.png" width="40" height="40"></a>
|
|
139
|
+
</div>
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.httpCall = void 0;
|
|
13
13
|
const httpCall = (_a) => __awaiter(void 0, [_a], void 0, function* ({ url, method = "POST", data, }) {
|
|
14
14
|
const isBodyMethod = ["POST", "PUT", "PATCH"].includes(method);
|
|
15
|
-
console.log(data);
|
|
16
15
|
const response = yield fetch(url, Object.assign({ method, mode: "cors", cache: "no-cache", credentials: "same-origin", redirect: "follow" }, (isBodyMethod ? { body: data } : {})));
|
|
17
16
|
if (!response.ok) {
|
|
18
17
|
const errorBody = yield response.text().catch(() => "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpCall.js","sourceRoot":"","sources":["../../../src/helpers/httpCall.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAO,MAAM,QAAQ,GAAG,KAAsI,EAAE,4CAAxH,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAA4E;IAC5I,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/D,
|
|
1
|
+
{"version":3,"file":"httpCall.js","sourceRoot":"","sources":["../../../src/helpers/httpCall.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAO,MAAM,QAAQ,GAAG,KAAsI,EAAE,4CAAxH,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAA4E;IAC5I,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,kBAC5B,MAAM,EACN,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,aAAa,EAC1B,QAAQ,EAAE,QAAQ,IACf,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACzC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,eAAe,QAAQ,CAAC,MAAM,MAAM,SAAS,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,EAAgB,CAAC;AACzC,CAAC,CAAA,CAAC;AAjBW,QAAA,QAAQ,YAiBnB"}
|
|
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
export const httpCall = (_a) => __awaiter(void 0, [_a], void 0, function* ({ url, method = "POST", data, }) {
|
|
11
11
|
const isBodyMethod = ["POST", "PUT", "PATCH"].includes(method);
|
|
12
|
-
console.log(data);
|
|
13
12
|
const response = yield fetch(url, Object.assign({ method, mode: "cors", cache: "no-cache", credentials: "same-origin", redirect: "follow" }, (isBodyMethod ? { body: data } : {})));
|
|
14
13
|
if (!response.ok) {
|
|
15
14
|
const errorBody = yield response.text().catch(() => "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpCall.js","sourceRoot":"","sources":["../../../src/helpers/httpCall.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAsI,EAAE,4CAAxH,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAA4E;IAC5I,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/D,
|
|
1
|
+
{"version":3,"file":"httpCall.js","sourceRoot":"","sources":["../../../src/helpers/httpCall.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAsI,EAAE,4CAAxH,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAA4E;IAC5I,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,kBAC5B,MAAM,EACN,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,aAAa,EAC1B,QAAQ,EAAE,QAAQ,IACf,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EACzC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,eAAe,QAAQ,CAAC,MAAM,MAAM,SAAS,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,EAAgB,CAAC;AACzC,CAAC,CAAA,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sslcommerz-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "A well-maintained, unofficial Node.js package for integrating SSLCommerz payments. Provides reliable support for initiating and handling transactions with minimal setup.",
|
|
5
5
|
"homepage": "https://github.com/siamahnaf/sslcommerz",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^24.0.15",
|
|
34
|
+
"rimraf": "^6.1.2",
|
|
34
35
|
"typescript": "^5.8.3"
|
|
35
36
|
}
|
|
36
37
|
}
|