ost-sdk-ruby-stag 0.0.1.pre → 0.0.1

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: 210d873ea1a2bca2ad9bb02d0471e87f156e317d
4
- data.tar.gz: 7f76480e6ee7cdea999b58cfa3f40c7222536c72
3
+ metadata.gz: 1b96e7c5c27df333a3c8644e338e3f6b79c9a622
4
+ data.tar.gz: ed43d1b2efc6ecd25658d863f66dac6cf079718a
5
5
  SHA512:
6
- metadata.gz: 4dc0387fcfdf8d506b2d7ca7febe40dee0e3249a57862865951a2bb3a309e5ee217a25143b5572592dfdfb6166d405c3be2adc59a0efbf126d776c4e2300ffaa
7
- data.tar.gz: 35aea0fd57e5bf600fb58359b775929db8e30bc38e06cd0d771af7e5fff3c7410462c12c42c48d114219b3395eb8c08647b1b634f4d324da131764ca6486aca4
6
+ metadata.gz: e42af98750f584eefb29061c4984ce54546b9f7dca189a4fd865456658e5b9e8fd592036c90da45813a405b867d4bf7bc861ba9a6181cb1711b577d60a6181e9
7
+ data.tar.gz: 66a6956204b285b55cfe5ff98ed893885c7e1c360d342fed75030cd2ef614a0d92fa29d5244a48b9b66f3f840569418b6200639ff964d6cbcabbfc5cdb30eb78
data/README.md CHANGED
@@ -24,15 +24,16 @@ Or install it yourself as:
24
24
 
25
25
  1. TransactionKind Module
26
26
 
27
- environment = 'sandbox' # possible values sandbox / production
28
-
29
- credentials = OSTSdk::Util::APICredentials.new('api_key', '2e3ec863fdffcc4425a3d73878e685e702b42bf8')
30
-
31
- obj = OSTSdk::Saas::TransactionKind.new(environment, credentials)
32
-
33
- obj.list(clientId: '1')
34
-
35
- obj.create(client_id: '1', name: 'test_1', kind: '1', value_currency_type: '1')
27
+ environment = 'sandbox' # possible values sandbox / production
28
+
29
+ credentials = OSTSdk::Util::APICredentials.new('api_key', 'api_secret')
30
+
31
+ obj = OSTSdk::Saas::TransactionKind.new(environment, credentials)
32
+
33
+ obj.list
34
+
35
+ obj.create()
36
+
36
37
 
37
38
  ## Development
38
39
 
@@ -12,28 +12,37 @@ module OSTSdk
12
12
  #
13
13
  def initialize(environment, credentials)
14
14
  super
15
- @url_prefix = '/transaction/kind'
15
+ @url_prefix = 'transaction/kind'
16
16
  end
17
17
 
18
18
  # Creates a new transaction type
19
19
  #
20
- # Returns:
21
- # response: (OSTSdk::Util::Result)
22
- #
23
- def list(params = {})
24
- http_helper.send_get_request("#{@url_prefix}/get-all", params)
20
+ def list
21
+ http_helper.send_get_request("#{@url_prefix}/get-all", {})
25
22
  end
26
23
 
27
24
  # Creates a new transaction type
28
25
  #
29
- # Arguments:
30
- # params: (Hash)
31
- #
32
- # Returns:
33
- # response: (OSTSdk::Util::Result)
26
+ # @param [Hash] params (mandatory) is a Hash
34
27
  #
35
28
  def create(params)
36
- http_helper.send_post_request("#{@url_prefix}/new", params)
29
+ http_helper.send_post_request("#{@url_prefix}/create", params)
30
+ end
31
+
32
+ # Update a transaction type
33
+ #
34
+ # @param [Hash] params (mandatory) is a Hash
35
+ #
36
+ def update(params)
37
+ http_helper.send_post_request("#{@url_prefix}/update", params)
38
+ end
39
+
40
+ # Delete a transaction type
41
+ #
42
+ # @param [Hash] params (mandatory) is a Hash
43
+ #
44
+ def delete(params)
45
+ http_helper.send_post_request("#{@url_prefix}/delete", params)
37
46
  end
38
47
 
39
48
  end
@@ -65,7 +65,7 @@ module OSTSdk
65
65
  def set_api_base_url(env)
66
66
  case env
67
67
  when 'sandbox'
68
- @api_base_url = 'http://localhost:3000'
68
+ @api_base_url = 'http://localhost:3000/'
69
69
  when 'production'
70
70
  @api_base_url = ''
71
71
  else
@@ -86,7 +86,7 @@ module OSTSdk
86
86
 
87
87
  def get_base_params(endpoint, request_params)
88
88
  request_timestamp = Time.now.to_i.to_s
89
- str = endpoint + '::' + request_timestamp + '::' + sort_hash(request_params).to_json
89
+ str = endpoint + '::' + request_timestamp + '::' + sort_hash(request_params).to_s
90
90
  signature = generate_signature(@api_secret, str)
91
91
  {"request-timestamp" => request_timestamp, "signature" => signature, "api-key" => @api_key}
92
92
  end
@@ -115,7 +115,7 @@ module OSTSdk
115
115
  end
116
116
 
117
117
  def sort_hash(request_params)
118
- sorted_array = request_params.sort {|a,b| a[0].downcase<=>b[0].downcase}
118
+ sorted_array = request_params.sort {|a,b| a[0]<=>b[0]}
119
119
  sorted_hash = {}
120
120
  sorted_array.each do |element|
121
121
  sorted_hash[element[0]] = element[1]
@@ -4,16 +4,7 @@ module OSTSdk
4
4
 
5
5
  module ServicesHelper
6
6
 
7
- # Wrapper Method which could be used to execute business logic
8
- # Error handling code wraps execution of business logic
9
- #
10
- # Arguments:
11
- # err_code: (String)
12
- # err_message: (String)
13
- # block: (Proc)
14
- #
15
- # Returns:
16
- # OSTSdk::Util::Result
7
+ # Method which is called in service perform and handle exceptions
17
8
  #
18
9
  def perform_and_handle_exceptions(err_code = 'swt', err_message = 'Something Went Wrong', &block)
19
10
  begin
@@ -108,7 +99,7 @@ module OSTSdk
108
99
  error: code,
109
100
  error_message: msg,
110
101
  data: data
111
- }
102
+ }
112
103
  )
113
104
 
114
105
  end
@@ -1,5 +1,5 @@
1
1
  module OSTSdk
2
2
 
3
- VERSION = "0.0.1.pre"
3
+ VERSION = "0.0.1"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ost-sdk-ruby-stag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puneet Khushwani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,12 +77,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 1.3.1
82
+ version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.2.2
85
+ rubygems_version: 2.6.13
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: OST Ruby SDK