paymentsds-mpesa 0.1.0.pre.alpha.9 → 0.1.0.pre.alpha.10
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 276095480d0d819250f4d3def5a8f20beab3cfbb04e64ddf03f8ebf81d33f0da
|
4
|
+
data.tar.gz: 0c74430f70c5af47df791a4cdf1fec361c3da5aaed2174a2f0f932ccfe6126ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39d2add0c46dd6d1c7bf716cc68f7c3af36b5e10f2a16d2c23fd965be852d0d2a9d1807a91957b849afe5628baaf400529b2524cd9cbb5836003da9ceba3bab0
|
7
|
+
data.tar.gz: ffcdeaf71aceb339be69fcc9cf9b577030b8e5439a51e5b225203a849952029ea7018d1ade3056de253450f84e08d6e18bdb080336983c0e577943a32136c432
|
@@ -21,9 +21,23 @@ module Paymentsds
|
|
21
21
|
attr_reader :auth
|
22
22
|
|
23
23
|
def initialize
|
24
|
+
@user_agent = 'Paymentsds Ruby'
|
25
|
+
@origin = "*"
|
26
|
+
@verify_ssl = false
|
27
|
+
@timeout = 0
|
28
|
+
@environment =
|
29
|
+
|
24
30
|
yield(self) if block_given?
|
25
31
|
end
|
26
32
|
|
33
|
+
def apply
|
34
|
+
@environment = if @environment == :production
|
35
|
+
Paymentsds::MPesa::Environment.new('https', 'api.vm.co.mz').freeze
|
36
|
+
else
|
37
|
+
Paymentsds::MPesa::Environment.new('https', 'api.sandbox.vm.co.mz').freeze
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
27
41
|
def generate_access_token
|
28
42
|
has_keys = instance_variable_defined?('@api_key') && instance_variable_defined?('@public_key')
|
29
43
|
has_access_token = instance_variable_defined?('@access_token')
|
@@ -9,6 +9,10 @@ module Paymentsds
|
|
9
9
|
@config = Paymentsds::MPesa::Configuration.new
|
10
10
|
end
|
11
11
|
|
12
|
+
def apply
|
13
|
+
@config.apply
|
14
|
+
end
|
15
|
+
|
12
16
|
def handle_send(intent)
|
13
17
|
operation = detect_operation(intent)
|
14
18
|
handle_request(operation, intent)
|
@@ -71,7 +75,7 @@ module Paymentsds
|
|
71
75
|
errors = []
|
72
76
|
|
73
77
|
intent.each do |k, _v|
|
74
|
-
errors.push(k) unless (intent[k]).match operation[:validation
|
78
|
+
errors.push(k) unless (intent[k]).match operation[:validation[k]
|
75
79
|
end
|
76
80
|
|
77
81
|
errors
|