soofapay 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43f51e93ecee753871cf3adde6d9c6ef6c42bac06a3fd23c3110016cb84773ea
4
- data.tar.gz: 2f52a32e9ac7505981495c8415cbbdabd8f65b48dc61383572035f82ab1d7ca0
3
+ metadata.gz: 58547db6f08dca8e7aef705c94291879d13e941738eec218eef8013f4e0803e9
4
+ data.tar.gz: 37e164fdb485a2f01ff33b6dfce42d480c0425425f124906d349ee99d92a3711
5
5
  SHA512:
6
- metadata.gz: 55d02c6ad3dfead456cda4c49e5db3bd8dcfe38cd6a812cc3bf2f9c4ba0a6e2345393ba66d80da77672d8c242362b784ddd2008af355d0efbfd43a3578fc57c1
7
- data.tar.gz: 28d50b398f6cc7a517b6959ef129938c04d0c7a645b7d816ae885443b6075f964e6650d54fc19048b198a83230781ec6c92620707d22119f11c118ce415475e6
6
+ metadata.gz: 19f8d1f756e7110934b71b5e1407148c8f312e42899169085c67d1cc0b74080dd9b6b1dd5a2f01d1402353f959c666c3977c4a03086cdb9a8ac4e1705be424c5
7
+ data.tar.gz: 3a0ae4a628b61265abc902e6a21866c408c659a1de508791515e9117f491cb0e74274a53e3657508bdd4f9598c5a3f9a89d915352d397df73758c446cefcd4d1
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ .idea/*
data/README.md CHANGED
@@ -22,13 +22,17 @@ Or install it yourself as:
22
22
  ```ruby
23
23
  require 'soofapay'
24
24
 
25
- soofa = Soofa.new('your_till_number', 'your_client_secret')
26
- puts "soofa balance is: ",soofa.get_balance
25
+ soofa = Soofa.new("your_till_number", 'your_client_secret')
26
+ puts "soofa balance is: ",soofa.get_balance.class
27
27
  exist = soofa.find("QTMB6")
28
28
  if exist
29
29
  @trx = soofa.get_transaction
30
- puts @trx.json
30
+ puts @trx.tid
31
+ puts @trx.gross_amount
32
+ puts @trx.as_json['reference']
33
+ puts @trx.as_string
31
34
  end
35
+
32
36
  ```
33
37
  The expected response for transaction check is `Transaction`
34
38
  object with various keys and methods
data/lib/soofapay.rb CHANGED
@@ -23,7 +23,7 @@ class Soofa
23
23
  "X-TILL": @till_no}
24
24
  begin
25
25
  response = RestClient.get(@url, headers = headers)
26
- data = JSON.parse(response).to_json
26
+ data = JSON.parse(response)
27
27
  _status = data["status"]
28
28
  if response.code == SUCCESSFUL
29
29
  @transaction = Transaction.new(data)
@@ -58,3 +58,6 @@ class Soofa
58
58
  end
59
59
  end
60
60
  end
61
+
62
+
63
+
@@ -1,3 +1,3 @@
1
1
  module Soofapay
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/transaction.rb CHANGED
@@ -1,7 +1,6 @@
1
+ require "json"
1
2
  #transaction class for soofa requests
2
3
  class Transaction
3
- attr_reader :status, :sender_currency, :receiver_currency, :tid, :reference, :sender, :receiver,
4
- :receipt_no, :timestamp, :gross_amount, :net_amount, :transacted_via, :is_money_in
5
4
  def initialize(data)
6
5
  @sender = data['sender']
7
6
  @sender_currency = data['sender_currency']
@@ -16,9 +15,51 @@ class Transaction
16
15
  @net_amount = data['net_amount']
17
16
  @transacted_via = data['transacted_via']
18
17
  @is_money_in=data['is_money_in']
19
- @as_json = data
18
+ @as_string= data.to_json
20
19
  end
21
- def json
22
- return @as_json
20
+ def as_json
21
+ return JSON.parse(@as_string)
22
+ end
23
+ def as_string
24
+ return @as_string
25
+ end
26
+ def status
27
+ return @status
28
+ end
29
+ def sender_currency
30
+ return @sender_currency
31
+ end
32
+ def receiver_currency
33
+ return @receiver_currency
34
+ end
35
+ def tid
36
+ return @tid
37
+ end
38
+ def reference
39
+ return @reference
40
+ end
41
+ def sender
42
+ return @sender
43
+ end
44
+ def receiver
45
+ return @receiver
46
+ end
47
+ def receipt_no
48
+ return @receipt_no
49
+ end
50
+ def timestamp
51
+ return @timestamp
52
+ end
53
+ def gross_amount
54
+ return @gross_amount
55
+ end
56
+ def net_amount
57
+ return @net_amount
58
+ end
59
+ def transacted_via
60
+ return @transacted_via
61
+ end
62
+ def is_money_in
63
+ return @is_money_in
23
64
  end
24
65
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soofapay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - soofapay team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-14 00:00:00.000000000 Z
11
+ date: 2019-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,12 +114,6 @@ extensions: []
114
114
  extra_rdoc_files: []
115
115
  files:
116
116
  - ".gitignore"
117
- - ".idea/inspectionProfiles/Project_Default.xml"
118
- - ".idea/misc.xml"
119
- - ".idea/modules.xml"
120
- - ".idea/soofapay.iml"
121
- - ".idea/vcs.xml"
122
- - ".idea/workspace.xml"
123
117
  - ".travis.yml"
124
118
  - CODE_OF_CONDUCT.md
125
119
  - Gemfile
@@ -133,6 +127,7 @@ files:
133
127
  - lib/soofapay.rb
134
128
  - lib/soofapay/version.rb
135
129
  - lib/transaction.rb
130
+ - soofapay-0.1.1.gem
136
131
  - soofapay.gemspec
137
132
  homepage: https://github.com/soofapay/ruby-soofa
138
133
  licenses:
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Rubocop" enabled="false" level="WARNING" enabled_by_default="false" />
5
- </profile>
6
- </component>
data/.idea/misc.xml DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="JavaScriptSettings">
4
- <option name="languageLevel" value="ES6" />
5
- </component>
6
- <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.5.1-p57" project-jdk-type="RUBY_SDK" />
7
- </project>
data/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/soofapay.iml" filepath="$PROJECT_DIR$/.idea/soofapay.iml" />
6
- </modules>
7
- </component>
8
- </project>
data/.idea/soofapay.iml DELETED
@@ -1,24 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="ModuleRunConfigurationManager">
4
- <shared />
5
- </component>
6
- <component name="NewModuleRootManager">
7
- <content url="file://$MODULE_DIR$" />
8
- <orderEntry type="inheritedJdk" />
9
- <orderEntry type="sourceFolder" forTests="false" />
10
- <orderEntry type="library" scope="PROVIDED" name="bundler (v1.17.3, ruby-2.5.1-p57) [gem]" level="application" />
11
- <orderEntry type="library" scope="PROVIDED" name="domain_name (v0.5.20190701, ruby-2.5.1-p57) [gem]" level="application" />
12
- <orderEntry type="library" scope="PROVIDED" name="http-cookie (v1.0.3, ruby-2.5.1-p57) [gem]" level="application" />
13
- <orderEntry type="library" scope="PROVIDED" name="json (v1.8.6, ruby-2.5.1-p57) [gem]" level="application" />
14
- <orderEntry type="library" scope="PROVIDED" name="mime-types (v3.2.2, ruby-2.5.1-p57) [gem]" level="application" />
15
- <orderEntry type="library" scope="PROVIDED" name="mime-types-data (v3.2019.0331, ruby-2.5.1-p57) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="minitest (v5.11.3, ruby-2.5.1-p57) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="netrc (v0.11.0, ruby-2.5.1-p57) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="rake (v10.5.0, ruby-2.5.1-p57) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="rest-client (v2.0.2, ruby-2.5.1-p57) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="unf (v0.1.4, ruby-2.5.1-p57) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="unf_ext (v0.0.7.6, ruby-2.5.1-p57) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="url (v0.3.2, ruby-2.5.1-p57) [gem]" level="application" />
23
- </component>
24
- </module>
data/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>
data/.idea/workspace.xml DELETED
@@ -1,259 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ChangeListManager">
4
- <list default="true" id="c63d5340-d583-492e-8eaa-f0afbada0cf5" name="Default Changelist" comment="">
5
- <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
- <change beforePath="$PROJECT_DIR$/lib/soofapay/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/soofapay/version.rb" afterDir="false" />
7
- <change beforePath="$PROJECT_DIR$/soofapay-0.1.0.gem" beforeDir="false" />
8
- <change beforePath="$PROJECT_DIR$/soofapay.gemspec" beforeDir="false" afterPath="$PROJECT_DIR$/soofapay.gemspec" afterDir="false" />
9
- </list>
10
- <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
11
- <option name="SHOW_DIALOG" value="false" />
12
- <option name="HIGHLIGHT_CONFLICTS" value="true" />
13
- <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
14
- <option name="LAST_RESOLUTION" value="IGNORE" />
15
- </component>
16
- <component name="FileEditorManager">
17
- <leaf>
18
- <file pinned="false" current-in-tab="false">
19
- <entry file="file://$PROJECT_DIR$/Gemfile">
20
- <provider selected="true" editor-type-id="text-editor">
21
- <state relative-caret-position="189">
22
- <caret line="9" selection-start-line="9" selection-end-line="9" />
23
- </state>
24
- </provider>
25
- </entry>
26
- </file>
27
- <file pinned="false" current-in-tab="false">
28
- <entry file="file://$PROJECT_DIR$/soofapay.gemspec">
29
- <provider selected="true" editor-type-id="text-editor">
30
- <state relative-caret-position="189">
31
- <caret line="9" column="44" selection-start-line="9" selection-start-column="44" selection-end-line="9" selection-end-column="44" />
32
- </state>
33
- </provider>
34
- </entry>
35
- </file>
36
- <file pinned="false" current-in-tab="true">
37
- <entry file="file://$PROJECT_DIR$/lib/soofapay/version.rb">
38
- <provider selected="true" editor-type-id="text-editor">
39
- <state relative-caret-position="21">
40
- <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
41
- </state>
42
- </provider>
43
- </entry>
44
- </file>
45
- <file pinned="false" current-in-tab="false">
46
- <entry file="file://$PROJECT_DIR$/lib/soofapay.rb">
47
- <provider selected="true" editor-type-id="text-editor">
48
- <state relative-caret-position="966">
49
- <caret line="59" column="3" selection-start-line="59" selection-start-column="3" selection-end-line="59" selection-end-column="3" />
50
- </state>
51
- </provider>
52
- </entry>
53
- </file>
54
- <file pinned="false" current-in-tab="false">
55
- <entry file="file://$PROJECT_DIR$/README.md">
56
- <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
57
- <state split_layout="SPLIT">
58
- <first_editor />
59
- <second_editor />
60
- </state>
61
- </provider>
62
- </entry>
63
- </file>
64
- </leaf>
65
- </component>
66
- <component name="FileTemplateManagerImpl">
67
- <option name="RECENT_TEMPLATES">
68
- <list>
69
- <option value="Ruby File" />
70
- </list>
71
- </option>
72
- </component>
73
- <component name="FindInProjectRecents">
74
- <findStrings>
75
- <find>soofa</find>
76
- </findStrings>
77
- </component>
78
- <component name="Git.Settings">
79
- <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
80
- </component>
81
- <component name="IdeDocumentHistory">
82
- <option name="CHANGED_PATHS">
83
- <list>
84
- <option value="$PROJECT_DIR$/README.md" />
85
- <option value="$PROJECT_DIR$/lib/transaction.rb" />
86
- <option value="$PROJECT_DIR$/lib/soofa_error_handler.rb" />
87
- <option value="$PROJECT_DIR$/.gitignore" />
88
- <option value="$PROJECT_DIR$/lib/soofapay.rb" />
89
- <option value="$PROJECT_DIR$/Gemfile" />
90
- <option value="$PROJECT_DIR$/soofapay.gemspec" />
91
- <option value="$PROJECT_DIR$/lib/soofapay/version.rb" />
92
- </list>
93
- </option>
94
- </component>
95
- <component name="ProjectConfigurationFiles">
96
- <option name="files">
97
- <list>
98
- <option value="$PROJECT_DIR$/.idea/soofapay.iml" />
99
- <option value="$PROJECT_DIR$/.idea/vcs.xml" />
100
- <option value="$PROJECT_DIR$/.idea/misc.xml" />
101
- <option value="$PROJECT_DIR$/.idea/modules.xml" />
102
- <option value="$PROJECT_DIR$/.idea/soofapay.iml" />
103
- <option value="$PROJECT_DIR$/.idea/vcs.xml" />
104
- <option value="$PROJECT_DIR$/.idea/misc.xml" />
105
- <option value="$PROJECT_DIR$/.idea/modules.xml" />
106
- <option value="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" />
107
- </list>
108
- </option>
109
- </component>
110
- <component name="ProjectFrameBounds" extendedState="6">
111
- <option name="y" value="27" />
112
- <option name="width" value="937" />
113
- <option name="height" value="641" />
114
- </component>
115
- <component name="ProjectLevelVcsManager" settingsEditedManually="true">
116
- <ConfirmationsSetting value="2" id="Add" />
117
- </component>
118
- <component name="ProjectView">
119
- <navigator proportions="" version="1">
120
- <foldersAlwaysOnTop value="true" />
121
- </navigator>
122
- <panes>
123
- <pane id="Scope" />
124
- <pane id="ProjectPane">
125
- <subPane>
126
- <expand>
127
- <path>
128
- <item name="soofapay" type="b2602c69:ProjectViewProjectNode" />
129
- <item name="soofapay" type="462c0819:PsiDirectoryNode" />
130
- </path>
131
- <path>
132
- <item name="soofapay" type="b2602c69:ProjectViewProjectNode" />
133
- <item name="soofapay" type="462c0819:PsiDirectoryNode" />
134
- <item name="lib" type="462c0819:PsiDirectoryNode" />
135
- </path>
136
- <path>
137
- <item name="soofapay" type="b2602c69:ProjectViewProjectNode" />
138
- <item name="soofapay" type="462c0819:PsiDirectoryNode" />
139
- <item name="lib" type="462c0819:PsiDirectoryNode" />
140
- <item name="soofapay" type="462c0819:PsiDirectoryNode" />
141
- </path>
142
- </expand>
143
- <select />
144
- </subPane>
145
- </pane>
146
- </panes>
147
- </component>
148
- <component name="PropertiesComponent">
149
- <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
150
- <property name="WebServerToolWindowFactoryState" value="false" />
151
- <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
152
- <property name="nodejs_npm_path_reset_for_default_project" value="true" />
153
- </component>
154
- <component name="RunDashboard">
155
- <option name="ruleStates">
156
- <list>
157
- <RuleState>
158
- <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
159
- </RuleState>
160
- <RuleState>
161
- <option name="name" value="StatusDashboardGroupingRule" />
162
- </RuleState>
163
- </list>
164
- </option>
165
- </component>
166
- <component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" />
167
- <component name="SvnConfiguration">
168
- <configuration />
169
- </component>
170
- <component name="TaskManager">
171
- <task active="true" id="Default" summary="Default task">
172
- <changelist id="c63d5340-d583-492e-8eaa-f0afbada0cf5" name="Default Changelist" comment="" />
173
- <created>1563134281472</created>
174
- <option name="number" value="Default" />
175
- <option name="presentableId" value="Default" />
176
- <updated>1563134281472</updated>
177
- <workItem from="1563134285642" duration="113000" />
178
- <workItem from="1563134402824" duration="3201000" />
179
- <workItem from="1563137618217" duration="2937000" />
180
- </task>
181
- <servers />
182
- </component>
183
- <component name="TimeTrackingManager">
184
- <option name="totallyTimeSpent" value="6251000" />
185
- </component>
186
- <component name="ToolWindowManager">
187
- <frame x="0" y="25" width="1366" height="698" extended-state="6" />
188
- <editor active="true" />
189
- <layout>
190
- <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26818183" />
191
- <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
192
- <window_info id="Favorites" order="2" side_tool="true" />
193
- <window_info anchor="bottom" id="Message" order="0" />
194
- <window_info anchor="bottom" id="Find" order="1" />
195
- <window_info anchor="bottom" id="Run" order="2" weight="0.32792792" />
196
- <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
197
- <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
198
- <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
199
- <window_info anchor="bottom" id="TODO" order="6" />
200
- <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
201
- <window_info anchor="bottom" id="Database Changes" order="8" />
202
- <window_info anchor="bottom" id="Version Control" order="9" />
203
- <window_info anchor="bottom" id="Terminal" order="10" visible="true" weight="0.32792792" />
204
- <window_info anchor="bottom" id="Event Log" order="11" side_tool="true" />
205
- <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
206
- <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
207
- <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
208
- <window_info anchor="right" id="Database" order="3" />
209
- </layout>
210
- </component>
211
- <component name="TypeScriptGeneratedFilesManager">
212
- <option name="version" value="1" />
213
- </component>
214
- <component name="editorHistoryManager">
215
- <entry file="file://$PROJECT_DIR$/lib/soofapay/soofa_error_handler.rb" />
216
- <entry file="file://$PROJECT_DIR$/lib/soofapay/transaction.rb" />
217
- <entry file="file://$PROJECT_DIR$/lib/soofa_error_handler.rb" />
218
- <entry file="file://$PROJECT_DIR$/lib/transaction.rb" />
219
- <entry file="file://$PROJECT_DIR$/.gitignore" />
220
- <entry file="file://$PROJECT_DIR$/LICENSE.txt" />
221
- <entry file="file://$PROJECT_DIR$/Gemfile.lock" />
222
- <entry file="file://$PROJECT_DIR$/lib/soofapay.rb">
223
- <provider selected="true" editor-type-id="text-editor">
224
- <state relative-caret-position="966">
225
- <caret line="59" column="3" selection-start-line="59" selection-start-column="3" selection-end-line="59" selection-end-column="3" />
226
- </state>
227
- </provider>
228
- </entry>
229
- <entry file="file://$PROJECT_DIR$/README.md">
230
- <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
231
- <state split_layout="SPLIT">
232
- <first_editor />
233
- <second_editor />
234
- </state>
235
- </provider>
236
- </entry>
237
- <entry file="file://$PROJECT_DIR$/Gemfile">
238
- <provider selected="true" editor-type-id="text-editor">
239
- <state relative-caret-position="189">
240
- <caret line="9" selection-start-line="9" selection-end-line="9" />
241
- </state>
242
- </provider>
243
- </entry>
244
- <entry file="file://$PROJECT_DIR$/soofapay.gemspec">
245
- <provider selected="true" editor-type-id="text-editor">
246
- <state relative-caret-position="189">
247
- <caret line="9" column="44" selection-start-line="9" selection-start-column="44" selection-end-line="9" selection-end-column="44" />
248
- </state>
249
- </provider>
250
- </entry>
251
- <entry file="file://$PROJECT_DIR$/lib/soofapay/version.rb">
252
- <provider selected="true" editor-type-id="text-editor">
253
- <state relative-caret-position="21">
254
- <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
255
- </state>
256
- </provider>
257
- </entry>
258
- </component>
259
- </project>