my-services 0.0.1 → 0.0.2

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: 83b0074ece93ce9580cf777592216a9b498fbe9e67c888b8b8a7ec039c18540c
4
- data.tar.gz: 16e72fa08eacd6209d17220bd8c5db6414207e93be0da17f09719be60ba236f7
3
+ metadata.gz: 3a8f6df06959be827f771adea97510fa217970da294639bd710f91a66d13f067
4
+ data.tar.gz: 54aa978b21b909a1e2684e3facd4d1f854342ac8015faca40b833b9a92b0f331
5
5
  SHA512:
6
- metadata.gz: c68bc6a67f506118f6e2b1d7402a3acc69ff18b35e97bd26d30b5a7b8a0a2941cce6205d366c1a735676d083bd1ad4e7762537ac8022339bf4892fa5659f7d4e
7
- data.tar.gz: ff4eefb529b7ec092b2a1d86d548de063dec3b987a3cbd4b0250d5906384e729004d9ded71a7e30887e452651d54b3e47be15a4f4fb2783baf51b2d9c7eb4d7e
6
+ metadata.gz: 4771f9ad39cafee389261be6782a972b2c6fc3028f02f077d1a8feca85a3e2c3f1cad0ad673834658a61276a0e9baa0c445d4f56ff68a08c834763ef04d20b43
7
+ data.tar.gz: 209c5a6bf81c32d3459a82977ac8297aa6be360b5f5342bf61286dfe3d8a58c55d8fe9edf8d10a5edb85b3c67f992d24cc05a5c585b4ac4eb68cee6cdb19fcb6
@@ -2,70 +2,23 @@ module MyServices
2
2
  module Actions
3
3
  module Post
4
4
  module ClassMethods
5
+
5
6
  def load_category
6
- # api_url = "http://127.0.0.1:8080/billspayment/bill/categories"
7
- api_url = "#{self.api_url}"
8
- # response = MyServices.request(api_url, :post)
9
- response = JSON.parse('{
10
- "responseCode": "00",
11
- "message": "success",
12
- "data": [
13
- {
14
- "id": 3,
15
- "name": "State Government Collections"
16
- },
17
- {
18
- "id": 1,
19
- "name": "Utility Bills"
20
- },
21
- {
22
- "id": 5,
23
- "name": "Internet Services"
24
- },
25
- {
26
- "id": 41,
27
- "name": "Betting and Lottery"
28
- },
29
- {
30
- "id": 2,
31
- "name": "Cable TV Bills"
32
- },
33
- {
34
- "id": 12,
35
- "name": "Transport and Toll Payments"
36
- },
37
- {
38
- "id": 58,
39
- "name": "AZURI"
40
- }
41
- ]
42
- }')
7
+ api_url = "#{api_url}/categories"
8
+ response = MyServices.request(api_url, :post)
43
9
  end
10
+
44
11
  def load_billers(id)
45
- # api_url = "http://127.0.0.1:8080/billspayment/bill/getbillers/4"
46
- api_url = "#{self.api_url}/#{id}"
47
- # response = MyServices.request(api_url, :post)
48
- response = JSON.parse('{
49
- "responseCode": "00",
50
- "message": "success",
51
- "data": [
52
- {
53
- "id": 3444,
54
- "billerId": "3444",
55
- "billerName": "Abia State",
56
- "sid": 3,
57
- "status": "A"
58
- },
59
- {
60
- "id": 913,
61
- "billerId": "913",
62
- "billerName": "GLO",
63
- "sid": 3,
64
- "status": "A"
65
- }
66
- ]
67
- }')
12
+ api_url = "#{api_url}/getbillers/#{id}"
13
+ response = MyServices.request(api_url, :post)
68
14
  end
15
+
16
+ # params - id, customerRef, billerId, narration, accountNumber, paymentDate
17
+ def do_payment(payment_data)
18
+ api_url = "#{self.api_url}/dopayment"
19
+ response = MyServices.request(api_url, :post, payment_data)
20
+ end
21
+
69
22
  end
70
23
 
71
24
  def self.included(base)
@@ -3,7 +3,7 @@ module MyServices
3
3
  include MyServices::Actions::Post
4
4
 
5
5
  def self.api_url
6
- 'workers'
6
+ 'billspayment/bill'
7
7
  end
8
8
  end
9
9
  end
data/lib/my-services.rb CHANGED
@@ -17,14 +17,13 @@ require_relative 'my-services/my_services_object'
17
17
  require_relative 'my-services/worker'
18
18
 
19
19
  module MyServices
20
- # @base_url = 'https://myservices.com/api/v1/'
20
+ @base_url = 'http://14.98.171.134:9090/'
21
21
 
22
22
  class << self
23
23
  # MyServicesError :api_key, :base_url
24
24
 
25
25
  def request(api_url, method, params = {})
26
26
  # raise(AuthenticationError, 'Set your API Key using MyServices.api_key = <API_KEY>') unless api_key
27
-
28
27
  begin
29
28
  url = URI.join(base_url, api_url).to_s
30
29
  response = RestClient::Request.execute(method: method, url: url, payload: params.to_json, headers: request_headers)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my-services
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sahu Minaketana