@singularity-payments/nuxt 1.2.0 → 1.2.2
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/dist/index.js +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -56,7 +56,7 @@ function createMpesaHandlers(client) {
|
|
|
56
56
|
simulateC2B: (0, import_h3.defineEventHandler)(async (event) => {
|
|
57
57
|
try {
|
|
58
58
|
const body = await (0, import_h3.readBody)(event);
|
|
59
|
-
const { amount, phoneNumber, billRefNumber, commandID } = body;
|
|
59
|
+
const { shortCode, amount, phoneNumber, billRefNumber, commandID } = body;
|
|
60
60
|
if (!amount || !phoneNumber || !billRefNumber) {
|
|
61
61
|
throw (0, import_h3.createError)({
|
|
62
62
|
statusCode: 400,
|
|
@@ -64,6 +64,7 @@ function createMpesaHandlers(client) {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
const response = await client.simulateC2B({
|
|
67
|
+
shortCode: String(shortCode),
|
|
67
68
|
amount: Number(amount),
|
|
68
69
|
phoneNumber: String(phoneNumber),
|
|
69
70
|
billRefNumber: String(billRefNumber),
|
|
@@ -285,7 +286,7 @@ function createMpesaHandlers(client) {
|
|
|
285
286
|
}
|
|
286
287
|
if (lastSegment === "simulate-c2b") {
|
|
287
288
|
const body = await (0, import_h3.readBody)(event);
|
|
288
|
-
const { amount, phoneNumber, billRefNumber, commandID } = body;
|
|
289
|
+
const { shortCode, amount, phoneNumber, billRefNumber, commandID } = body;
|
|
289
290
|
if (!amount || !phoneNumber || !billRefNumber) {
|
|
290
291
|
throw (0, import_h3.createError)({
|
|
291
292
|
statusCode: 400,
|
|
@@ -293,6 +294,7 @@ function createMpesaHandlers(client) {
|
|
|
293
294
|
});
|
|
294
295
|
}
|
|
295
296
|
const response = await client.simulateC2B({
|
|
297
|
+
shortCode: String(shortCode),
|
|
296
298
|
amount: Number(amount),
|
|
297
299
|
phoneNumber: String(phoneNumber),
|
|
298
300
|
billRefNumber,
|
package/dist/index.mjs
CHANGED
|
@@ -36,7 +36,7 @@ function createMpesaHandlers(client) {
|
|
|
36
36
|
simulateC2B: defineEventHandler(async (event) => {
|
|
37
37
|
try {
|
|
38
38
|
const body = await readBody(event);
|
|
39
|
-
const { amount, phoneNumber, billRefNumber, commandID } = body;
|
|
39
|
+
const { shortCode, amount, phoneNumber, billRefNumber, commandID } = body;
|
|
40
40
|
if (!amount || !phoneNumber || !billRefNumber) {
|
|
41
41
|
throw createError({
|
|
42
42
|
statusCode: 400,
|
|
@@ -44,6 +44,7 @@ function createMpesaHandlers(client) {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
const response = await client.simulateC2B({
|
|
47
|
+
shortCode: String(shortCode),
|
|
47
48
|
amount: Number(amount),
|
|
48
49
|
phoneNumber: String(phoneNumber),
|
|
49
50
|
billRefNumber: String(billRefNumber),
|
|
@@ -265,7 +266,7 @@ function createMpesaHandlers(client) {
|
|
|
265
266
|
}
|
|
266
267
|
if (lastSegment === "simulate-c2b") {
|
|
267
268
|
const body = await readBody(event);
|
|
268
|
-
const { amount, phoneNumber, billRefNumber, commandID } = body;
|
|
269
|
+
const { shortCode, amount, phoneNumber, billRefNumber, commandID } = body;
|
|
269
270
|
if (!amount || !phoneNumber || !billRefNumber) {
|
|
270
271
|
throw createError({
|
|
271
272
|
statusCode: 400,
|
|
@@ -273,6 +274,7 @@ function createMpesaHandlers(client) {
|
|
|
273
274
|
});
|
|
274
275
|
}
|
|
275
276
|
const response = await client.simulateC2B({
|
|
277
|
+
shortCode: String(shortCode),
|
|
276
278
|
amount: Number(amount),
|
|
277
279
|
phoneNumber: String(phoneNumber),
|
|
278
280
|
billRefNumber,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@singularity-payments/nuxt",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"directory": "packages/nuxt"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@singularity-payments/core": "1.
|
|
40
|
+
"@singularity-payments/core": "1.3.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^25.0.3",
|