soofapay 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 43f51e93ecee753871cf3adde6d9c6ef6c42bac06a3fd23c3110016cb84773ea
4
+ data.tar.gz: 2f52a32e9ac7505981495c8415cbbdabd8f65b48dc61383572035f82ab1d7ca0
5
+ SHA512:
6
+ metadata.gz: 55d02c6ad3dfead456cda4c49e5db3bd8dcfe38cd6a812cc3bf2f9c4ba0a6e2345393ba66d80da77672d8c242362b784ddd2008af355d0efbfd43a3578fc57c1
7
+ data.tar.gz: 28d50b398f6cc7a517b6959ef129938c04d0c7a645b7d816ae885443b6075f964e6650d54fc19048b198a83230781ec6c92620707d22119f11c118ce415475e6
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,6 @@
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 ADDED
@@ -0,0 +1,7 @@
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 ADDED
@@ -0,0 +1,8 @@
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>
@@ -0,0 +1,24 @@
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 ADDED
@@ -0,0 +1,6 @@
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>
@@ -0,0 +1,259 @@
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>
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.1
7
+ before_install: gem install bundler -v 1.17.3
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at =. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in soofapay.gemspec
6
+ gem 'json', '~> 1.8', '>= 1.8.3'
7
+ gem 'url', '~> 0.3.2'
8
+ gem 'rest-client', '~> 2.0', '>= 2.0.2'
9
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,42 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ soofapay (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ domain_name (0.5.20190701)
10
+ unf (>= 0.0.5, < 1.0.0)
11
+ http-cookie (1.0.3)
12
+ domain_name (~> 0.5)
13
+ json (1.8.6)
14
+ mime-types (3.2.2)
15
+ mime-types-data (~> 3.2015)
16
+ mime-types-data (3.2019.0331)
17
+ minitest (5.11.3)
18
+ netrc (0.11.0)
19
+ rake (10.5.0)
20
+ rest-client (2.0.2)
21
+ http-cookie (>= 1.0.2, < 2.0)
22
+ mime-types (>= 1.16, < 4.0)
23
+ netrc (~> 0.8)
24
+ unf (0.1.4)
25
+ unf_ext
26
+ unf_ext (0.0.7.6)
27
+ url (0.3.2)
28
+
29
+ PLATFORMS
30
+ ruby
31
+
32
+ DEPENDENCIES
33
+ bundler (~> 1.17)
34
+ json (~> 1.8, >= 1.8.3)
35
+ minitest (~> 5.0)
36
+ rake (~> 10.0)
37
+ rest-client (~> 2.0, >= 2.0.2)
38
+ soofapay!
39
+ url (~> 0.3.2)
40
+
41
+ BUNDLED WITH
42
+ 1.17.3
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 =
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,113 @@
1
+ # Ruby Soofa
2
+ This package is aimed at simplifying the process of integrating soofapay payment solution to your ruby systems. You can check our
3
+ [website] for more
4
+ ## Installation
5
+
6
+ Add this line to your application's Gemfile:
7
+
8
+ ```ruby
9
+ gem 'soofapay'
10
+ ```
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install soofapay
19
+
20
+ ## Usage
21
+ ##### 1. Checking for a transaction
22
+ ```ruby
23
+ require 'soofapay'
24
+
25
+ soofa = Soofa.new('your_till_number', 'your_client_secret')
26
+ puts "soofa balance is: ",soofa.get_balance
27
+ exist = soofa.find("QTMB6")
28
+ if exist
29
+ @trx = soofa.get_transaction
30
+ puts @trx.json
31
+ end
32
+ ```
33
+ The expected response for transaction check is `Transaction`
34
+ object with various keys and methods
35
+
36
+ There is an additional method for getting the entire JSON object.
37
+
38
+ > transaction.json()
39
+
40
+ [website]: <https://www.soofapay.com>
41
+
42
+ ```JSON
43
+ {
44
+ "status": "SUCCESSFUL",
45
+ "sender_currency": "KES",
46
+ "receiver_currency": "KES",
47
+ "tid": "QTMB3",
48
+ "reference": "T5004",
49
+ "receipt_no": "NFQ6U45W28",
50
+ "timestamp": 1561499777.715254,
51
+ "gross_amount": 5,
52
+ "net_amount": 4.8605,
53
+ "transacted_via": "mpesa",
54
+ "is_money_in": true,
55
+ "sender": "+254701234567",
56
+ "receiver": "Dev Market"
57
+ }
58
+ ```
59
+
60
+ The table below describes all the attributes of the transaction object.
61
+
62
+
63
+ | Key | Description |
64
+ | ------ | ------ |
65
+ | status | The state of the transaction, either `SUCCESSFUL` or `PENDING` |
66
+ | sender_currency | The currency of the person who performed the transaction |
67
+ | receiver_currency | The currency of the business, if the transaction was Money in for the business |
68
+ | reference | The transaction reference passed when making a transaction |
69
+ | timestamp | Unix timestamp for the transaction |
70
+ | gross_amount | The amount of the transaction |
71
+ | net_amount | The amount received after deducting soofa |
72
+ | transacted_via | The service provider which facilitated the transaction eg. mpesa, visa, airtelmoney, mastercard, tkash ... |
73
+ | is_money_in | A boolean indicating if the money was to the business or out of the business |
74
+ | sender | The performer of transaction |
75
+ | receiver | The receiver of the transaction which is the business if the transaction was inbound |
76
+
77
+ ##### 2. Checking your soofa business account balance
78
+ ```ruby
79
+ require 'soofapay'
80
+
81
+ soofa = Soofa.new("you_soofa_till_number", "your_client_secret_here")
82
+ balance = soofa.get_balance()
83
+ print(balance)
84
+ ```
85
+
86
+ The expected response for checking balance is a JSON with three fields:
87
+
88
+ [website]: <https://www.soofapay.com>
89
+
90
+
91
+ ```JSON
92
+ {
93
+ "balance": "1587.49",
94
+ "currency": "KES",
95
+ "timestamp": 1561820831.623298
96
+ }
97
+ ```
98
+ ## Development
99
+
100
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
101
+
102
+
103
+ ## Contributing
104
+
105
+ Bug reports and pull requests are welcome on GitHub at https://github.com/soofapay/ruby-soofa/issues
106
+
107
+ ## License
108
+
109
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
110
+
111
+ ## Code of Conduct
112
+
113
+ Everyone interacting in the Soofa project’s codebases and issue trackers is expected to follow the [code of conduct](https://github.com/soofapay/ruby-soofa/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "soofapay"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,5 @@
1
+ class SoofaPermissionError< StandardError
2
+ def initialize(msg)
3
+ super(msg)
4
+ end
5
+ end
data/lib/soofapay.rb ADDED
@@ -0,0 +1,60 @@
1
+ # soofapay intergation library
2
+ require_relative '' "soofapay/version"
3
+ require 'rest-client'
4
+ require 'json'
5
+ require_relative 'transaction'
6
+ require 'uri'
7
+ require_relative 'soofa_error_handler'
8
+
9
+ class Soofa
10
+ SUCCESSFUL = 200
11
+ LOGGER = Logger.new(STDOUT)
12
+
13
+ def initialize(till_no, client_secret)
14
+ @till_no = till_no
15
+ @client_secret = client_secret
16
+ @transaction = nil
17
+ @status = nil
18
+ end
19
+
20
+ def find(tid)
21
+ @url = "https://api.soofapay.com/v1/transactions/#{tid}/"
22
+ headers = {"Authorization": @client_secret,
23
+ "X-TILL": @till_no}
24
+ begin
25
+ response = RestClient.get(@url, headers = headers)
26
+ data = JSON.parse(response).to_json
27
+ _status = data["status"]
28
+ if response.code == SUCCESSFUL
29
+ @transaction = Transaction.new(data)
30
+ return true
31
+ end
32
+ rescue RestClient::NotFound
33
+ LOGGER.warn("The transaction %s does not exist" % tid)
34
+ return false
35
+ rescue RestClient::Forbidden
36
+ raise SoofaPermissionError.new("Your are not allowed to perform this action. Please ensure you use your correct till number and client_secret")
37
+ end
38
+ end
39
+
40
+ def get_transaction
41
+ if @transaction == nil
42
+ raise Exception("A transaction is not available yet. Please ensure you call find method and verify that one exists before proceeding")
43
+ else
44
+ return @transaction
45
+ end
46
+ end
47
+
48
+ def get_balance
49
+ @url = "http://api.soofapay.com/v1/balance/"
50
+ headers = {"Authorization": @client_secret,
51
+ "X-TILL": @till_no}
52
+ begin
53
+ response = RestClient.get(@url, headers = headers)
54
+ data = JSON.parse(response).to_json
55
+ return data
56
+ rescue RestClient::Forbidden
57
+ raise SoofaPermissionError.new("Your are not allowed to perform this action. Please ensure you use your correct till number and client_secret")
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,3 @@
1
+ module Soofapay
2
+ VERSION = "0.1.1"
3
+ end
@@ -0,0 +1,24 @@
1
+ #transaction class for soofa requests
2
+ 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
+ def initialize(data)
6
+ @sender = data['sender']
7
+ @sender_currency = data['sender_currency']
8
+ @status = data['status']
9
+ @receiver_currency = data['receiver_currency']
10
+ @tid = data['tid']
11
+ @reference = data['reference']
12
+ @receiver = data['receiver']
13
+ @receipt_no = data['receipt_no']
14
+ @timestamp = data['timestamp']
15
+ @gross_amount = data['gross_amount']
16
+ @net_amount = data['net_amount']
17
+ @transacted_via = data['transacted_via']
18
+ @is_money_in=data['is_money_in']
19
+ @as_json = data
20
+ end
21
+ def json
22
+ return @as_json
23
+ end
24
+ end
data/soofapay.gemspec ADDED
@@ -0,0 +1,41 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "soofapay/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "soofapay"
8
+ spec.version = Soofapay::VERSION
9
+ spec.authors = ["soofapay team"]
10
+ spec.email = ["info@soofapay.com"]
11
+ spec.summary = %q{ SoofaPay intergartion library}
12
+ spec.description = %q{ User Helper}
13
+ spec.homepage = "https://github.com/soofapay/ruby-soofa"
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = spec.homepage
21
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
22
+ else
23
+ raise "RubyGems 2.0 or newer is required to protect against " \
24
+ "public gem pushes."
25
+ end
26
+
27
+ # Specify which files should be added to the gem when it is released.
28
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
29
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
30
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
31
+ end
32
+ spec.bindir = "exe"
33
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
+ spec.require_paths = ["lib"]
35
+ spec.add_development_dependency "bundler", "~> 1.17"
36
+ spec.add_development_dependency "rake", "~> 10.0"
37
+ spec.add_development_dependency "minitest", "~> 5.0"
38
+ spec.add_development_dependency 'json', '~> 1.8', '>= 1.8.3'
39
+ spec.add_development_dependency 'url', '~> 0.3.2'
40
+ spec.add_development_dependency 'rest-client', '~> 2.0', '>= 2.0.2'
41
+ end
metadata ADDED
@@ -0,0 +1,162 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: soofapay
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - soofapay team
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-07-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.17'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.17'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: json
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.8'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 1.8.3
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '1.8'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.8.3
75
+ - !ruby/object:Gem::Dependency
76
+ name: url
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 0.3.2
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 0.3.2
89
+ - !ruby/object:Gem::Dependency
90
+ name: rest-client
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '2.0'
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: 2.0.2
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: '2.0'
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 2.0.2
109
+ description: " User Helper"
110
+ email:
111
+ - info@soofapay.com
112
+ executables: []
113
+ extensions: []
114
+ extra_rdoc_files: []
115
+ files:
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
+ - ".travis.yml"
124
+ - CODE_OF_CONDUCT.md
125
+ - Gemfile
126
+ - Gemfile.lock
127
+ - LICENSE.txt
128
+ - README.md
129
+ - Rakefile
130
+ - bin/console
131
+ - bin/setup
132
+ - lib/soofa_error_handler.rb
133
+ - lib/soofapay.rb
134
+ - lib/soofapay/version.rb
135
+ - lib/transaction.rb
136
+ - soofapay.gemspec
137
+ homepage: https://github.com/soofapay/ruby-soofa
138
+ licenses:
139
+ - MIT
140
+ metadata:
141
+ homepage_uri: https://github.com/soofapay/ruby-soofa
142
+ source_code_uri: https://github.com/soofapay/ruby-soofa
143
+ post_install_message:
144
+ rdoc_options: []
145
+ require_paths:
146
+ - lib
147
+ required_ruby_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
157
+ requirements: []
158
+ rubygems_version: 3.0.4
159
+ signing_key:
160
+ specification_version: 4
161
+ summary: SoofaPay intergartion library
162
+ test_files: []