mpower 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +29 -16
  2. data/lib/mpower/version.rb +1 -1
  3. data/mpower.gemspec +5 -4
  4. metadata +13 -11
data/README.md CHANGED
@@ -83,30 +83,43 @@ Params for addItem function `add_item(name_of_item,quantity,unit_price,total_pri
83
83
 
84
84
  ## Redirecting to your checkout invoice page
85
85
 
86
- if co.create
87
- redirect_to co.invoice_url
88
- else
89
- @message = co.response_text
90
- end
86
+ if co.create
87
+ redirect_to co.invoice_url
88
+ else
89
+ @message = co.response_text
90
+ end
91
91
 
92
92
  ## Onsite Payment Request(OPR) Charge
93
93
  First step is to take the customers mpower account alias, this could be the phoneno, username or mpower account number.
94
94
  pass this as a param for the `create` action of the `MPower::Onsite::Invoice` class instance. MPower will return an OPR TOKEN after the request is successfull. The customer will also receieve a confirmation TOKEN.
95
95
 
96
- if co.create("CUSTOMER_MPOWER_USERNAME_OR_PHONE")
97
- @opr_token = co.token
98
- else
99
- @message = co.response_text
100
- end
96
+ if co.create("CUSTOMER_MPOWER_USERNAME_OR_PHONE")
97
+ @opr_token = co.token
98
+ else
99
+ @message = co.response_text
100
+ end
101
101
 
102
102
  Second step requires you to accept the confirmation TOKEN from the customer, add your OPR Token and issue the charge. Upon successfull charge you should be able to access the digital receipt URL and other objects outlined in the offical docs.
103
103
 
104
- if co.charge("OPR_TOKEN","CUSTOMER_CONFIRM_TOKEN")
105
- @receipt = co.receipt_url
106
- @customer_name = co.customer['name']
107
- else
108
- @message = co.response_text
109
- end
104
+ if co.charge("OPR_TOKEN","CUSTOMER_CONFIRM_TOKEN")
105
+ @receipt = co.receipt_url
106
+ @customer_name = co.customer['name']
107
+ else
108
+ @message = co.response_text
109
+ end
110
+
111
+ ## DirectPay Request
112
+ You can pay any MPower account directly via your third party apps. This is particularly excellent for implementing your own Adaptive payment solutions on top of MPower.
113
+
114
+ direct_pay = MPower::DirectPay.new
115
+ if (direct_pay.credit_account("CUSTOMER_MPOWER_USERNAME_OR_PHONE",100))
116
+ puts direct_pay.description
117
+ puts direct_pay.response_text
118
+ puts direct_pay.transaction_id
119
+ else
120
+ puts direct_pay.description
121
+ puts direct_pay.response_text
122
+ end
110
123
 
111
124
  ## Download MPower RubyOnRails Demo
112
125
  https://github.com/nukturnal/MPower_Rails_Demo
@@ -1,3 +1,3 @@
1
1
  module MPower
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
data/mpower.gemspec CHANGED
@@ -6,19 +6,20 @@ require 'mpower/version'
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "mpower"
8
8
  gem.version = MPower::VERSION
9
- gem.authors = ["Alfred Rowe"]
9
+ gem.author = "Alfred Rowe"
10
10
  gem.email = ["alfred@ncodedevlabs.com"]
11
11
  gem.description = %q{Ruby library for integrating with the MPower Gateway}
12
12
  gem.summary = %q{Ruby client bindings for the MPower API}
13
13
  gem.homepage = "http://mpowerpayments.com/developers/docs/ruby.html"
14
+ gem.post_install_message = "Thanks for installing MPower Payments Ruby client.\nYou may read full API docs at http://mpowerpayments.com/developers/docs/ruby.html"
14
15
 
15
16
  gem.files = `git ls-files`.split($/)
16
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
19
  gem.require_paths = ["lib"]
19
20
  gem.add_dependency('rest-client', '~> 1.4')
20
- gem.add_dependency('multi_json', '~> 1.1')
21
- gem.add_dependency('faraday','~> 0.8.4')
22
- gem.add_dependency('faraday_middleware')
21
+ gem.add_dependency('multi_json', '~> 1.6.1')
22
+ gem.add_dependency('faraday','~> 0.8.5')
23
+ gem.add_dependency('faraday_middleware','~> 0.9.0')
23
24
  gem.add_development_dependency('rake', '~> 10.0.2')
24
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mpower
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-17 00:00:00.000000000 Z
12
+ date: 2013-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: '1.1'
37
+ version: 1.6.1
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: '1.1'
45
+ version: 1.6.1
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: faraday
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 0.8.4
53
+ version: 0.8.5
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,23 +58,23 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.4
61
+ version: 0.8.5
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: faraday_middleware
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ! '>='
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '0'
69
+ version: 0.9.0
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ! '>='
75
+ - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '0'
77
+ version: 0.9.0
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: rake
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -117,7 +117,9 @@ files:
117
117
  - test/test_mpower.rb
118
118
  homepage: http://mpowerpayments.com/developers/docs/ruby.html
119
119
  licenses: []
120
- post_install_message:
120
+ post_install_message: ! 'Thanks for installing MPower Payments Ruby client.
121
+
122
+ You may read full API docs at http://mpowerpayments.com/developers/docs/ruby.html'
121
123
  rdoc_options: []
122
124
  require_paths:
123
125
  - lib