mpesa_stk 1.3 → 2.0.0
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/.github/workflows/codeql-analysis.yml +70 -0
- data/.github/workflows/cop.yml +18 -14
- data/.rubocop.yml +62 -0
- data/.sample.env +22 -1
- data/CHANGELOG.md +244 -0
- data/Gemfile +4 -2
- data/Gemfile.lock +81 -42
- data/README.md +986 -63
- data/Rakefile +8 -6
- data/SECURITY.md +21 -0
- data/bin/console +4 -3
- data/lib/mpesa_stk/access_token.rb +53 -21
- data/lib/mpesa_stk/account_balance.rb +142 -0
- data/lib/mpesa_stk/b2b.rb +153 -0
- data/lib/mpesa_stk/b2c.rb +151 -0
- data/lib/mpesa_stk/c2b.rb +127 -0
- data/lib/mpesa_stk/imsi.rb +70 -0
- data/lib/mpesa_stk/iot.rb +206 -0
- data/lib/mpesa_stk/pull_transactions.rb +126 -0
- data/lib/mpesa_stk/push.rb +70 -41
- data/lib/mpesa_stk/push_payment.rb +44 -16
- data/lib/mpesa_stk/ratiba.rb +118 -0
- data/lib/mpesa_stk/reversal.rb +147 -0
- data/lib/mpesa_stk/stk_push_query.rb +109 -0
- data/lib/mpesa_stk/transaction_status.rb +145 -0
- data/lib/mpesa_stk/version.rb +25 -1
- data/lib/mpesa_stk.rb +37 -1
- data/mpesa_stk.gemspec +33 -21
- metadata +110 -44
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2018 mboya
|
|
4
|
+
#
|
|
5
|
+
# MIT License
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
# furnished to do so, subject to the following conditions:
|
|
13
|
+
#
|
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
|
15
|
+
# all copies or substantial portions of the Software.
|
|
16
|
+
#
|
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
# THE SOFTWARE.
|
|
24
|
+
|
|
25
|
+
require 'mpesa_stk/access_token'
|
|
26
|
+
|
|
27
|
+
module MpesaStk
|
|
28
|
+
# Query the status of any M-Pesa transaction
|
|
29
|
+
class TransactionStatus
|
|
30
|
+
class << self
|
|
31
|
+
def query(transaction_id, hash = {})
|
|
32
|
+
new(transaction_id, hash).query_status
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
attr_reader :token, :transaction_id, :initiator, :security_credential, :party_a, :result_url, :queue_timeout_url,
|
|
37
|
+
:identifier_type
|
|
38
|
+
|
|
39
|
+
def initialize(transaction_id, hash = {})
|
|
40
|
+
@token = MpesaStk::AccessToken.call(hash['key'], hash['secret'])
|
|
41
|
+
@transaction_id = transaction_id
|
|
42
|
+
@initiator = hash['initiator'] || ENV.fetch('initiator', nil)
|
|
43
|
+
@security_credential = hash['security_credential'] || ENV.fetch('security_credential', nil)
|
|
44
|
+
@party_a = hash['party_a'] || ENV.fetch('business_short_code', nil)
|
|
45
|
+
@result_url = hash['result_url'] || ENV.fetch('result_url', nil)
|
|
46
|
+
@queue_timeout_url = hash['queue_timeout_url'] || ENV.fetch('queue_timeout_url', nil)
|
|
47
|
+
@identifier_type = hash['identifier_type'] || '4'
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def query_status
|
|
51
|
+
response = HTTParty.post(url, headers: headers, body: body)
|
|
52
|
+
|
|
53
|
+
raise StandardError, "Failed to query transaction status: #{response.code} - #{response.body}" unless response.success?
|
|
54
|
+
|
|
55
|
+
JSON.parse(response.body)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
private
|
|
59
|
+
|
|
60
|
+
def url
|
|
61
|
+
"#{ENV.fetch('base_url', nil)}#{ENV.fetch('transaction_status_url', nil)}"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def headers
|
|
65
|
+
{
|
|
66
|
+
'Authorization' => "Bearer #{token}",
|
|
67
|
+
'Content-Type' => 'application/json'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def body
|
|
72
|
+
{
|
|
73
|
+
Initiator: get_initiator,
|
|
74
|
+
SecurityCredential: get_security_credential,
|
|
75
|
+
CommandID: 'TransactionStatusQuery',
|
|
76
|
+
TransactionID: transaction_id,
|
|
77
|
+
PartyA: get_party_a,
|
|
78
|
+
IdentifierType: identifier_type,
|
|
79
|
+
ResultURL: get_result_url,
|
|
80
|
+
QueueTimeOutURL: get_queue_timeout_url
|
|
81
|
+
}.to_json
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def get_initiator
|
|
85
|
+
if initiator.nil? || initiator.eql?('')
|
|
86
|
+
raise ArgumentError, 'Initiator is not defined' if ENV['initiator'].nil? || ENV['initiator'].eql?('')
|
|
87
|
+
|
|
88
|
+
ENV.fetch('initiator', nil)
|
|
89
|
+
|
|
90
|
+
else
|
|
91
|
+
initiator
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def get_security_credential
|
|
96
|
+
if security_credential.nil? || security_credential.eql?('')
|
|
97
|
+
if ENV['security_credential'].nil? || ENV['security_credential'].eql?('')
|
|
98
|
+
raise ArgumentError, 'Security Credential is not defined'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
ENV.fetch('security_credential', nil)
|
|
102
|
+
|
|
103
|
+
else
|
|
104
|
+
security_credential
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def get_party_a
|
|
109
|
+
if party_a.nil? || party_a.eql?('')
|
|
110
|
+
if ENV['business_short_code'].nil? || ENV['business_short_code'].eql?('')
|
|
111
|
+
raise ArgumentError, 'PartyA (Business Short Code) is not defined'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
ENV.fetch('business_short_code', nil)
|
|
115
|
+
|
|
116
|
+
else
|
|
117
|
+
party_a
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def get_result_url
|
|
122
|
+
if result_url.nil? || result_url.eql?('')
|
|
123
|
+
raise ArgumentError, 'Result URL is not defined' if ENV['result_url'].nil? || ENV['result_url'].eql?('')
|
|
124
|
+
|
|
125
|
+
ENV.fetch('result_url', nil)
|
|
126
|
+
|
|
127
|
+
else
|
|
128
|
+
result_url
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def get_queue_timeout_url
|
|
133
|
+
if queue_timeout_url.nil? || queue_timeout_url.eql?('')
|
|
134
|
+
if ENV['queue_timeout_url'].nil? || ENV['queue_timeout_url'].eql?('')
|
|
135
|
+
raise ArgumentError, 'Queue Timeout URL is not defined'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
ENV.fetch('queue_timeout_url', nil)
|
|
139
|
+
|
|
140
|
+
else
|
|
141
|
+
queue_timeout_url
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
data/lib/mpesa_stk/version.rb
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2018 mboya
|
|
4
|
+
#
|
|
5
|
+
# MIT License
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
# furnished to do so, subject to the following conditions:
|
|
13
|
+
#
|
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
|
15
|
+
# all copies or substantial portions of the Software.
|
|
16
|
+
#
|
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
# THE SOFTWARE.
|
|
24
|
+
|
|
1
25
|
module MpesaStk
|
|
2
|
-
VERSION =
|
|
26
|
+
VERSION = '2.0.0'
|
|
3
27
|
end
|
data/lib/mpesa_stk.rb
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2018 mboya
|
|
4
|
+
#
|
|
5
|
+
# MIT License
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
# furnished to do so, subject to the following conditions:
|
|
13
|
+
#
|
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
|
15
|
+
# all copies or substantial portions of the Software.
|
|
16
|
+
#
|
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
# THE SOFTWARE.
|
|
24
|
+
|
|
25
|
+
require 'mpesa_stk/version'
|
|
2
26
|
require 'mpesa_stk/push_payment'
|
|
3
27
|
require 'mpesa_stk/push'
|
|
28
|
+
require 'mpesa_stk/transaction_status'
|
|
29
|
+
require 'mpesa_stk/stk_push_query'
|
|
30
|
+
require 'mpesa_stk/b2c'
|
|
31
|
+
require 'mpesa_stk/b2b'
|
|
32
|
+
require 'mpesa_stk/c2b'
|
|
33
|
+
require 'mpesa_stk/account_balance'
|
|
34
|
+
require 'mpesa_stk/reversal'
|
|
35
|
+
require 'mpesa_stk/ratiba'
|
|
36
|
+
require 'mpesa_stk/iot'
|
|
37
|
+
require 'mpesa_stk/imsi'
|
|
38
|
+
require 'mpesa_stk/pull_transactions'
|
|
4
39
|
require 'dotenv/load'
|
|
5
40
|
require 'httparty'
|
|
41
|
+
require 'securerandom'
|
data/mpesa_stk.gemspec
CHANGED
|
@@ -1,36 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
|
|
2
|
-
lib = File.expand_path(
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require
|
|
5
|
+
require 'mpesa_stk/version'
|
|
5
6
|
|
|
6
7
|
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name =
|
|
8
|
+
spec.name = 'mpesa_stk'
|
|
8
9
|
spec.version = MpesaStk::VERSION
|
|
9
|
-
spec.authors = [
|
|
10
|
-
spec.email = [
|
|
10
|
+
spec.authors = %w[mboya cess]
|
|
11
|
+
spec.email = ['mboyaberry@gmail.com', 'cessmbuguar@gmail.com']
|
|
11
12
|
|
|
12
|
-
spec.summary =
|
|
13
|
-
spec.description =
|
|
14
|
-
spec.homepage =
|
|
15
|
-
spec.license =
|
|
13
|
+
spec.summary = 'Lipa na M-Pesa Online Payment.'
|
|
14
|
+
spec.description = 'initiate a M-Pesa transaction on behalf of a customer using STK Push.'
|
|
15
|
+
spec.homepage = 'https://github.com/mboya/mpesa_stk'
|
|
16
|
+
spec.license = 'MIT'
|
|
16
17
|
|
|
17
|
-
spec.
|
|
18
|
+
spec.required_ruby_version = '>= 2.6.0'
|
|
19
|
+
|
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
18
21
|
f.match(%r{^(test|spec|features)/})
|
|
19
22
|
end
|
|
20
|
-
spec.bindir =
|
|
23
|
+
spec.bindir = 'exe'
|
|
21
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
|
-
spec.require_paths = [
|
|
25
|
+
spec.require_paths = ['lib']
|
|
23
26
|
|
|
24
|
-
spec.
|
|
25
|
-
spec.
|
|
27
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
28
|
+
spec.metadata['source_code_uri'] = "#{spec.homepage}.git"
|
|
29
|
+
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
|
30
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
31
|
+
|
|
32
|
+
spec.add_dependency 'base64', '>= 0.1.0'
|
|
33
|
+
spec.add_dependency 'csv', '>= 3.0.0'
|
|
34
|
+
spec.add_dependency 'httparty', '>= 0.15.6', '< 0.22.0'
|
|
35
|
+
spec.add_dependency 'redis', '>= 4.0'
|
|
26
36
|
spec.add_dependency 'redis-namespace', '~> 1.5', '>= 1.5.3'
|
|
37
|
+
spec.add_dependency 'redis-rack', '~> 2.0', '>= 2.0.2'
|
|
27
38
|
|
|
28
|
-
spec.add_development_dependency
|
|
29
|
-
spec.add_development_dependency
|
|
30
|
-
spec.add_development_dependency
|
|
39
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
40
|
+
spec.add_development_dependency 'minitest', '~> 5.20'
|
|
41
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
|
31
42
|
|
|
32
|
-
spec.add_development_dependency '
|
|
33
|
-
spec.add_development_dependency 'pry
|
|
34
|
-
spec.add_development_dependency '
|
|
35
|
-
spec.add_development_dependency
|
|
43
|
+
spec.add_development_dependency 'dotenv', '~> 2.8'
|
|
44
|
+
spec.add_development_dependency 'pry', '~> 0.12'
|
|
45
|
+
spec.add_development_dependency 'pry-nav', '~> 0.3'
|
|
46
|
+
spec.add_development_dependency 'rubocop', '~> 1.0'
|
|
47
|
+
spec.add_development_dependency 'webmock', '~> 3.18'
|
|
36
48
|
end
|
metadata
CHANGED
|
@@ -1,16 +1,43 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mpesa_stk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mboya
|
|
8
8
|
- cess
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: exe
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: base64
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.1.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 0.1.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: csv
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 3.0.0
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 3.0.0
|
|
14
41
|
- !ruby/object:Gem::Dependency
|
|
15
42
|
name: httparty
|
|
16
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -20,7 +47,7 @@ dependencies:
|
|
|
20
47
|
version: 0.15.6
|
|
21
48
|
- - "<"
|
|
22
49
|
- !ruby/object:Gem::Version
|
|
23
|
-
version: 0.
|
|
50
|
+
version: 0.22.0
|
|
24
51
|
type: :runtime
|
|
25
52
|
prerelease: false
|
|
26
53
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -30,27 +57,21 @@ dependencies:
|
|
|
30
57
|
version: 0.15.6
|
|
31
58
|
- - "<"
|
|
32
59
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 0.
|
|
60
|
+
version: 0.22.0
|
|
34
61
|
- !ruby/object:Gem::Dependency
|
|
35
|
-
name: redis
|
|
62
|
+
name: redis
|
|
36
63
|
requirement: !ruby/object:Gem::Requirement
|
|
37
64
|
requirements:
|
|
38
|
-
- - "~>"
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '2.0'
|
|
41
65
|
- - ">="
|
|
42
66
|
- !ruby/object:Gem::Version
|
|
43
|
-
version:
|
|
67
|
+
version: '4.0'
|
|
44
68
|
type: :runtime
|
|
45
69
|
prerelease: false
|
|
46
70
|
version_requirements: !ruby/object:Gem::Requirement
|
|
47
71
|
requirements:
|
|
48
|
-
- - "~>"
|
|
49
|
-
- !ruby/object:Gem::Version
|
|
50
|
-
version: '2.0'
|
|
51
72
|
- - ">="
|
|
52
73
|
- !ruby/object:Gem::Version
|
|
53
|
-
version:
|
|
74
|
+
version: '4.0'
|
|
54
75
|
- !ruby/object:Gem::Dependency
|
|
55
76
|
name: redis-namespace
|
|
56
77
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -72,19 +93,53 @@ dependencies:
|
|
|
72
93
|
- !ruby/object:Gem::Version
|
|
73
94
|
version: 1.5.3
|
|
74
95
|
- !ruby/object:Gem::Dependency
|
|
75
|
-
name:
|
|
96
|
+
name: redis-rack
|
|
76
97
|
requirement: !ruby/object:Gem::Requirement
|
|
77
98
|
requirements:
|
|
99
|
+
- - "~>"
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: '2.0'
|
|
78
102
|
- - ">="
|
|
79
103
|
- !ruby/object:Gem::Version
|
|
80
|
-
version:
|
|
81
|
-
type: :
|
|
104
|
+
version: 2.0.2
|
|
105
|
+
type: :runtime
|
|
82
106
|
prerelease: false
|
|
83
107
|
version_requirements: !ruby/object:Gem::Requirement
|
|
84
108
|
requirements:
|
|
109
|
+
- - "~>"
|
|
110
|
+
- !ruby/object:Gem::Version
|
|
111
|
+
version: '2.0'
|
|
85
112
|
- - ">="
|
|
86
113
|
- !ruby/object:Gem::Version
|
|
87
|
-
version:
|
|
114
|
+
version: 2.0.2
|
|
115
|
+
- !ruby/object:Gem::Dependency
|
|
116
|
+
name: bundler
|
|
117
|
+
requirement: !ruby/object:Gem::Requirement
|
|
118
|
+
requirements:
|
|
119
|
+
- - "~>"
|
|
120
|
+
- !ruby/object:Gem::Version
|
|
121
|
+
version: '2.0'
|
|
122
|
+
type: :development
|
|
123
|
+
prerelease: false
|
|
124
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
125
|
+
requirements:
|
|
126
|
+
- - "~>"
|
|
127
|
+
- !ruby/object:Gem::Version
|
|
128
|
+
version: '2.0'
|
|
129
|
+
- !ruby/object:Gem::Dependency
|
|
130
|
+
name: minitest
|
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
|
132
|
+
requirements:
|
|
133
|
+
- - "~>"
|
|
134
|
+
- !ruby/object:Gem::Version
|
|
135
|
+
version: '5.20'
|
|
136
|
+
type: :development
|
|
137
|
+
prerelease: false
|
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
139
|
+
requirements:
|
|
140
|
+
- - "~>"
|
|
141
|
+
- !ruby/object:Gem::Version
|
|
142
|
+
version: '5.20'
|
|
88
143
|
- !ruby/object:Gem::Dependency
|
|
89
144
|
name: rake
|
|
90
145
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -100,81 +155,75 @@ dependencies:
|
|
|
100
155
|
- !ruby/object:Gem::Version
|
|
101
156
|
version: 12.3.3
|
|
102
157
|
- !ruby/object:Gem::Dependency
|
|
103
|
-
name:
|
|
158
|
+
name: dotenv
|
|
104
159
|
requirement: !ruby/object:Gem::Requirement
|
|
105
160
|
requirements:
|
|
106
161
|
- - "~>"
|
|
107
162
|
- !ruby/object:Gem::Version
|
|
108
|
-
version: '
|
|
163
|
+
version: '2.8'
|
|
109
164
|
type: :development
|
|
110
165
|
prerelease: false
|
|
111
166
|
version_requirements: !ruby/object:Gem::Requirement
|
|
112
167
|
requirements:
|
|
113
168
|
- - "~>"
|
|
114
169
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '
|
|
170
|
+
version: '2.8'
|
|
116
171
|
- !ruby/object:Gem::Dependency
|
|
117
172
|
name: pry
|
|
118
173
|
requirement: !ruby/object:Gem::Requirement
|
|
119
174
|
requirements:
|
|
120
175
|
- - "~>"
|
|
121
176
|
- !ruby/object:Gem::Version
|
|
122
|
-
version: 0.
|
|
177
|
+
version: '0.12'
|
|
123
178
|
type: :development
|
|
124
179
|
prerelease: false
|
|
125
180
|
version_requirements: !ruby/object:Gem::Requirement
|
|
126
181
|
requirements:
|
|
127
182
|
- - "~>"
|
|
128
183
|
- !ruby/object:Gem::Version
|
|
129
|
-
version: 0.
|
|
184
|
+
version: '0.12'
|
|
130
185
|
- !ruby/object:Gem::Dependency
|
|
131
186
|
name: pry-nav
|
|
132
187
|
requirement: !ruby/object:Gem::Requirement
|
|
133
188
|
requirements:
|
|
134
189
|
- - "~>"
|
|
135
190
|
- !ruby/object:Gem::Version
|
|
136
|
-
version: 0.
|
|
191
|
+
version: '0.3'
|
|
137
192
|
type: :development
|
|
138
193
|
prerelease: false
|
|
139
194
|
version_requirements: !ruby/object:Gem::Requirement
|
|
140
195
|
requirements:
|
|
141
196
|
- - "~>"
|
|
142
197
|
- !ruby/object:Gem::Version
|
|
143
|
-
version: 0.
|
|
198
|
+
version: '0.3'
|
|
144
199
|
- !ruby/object:Gem::Dependency
|
|
145
|
-
name:
|
|
200
|
+
name: rubocop
|
|
146
201
|
requirement: !ruby/object:Gem::Requirement
|
|
147
202
|
requirements:
|
|
148
203
|
- - "~>"
|
|
149
204
|
- !ruby/object:Gem::Version
|
|
150
|
-
version: '
|
|
151
|
-
- - ">="
|
|
152
|
-
- !ruby/object:Gem::Version
|
|
153
|
-
version: 3.0.1
|
|
205
|
+
version: '1.0'
|
|
154
206
|
type: :development
|
|
155
207
|
prerelease: false
|
|
156
208
|
version_requirements: !ruby/object:Gem::Requirement
|
|
157
209
|
requirements:
|
|
158
210
|
- - "~>"
|
|
159
211
|
- !ruby/object:Gem::Version
|
|
160
|
-
version: '
|
|
161
|
-
- - ">="
|
|
162
|
-
- !ruby/object:Gem::Version
|
|
163
|
-
version: 3.0.1
|
|
212
|
+
version: '1.0'
|
|
164
213
|
- !ruby/object:Gem::Dependency
|
|
165
|
-
name:
|
|
214
|
+
name: webmock
|
|
166
215
|
requirement: !ruby/object:Gem::Requirement
|
|
167
216
|
requirements:
|
|
168
|
-
- -
|
|
217
|
+
- - "~>"
|
|
169
218
|
- !ruby/object:Gem::Version
|
|
170
|
-
version:
|
|
219
|
+
version: '3.18'
|
|
171
220
|
type: :development
|
|
172
221
|
prerelease: false
|
|
173
222
|
version_requirements: !ruby/object:Gem::Requirement
|
|
174
223
|
requirements:
|
|
175
|
-
- -
|
|
224
|
+
- - "~>"
|
|
176
225
|
- !ruby/object:Gem::Version
|
|
177
|
-
version:
|
|
226
|
+
version: '3.18'
|
|
178
227
|
description: initiate a M-Pesa transaction on behalf of a customer using STK Push.
|
|
179
228
|
email:
|
|
180
229
|
- mboyaberry@gmail.com
|
|
@@ -183,29 +232,47 @@ executables: []
|
|
|
183
232
|
extensions: []
|
|
184
233
|
extra_rdoc_files: []
|
|
185
234
|
files:
|
|
235
|
+
- ".github/workflows/codeql-analysis.yml"
|
|
186
236
|
- ".github/workflows/cop.yml"
|
|
187
237
|
- ".gitignore"
|
|
238
|
+
- ".rubocop.yml"
|
|
188
239
|
- ".sample.env"
|
|
240
|
+
- CHANGELOG.md
|
|
189
241
|
- CODE_OF_CONDUCT.md
|
|
190
242
|
- Gemfile
|
|
191
243
|
- Gemfile.lock
|
|
192
244
|
- LICENSE.txt
|
|
193
245
|
- README.md
|
|
194
246
|
- Rakefile
|
|
247
|
+
- SECURITY.md
|
|
195
248
|
- bin/console
|
|
196
249
|
- bin/index.jpeg
|
|
197
250
|
- bin/setup
|
|
198
251
|
- lib/mpesa_stk.rb
|
|
199
252
|
- lib/mpesa_stk/access_token.rb
|
|
253
|
+
- lib/mpesa_stk/account_balance.rb
|
|
254
|
+
- lib/mpesa_stk/b2b.rb
|
|
255
|
+
- lib/mpesa_stk/b2c.rb
|
|
256
|
+
- lib/mpesa_stk/c2b.rb
|
|
257
|
+
- lib/mpesa_stk/imsi.rb
|
|
258
|
+
- lib/mpesa_stk/iot.rb
|
|
259
|
+
- lib/mpesa_stk/pull_transactions.rb
|
|
200
260
|
- lib/mpesa_stk/push.rb
|
|
201
261
|
- lib/mpesa_stk/push_payment.rb
|
|
262
|
+
- lib/mpesa_stk/ratiba.rb
|
|
263
|
+
- lib/mpesa_stk/reversal.rb
|
|
264
|
+
- lib/mpesa_stk/stk_push_query.rb
|
|
265
|
+
- lib/mpesa_stk/transaction_status.rb
|
|
202
266
|
- lib/mpesa_stk/version.rb
|
|
203
267
|
- mpesa_stk.gemspec
|
|
204
268
|
homepage: https://github.com/mboya/mpesa_stk
|
|
205
269
|
licenses:
|
|
206
270
|
- MIT
|
|
207
|
-
metadata:
|
|
208
|
-
|
|
271
|
+
metadata:
|
|
272
|
+
homepage_uri: https://github.com/mboya/mpesa_stk
|
|
273
|
+
source_code_uri: https://github.com/mboya/mpesa_stk.git
|
|
274
|
+
changelog_uri: https://github.com/mboya/mpesa_stk/blob/master/CHANGELOG.md
|
|
275
|
+
rubygems_mfa_required: 'true'
|
|
209
276
|
rdoc_options: []
|
|
210
277
|
require_paths:
|
|
211
278
|
- lib
|
|
@@ -213,15 +280,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
213
280
|
requirements:
|
|
214
281
|
- - ">="
|
|
215
282
|
- !ruby/object:Gem::Version
|
|
216
|
-
version:
|
|
283
|
+
version: 2.6.0
|
|
217
284
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
285
|
requirements:
|
|
219
286
|
- - ">="
|
|
220
287
|
- !ruby/object:Gem::Version
|
|
221
288
|
version: '0'
|
|
222
289
|
requirements: []
|
|
223
|
-
rubygems_version:
|
|
224
|
-
signing_key:
|
|
290
|
+
rubygems_version: 4.0.1
|
|
225
291
|
specification_version: 4
|
|
226
292
|
summary: Lipa na M-Pesa Online Payment.
|
|
227
293
|
test_files: []
|