mpower 1.2.2 → 1.2.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: f728c9c8131d57531ad7355bbe492f5dede07053
4
- data.tar.gz: fff5abf045d109c098658a850c57f0a285f82d6c
3
+ metadata.gz: cfd1c8f128d8eeb00495d0c5687fd4fcf712aa6b
4
+ data.tar.gz: c47a9bc95907f69f7c2d062ed5db14d9c8782fcf
5
5
  SHA512:
6
- metadata.gz: e9b71ea38d42cf0c4ba5ade8be0361ceed4a5ae300d828013eb2e160afd1285832ec1197cc820e1f90751a9cd89ac7dccccc2e0f88221a2dd7f6f48c81f5e7fd
7
- data.tar.gz: d486ae927d2ca399c70429ea9bb5d9be41439f87e3fbe045373774aaf4eaa717c497e0cbe4c6f374d3bc85eafe8a56c18d9bf7e9224de2a96e67df4979ac6d0e
6
+ metadata.gz: d2a2f95b9a7ced37f733a923a3a7abe1384d1a2ba11d9eb773a158317b4a966da6014ea9c3844d0976d8466a2522a5447a3b05e7d0e3877b265915275a1773d1
7
+ data.tar.gz: 887bc5b5757c5d137529c0b78a924c4d1fa4edcd3608473611350e3308e311e33c304e53d7f2551df4b825131464be67e1950356ffc0cdbee4387cd9a88a3917
@@ -2,7 +2,7 @@ module MPower
2
2
  module Checkout
3
3
  class Core
4
4
  include MPower::Utilities
5
- attr_accessor :status, :response_text, :response_code, :transaction_id, :description, :token, :result
5
+ attr_accessor :status, :response_text, :response_code, :transaction_id, :description, :token, :result, :invoice_token
6
6
 
7
7
  def push_results(result={})
8
8
  @result = result
@@ -22,4 +22,4 @@ end
22
22
  checkout/store
23
23
  ).each do |lib|
24
24
  require File.join(File.dirname(__FILE__), lib)
25
- end
25
+ end
@@ -1,9 +1,6 @@
1
1
  module MPower
2
2
  module Onsite
3
3
  class Invoice < MPower::Checkout::Invoice
4
-
5
- attr_accessor :invoice_token
6
-
7
4
  def initialize
8
5
  super
9
6
  end
@@ -43,4 +40,4 @@ module MPower
43
40
 
44
41
  end
45
42
  end
46
- end
43
+ end
@@ -2,7 +2,7 @@ module MPower
2
2
  module Checkout
3
3
  class Invoice < MPower::Checkout::Core
4
4
 
5
- attr_accessor :items, :total_amount, :taxes, :description, :currency, :store
5
+ attr_accessor :items, :total_amount, :taxes, :description, :currency, :store, :invoice_token
6
6
  attr_accessor :customer, :custom_data, :cancel_url, :return_url, :invoice_url, :receipt_url
7
7
 
8
8
  def initialize
@@ -128,9 +128,11 @@ module MPower
128
128
  def create_response(result={})
129
129
  if result["response_code"] == "00"
130
130
  @token = result["token"]
131
+ @invoice_token = result["invoice_token"]
131
132
  @response_text = result["response_description"]
132
133
  @response_code = result["response_code"]
133
134
  @invoice_url = result["response_text"]
135
+ @invoice_token = result["invoice_token"]
134
136
  @status = MPower::SUCCESS
135
137
  true
136
138
  else
@@ -143,4 +145,4 @@ module MPower
143
145
  end
144
146
  end
145
147
  end
146
- end
148
+ end
@@ -3,16 +3,8 @@ module MPower
3
3
  attr_accessor :unity_transaction_id
4
4
 
5
5
  def charge(amount,card_details={})
6
- payload = {
7
- :card_name => card_details[:card_name],
8
- :card_number => card_details[:card_number],
9
- :card_cvc => card_details[:card_cvc],
10
- :exp_month => card_details[:exp_month],
11
- :exp_year => card_details[:exp_year],
12
- :amount => amount
13
- }
14
-
15
- result = http_json_request(MPower::Setup.direct_card_charge_base_url,payload)
6
+ card_details[:amount] = amount
7
+ result = http_json_request(MPower::Setup.direct_card_charge_base_url,card_details)
16
8
 
17
9
  if result["response_code"] == "00"
18
10
  push_results(result)
@@ -24,4 +16,4 @@ module MPower
24
16
  end
25
17
  end
26
18
  end
27
- end
19
+ end
@@ -3,16 +3,8 @@ module MPower
3
3
 
4
4
  attr_accessor :mobile_invoice_no, :tx_status, :cancel_reason
5
5
  def charge(amount,customer_details={})
6
- payload = {
7
- :customer_name => customer_details[:customer_name],
8
- :customer_phone => customer_details[:customer_phone],
9
- :customer_email => customer_details[:customer_email],
10
- :wallet_provider => customer_details[:wallet_provider],
11
- :merchant_name => customer_details[:merchant_name],
12
- :amount => amount
13
- }
14
-
15
- result = http_json_request(MPower::Setup.direct_mobile_charge_base_url,payload)
6
+ customer_details[:amount] = amount
7
+ result = http_json_request(MPower::Setup.direct_mobile_charge_base_url,customer_details)
16
8
 
17
9
  if result["response_code"] == "00"
18
10
  @mobile_invoice_no = result["mobile_invoice_no"]
@@ -41,4 +33,4 @@ module MPower
41
33
  end
42
34
  end
43
35
  end
44
- end
36
+ end
@@ -1,3 +1,3 @@
1
1
  module MPower
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mpower
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alfred Rowe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-17 00:00:00.000000000 Z
11
+ date: 2016-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.4.2
154
+ rubygems_version: 2.5.1
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Ruby client bindings for the MPower API