mpesarb 0.3.6 → 0.3.7
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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/mpesa/resources/stk.rb +8 -2
- data/lib/mpesa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: abffb99bd570f42920bccfb725ee0c965a6ce04ef8f9b5d513371fd0d4db03b7
|
|
4
|
+
data.tar.gz: 930ebaaba7a3d32e65cfdffa5509dc823772d73d622d5fc365a0f95ffbcbe63d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2f01929e3417f32d6e75d0959a473cb267db89e79e6e25271b29532d7099412630b802ffebb08826cf6fd0e48f414250abbf6cab4456faf33790abc46c36108
|
|
7
|
+
data.tar.gz: 1525344f68ebd3cc74352514f96261cca78d75eaad815a42370adfea3c20c1d0bc02407848e9ad62c891cbb04be0731da99c7dac71b8ae3f630f011e8d7cf9f4
|
data/README.md
CHANGED
|
@@ -66,6 +66,7 @@ Lipa na mpesa online(Stk Push)
|
|
|
66
66
|
```ruby
|
|
67
67
|
response = client.stk(
|
|
68
68
|
shortcode: "174379",
|
|
69
|
+
# till_no: "379174",
|
|
69
70
|
pass_key: "bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919", # Optional if passed in client initialization
|
|
70
71
|
amount: "10",
|
|
71
72
|
phone: "254705112855",
|
|
@@ -77,6 +78,7 @@ response = client.stk(
|
|
|
77
78
|
response.CheckoutRequestID # "ws_CO_040920212326513616"
|
|
78
79
|
response.inspect # to see all available attributes
|
|
79
80
|
```
|
|
81
|
+
If working with a till number, pass it in the `till_no` param. The shortcode should be the HeadOffice(HO)/Store number.
|
|
80
82
|
|
|
81
83
|
### STK Query
|
|
82
84
|
|
data/lib/mpesa/resources/stk.rb
CHANGED
|
@@ -15,14 +15,20 @@ module Mpesa
|
|
|
15
15
|
'BusinessShortCode': shortcode,
|
|
16
16
|
'Password': password,
|
|
17
17
|
'Timestamp': timestamp,
|
|
18
|
-
'TransactionType': 'CustomerPayBillOnline',
|
|
19
18
|
'Amount': args[:amount],
|
|
20
19
|
'PartyA': format_phone(args[:phone]),
|
|
21
|
-
'PartyB': shortcode,
|
|
22
20
|
'PhoneNumber': format_phone(args[:phone]),
|
|
23
21
|
'CallBackURL': args[:callback_url],
|
|
24
22
|
'AccountReference': args[:reference],
|
|
25
23
|
'TransactionDesc': args[:trans_desc]
|
|
24
|
+
}.merge(transaction_details)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def transaction_details
|
|
28
|
+
till_no = args[:till_no] unless args[:till_no].nil? || args[:till_no].strip.empty?
|
|
29
|
+
{
|
|
30
|
+
'TransactionType': till_no.nil? ? 'CustomerPayBillOnline' : 'CustomerBuyGoodsOnline',
|
|
31
|
+
'PartyB': till_no || shortcode
|
|
26
32
|
}
|
|
27
33
|
end
|
|
28
34
|
|
data/lib/mpesa/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mpesarb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Moses Gathuku
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-11-
|
|
10
|
+
date: 2025-11-08 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: bundler
|