Skip to content

Commit 0ee2b29

Browse files
committed
Updated the parameter in the momo schema.
1 parent c5f585c commit 0ee2b29

File tree

4 files changed

+13
-26
lines changed

4 files changed

+13
-26
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# Changelog
2+
## 1.1.14 | 2024-12-13
3+
Updated the `voucher` parameter in the momo schema.
4+
5+
### Version Changes
6+
- [FIXED] Update the `voucher` parameter in the momo schema to be an optional parameter.
7+
28
## 1.1.13 | 2024-11-19
39
Updated the `getBalanceByCurrency` method to parse path parameters.
410

documentation/collections.md

-6
Original file line numberDiff line numberDiff line change
@@ -594,17 +594,11 @@ const Gh_mobilemoney = async () =>{
594594
"tx_ref": "test789",
595595
"amount": "150",
596596
"currency": "GHS",
597-
"voucher": "143256743",
598597
"network": "VODAFONE",
599598
"email": "[email protected]",
600599
"phone_number": "054709929220",
601600
"fullname": "Yolande Aglaé Colbert",
602-
"client_ip": "154.123.220.1",
603601
"device_fingerprint": "62wd23423rq324323qew1",
604-
"meta": {
605-
"flightID": "213213AS",
606-
"anotherBanger": "Rema or Spyce :)"
607-
}
608602
}
609603

610604
const response = await flw.MobileMoney.ghana(payload)

services/schema/create.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,7 @@ const momoSchema = joi.object({
367367
})
368368
})
369369
}),
370-
voucher: joi.when('network', {
371-
is: 'VODAFONE',
372-
then: joi.number().required(),
373-
otherwise: joi.optional(),
374-
}),
370+
voucher: joi.number().optional(),
375371
country: joi.when('currency', {
376372
is: joi.valid('XAF', 'XOF'),
377373
then: joi.string().uppercase().length(2).default('CM').required(),

test/rave.momo.test.js

+6-15
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,15 @@ describe('#Rave Mobile Money', function () {
4949
});
5050

5151
var payload = {
52-
tx_ref: 'test789',
53-
amount: '150',
54-
currency: 'GHS',
55-
voucher: '143256743',
56-
network: 'VODAFONE',
57-
5852
phone_number: '054709929220',
59-
fullname: 'Yolande Aglaé Colbert',
60-
client_ip: '154.123.220.1',
61-
device_fingerprint: '62wd23423rq324323qew1',
62-
meta: {
63-
flightID: '213213AS',
64-
anotherBanger: 'Rema or Spyce :)',
65-
},
66-
};
53+
amount: 1500,
54+
currency: 'GHS',
55+
network: "VODAFONE",
56+
57+
tx_ref: "HGHYGIHIKU",
58+
};
6759

6860
var resp = await momoInstance.ghana(payload);
69-
// console.log(resp);
7061

7162
expect(createGHSMoMo).to.have.been.calledOnce;
7263
expect(createGHSMoMo).to.have.been.calledOnceWith(payload);

0 commit comments

Comments
 (0)