mpesa_connect 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a4a20dc87bdebda47d40c9d6a5b39841c9f585e
4
- data.tar.gz: bed0265698be8b6c7daab87024d942910e5921a7
3
+ metadata.gz: b85c5b30cce8857a2c1f51f3d8e786eca50ff72c
4
+ data.tar.gz: 5907659d3a32961c0c0a206cd7fdbc8b0ad9a63d
5
5
  SHA512:
6
- metadata.gz: 6e2bb0c34147dad9123649f220b97d6db15df974cee8bfed09bf651c87d60d66660636b83615ce3632bb2248add3cb0989839cf52b0ede3c10f6129b110a1661
7
- data.tar.gz: 28942b47292806c5736ec2617370e7f568d13b2eba03cd7593c84a653a50e2ee9980927b8289896a7bc165086ac1ac2f1ce7054d23a6a621d9f0b65abd5d57d9
6
+ metadata.gz: 34473a9542d59a2c51547ed044ec13da924e652bf8527c7e41082676f4fd5c18e5764d633b00ce362a569ac90b96fa4ed70462c66ddf85d2aac524da39cd2a11
7
+ data.tar.gz: 588c4168a76d7dface6f92d885929f074a123f93a59410d1d6e0bbc4cb12b31dd0798bdd18a4830e3b1648fada03ce92e02b031d91daf358731959c791617ce8
data/README.md CHANGED
@@ -76,6 +76,33 @@ Salary Payment
76
76
  client.b2c_transaction(initiator, amount, party_a, party_b)
77
77
  ```
78
78
 
79
+ ### C2B Transaction
80
+
81
+ first you need to setup the following
82
+
83
+ - `ConfirmationURL` : Validation URL for the client
84
+ - `ValidationURL` : Confirmation URL for the client
85
+ - `ResponseType` : Cancelled | Completed
86
+ - `ShortCode` : The short code of the organization.
87
+
88
+
89
+ setup the required urls
90
+ ```ruby
91
+ client.set_urls(nil, nil, confirmation_url, validation_url)
92
+ ```
93
+
94
+ Register URL
95
+
96
+ ```ruby
97
+ client.c2b_register_url(shortcode, response_type)
98
+ ```
99
+
100
+ Simulate Transaction
101
+
102
+ ```ruby
103
+ client.c2b_transaction(shortcode, amount, msisdn, bill_reference)
104
+ ```
105
+
79
106
  ## Development
80
107
 
81
108
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,3 +1,3 @@
1
1
  module MpesaConnect
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mpesa_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mboya
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-20 00:00:00.000000000 Z
11
+ date: 2017-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -176,7 +176,6 @@ files:
176
176
  - lib/mpesa_connect/access_token.rb
177
177
  - lib/mpesa_connect/security_credentials.rb
178
178
  - lib/mpesa_connect/version.rb
179
- - lib/security_credentials.rb
180
179
  - mpesa_connect.gemspec
181
180
  homepage: https://mboya.github.io/mpesa_connect/
182
181
  licenses:
@@ -1,22 +0,0 @@
1
- require 'pry'
2
- require 'pry-nav'
3
- require 'openssl'
4
-
5
- module MpesaConnect
6
- class SecurityCredentials
7
-
8
- def initialize security_cred
9
- @security_cred = security_cred
10
- end
11
-
12
- def encrypt_security_cred
13
- byte_array = @security_cred.bytes.to_a.to_s
14
- key_file = "lib/pubkey.pem"
15
- public_key = File.read(key_file)
16
- ssl = OpenSSL::PKey::RSA.new(public_key)
17
-
18
- encrypted_string = Base64.encode64(ssl.public_encrypt(byte_array)).split("\n").join
19
- end
20
-
21
- end
22
- end