synapse_pay 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.travis.yml +16 -0
  4. data/Gemfile +8 -0
  5. data/LICENSE +21 -0
  6. data/README.md +54 -0
  7. data/Rakefile +8 -0
  8. data/VERSION +1 -0
  9. data/bin/synapse_pay-console +7 -0
  10. data/gemfiles/default-with-activesupport.gemfile +10 -0
  11. data/gemfiles/json.gemfile +12 -0
  12. data/gemfiles/yajl.gemfile +12 -0
  13. data/lib/synapse_pay.rb +78 -0
  14. data/lib/synapse_pay/apibits/api_client.rb +29 -0
  15. data/lib/synapse_pay/apibits/api_endpoint.rb +9 -0
  16. data/lib/synapse_pay/apibits/api_list.rb +88 -0
  17. data/lib/synapse_pay/apibits/api_method.rb +97 -0
  18. data/lib/synapse_pay/apibits/api_object.rb +52 -0
  19. data/lib/synapse_pay/apibits/api_resource.rb +127 -0
  20. data/lib/synapse_pay/apibits/headers_builder.rb +47 -0
  21. data/lib/synapse_pay/apibits/params_builder.rb +30 -0
  22. data/lib/synapse_pay/apibits/path_builder.rb +38 -0
  23. data/lib/synapse_pay/apibits/requester.rb +104 -0
  24. data/lib/synapse_pay/apibits/util.rb +51 -0
  25. data/lib/synapse_pay/client.rb +89 -0
  26. data/lib/synapse_pay/endpoints/bank_endpoint.rb +47 -0
  27. data/lib/synapse_pay/endpoints/bank_mfa_device_endpoint.rb +5 -0
  28. data/lib/synapse_pay/endpoints/bank_mfa_questions_endpoint.rb +5 -0
  29. data/lib/synapse_pay/endpoints/bank_status_endpoint.rb +11 -0
  30. data/lib/synapse_pay/endpoints/card_endpoint.rb +26 -0
  31. data/lib/synapse_pay/endpoints/deposit_endpoint.rb +23 -0
  32. data/lib/synapse_pay/endpoints/mass_pay_endpoint.rb +26 -0
  33. data/lib/synapse_pay/endpoints/order_endpoint.rb +44 -0
  34. data/lib/synapse_pay/endpoints/user_endpoint.rb +26 -0
  35. data/lib/synapse_pay/endpoints/wire_endpoint.rb +29 -0
  36. data/lib/synapse_pay/endpoints/withdrawal_endpoint.rb +17 -0
  37. data/lib/synapse_pay/errors/api_connection_error.rb +4 -0
  38. data/lib/synapse_pay/errors/api_error.rb +32 -0
  39. data/lib/synapse_pay/errors/authentication_error.rb +4 -0
  40. data/lib/synapse_pay/errors/synapse_pay_error.rb +13 -0
  41. data/lib/synapse_pay/nested_list.rb +32 -0
  42. data/lib/synapse_pay/resources/bank.rb +46 -0
  43. data/lib/synapse_pay/resources/bank_mfa_device.rb +32 -0
  44. data/lib/synapse_pay/resources/bank_mfa_questions.rb +28 -0
  45. data/lib/synapse_pay/resources/bank_status.rb +21 -0
  46. data/lib/synapse_pay/resources/card.rb +32 -0
  47. data/lib/synapse_pay/resources/deposit.rb +25 -0
  48. data/lib/synapse_pay/resources/mass_pay.rb +38 -0
  49. data/lib/synapse_pay/resources/order.rb +63 -0
  50. data/lib/synapse_pay/resources/user.rb +80 -0
  51. data/lib/synapse_pay/resources/wire.rb +31 -0
  52. data/lib/synapse_pay/resources/withdrawal.rb +29 -0
  53. data/lib/synapse_pay/version.rb +3 -0
  54. data/synapse_pay.gemspec +29 -0
  55. data/test/synapse_pay/api_list_test.rb +23 -0
  56. data/test/synapse_pay/api_method_test.rb +89 -0
  57. data/test/synapse_pay/headers_builder_test.rb +39 -0
  58. data/test/synapse_pay/params_builder_test.rb +57 -0
  59. data/test/synapse_pay/path_builder_test.rb +50 -0
  60. data/test/synapse_pay/requester_test.rb +86 -0
  61. data/test/synapse_pay/util_test.rb +51 -0
  62. data/test/test_data.rb +72 -0
  63. data/test/test_helper.rb +41 -0
  64. metadata +220 -0
@@ -0,0 +1,41 @@
1
+ require 'synapse_pay'
2
+ require 'test/unit'
3
+ require 'mocha/setup'
4
+ require 'stringio'
5
+ require 'shoulda'
6
+ require File.expand_path('../test_data', __FILE__)
7
+ # require File.expand_path('../mock_resource', __FILE__)
8
+
9
+ # monkeypatch request methods
10
+ module SynapsePay
11
+ class << self
12
+ attr_accessor :mock_rest_client
13
+ end
14
+
15
+ module Requester
16
+ def self.request(method, url, params, headers)
17
+ case method
18
+ when :get then SynapsePay::mock_rest_client.get(url, headers, params)
19
+ when :put then SynapsePay::mock_rest_client.put(url, headers, params)
20
+ when :post then SynapsePay::mock_rest_client.post(url, headers, params)
21
+ when :delete then SynapsePay::mock_rest_client.delete(url, headers, params)
22
+ else
23
+ raise "Invalid method"
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ class ::Test::Unit::TestCase
30
+ include SynapsePay::TestData
31
+ include Mocha
32
+
33
+ setup do
34
+ @mock = mock
35
+ SynapsePay.mock_rest_client = @mock
36
+ end
37
+
38
+ teardown do
39
+ SynapsePay.mock_rest_client = nil
40
+ end
41
+ end
metadata ADDED
@@ -0,0 +1,220 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: synapse_pay
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Apibits.com
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: mime-types
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '1.25'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '3.0'
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '1.25'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '3.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: json
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 1.8.1
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 1.8.1
61
+ - !ruby/object:Gem::Dependency
62
+ name: mocha
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: 0.13.2
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: 0.13.2
75
+ - !ruby/object:Gem::Dependency
76
+ name: shoulda
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 3.4.0
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 3.4.0
89
+ - !ruby/object:Gem::Dependency
90
+ name: test-unit
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rake
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ description: SynapsePay allows you to integrate bank payments into your applications
118
+ email:
119
+ - libraries@apibits.com
120
+ executables:
121
+ - synapse_pay-console
122
+ extensions: []
123
+ extra_rdoc_files: []
124
+ files:
125
+ - ".gitignore"
126
+ - ".travis.yml"
127
+ - Gemfile
128
+ - LICENSE
129
+ - README.md
130
+ - Rakefile
131
+ - VERSION
132
+ - bin/synapse_pay-console
133
+ - gemfiles/default-with-activesupport.gemfile
134
+ - gemfiles/json.gemfile
135
+ - gemfiles/yajl.gemfile
136
+ - lib/synapse_pay.rb
137
+ - lib/synapse_pay/apibits/api_client.rb
138
+ - lib/synapse_pay/apibits/api_endpoint.rb
139
+ - lib/synapse_pay/apibits/api_list.rb
140
+ - lib/synapse_pay/apibits/api_method.rb
141
+ - lib/synapse_pay/apibits/api_object.rb
142
+ - lib/synapse_pay/apibits/api_resource.rb
143
+ - lib/synapse_pay/apibits/headers_builder.rb
144
+ - lib/synapse_pay/apibits/params_builder.rb
145
+ - lib/synapse_pay/apibits/path_builder.rb
146
+ - lib/synapse_pay/apibits/requester.rb
147
+ - lib/synapse_pay/apibits/util.rb
148
+ - lib/synapse_pay/client.rb
149
+ - lib/synapse_pay/endpoints/bank_endpoint.rb
150
+ - lib/synapse_pay/endpoints/bank_mfa_device_endpoint.rb
151
+ - lib/synapse_pay/endpoints/bank_mfa_questions_endpoint.rb
152
+ - lib/synapse_pay/endpoints/bank_status_endpoint.rb
153
+ - lib/synapse_pay/endpoints/card_endpoint.rb
154
+ - lib/synapse_pay/endpoints/deposit_endpoint.rb
155
+ - lib/synapse_pay/endpoints/mass_pay_endpoint.rb
156
+ - lib/synapse_pay/endpoints/order_endpoint.rb
157
+ - lib/synapse_pay/endpoints/user_endpoint.rb
158
+ - lib/synapse_pay/endpoints/wire_endpoint.rb
159
+ - lib/synapse_pay/endpoints/withdrawal_endpoint.rb
160
+ - lib/synapse_pay/errors/api_connection_error.rb
161
+ - lib/synapse_pay/errors/api_error.rb
162
+ - lib/synapse_pay/errors/authentication_error.rb
163
+ - lib/synapse_pay/errors/synapse_pay_error.rb
164
+ - lib/synapse_pay/nested_list.rb
165
+ - lib/synapse_pay/resources/bank.rb
166
+ - lib/synapse_pay/resources/bank_mfa_device.rb
167
+ - lib/synapse_pay/resources/bank_mfa_questions.rb
168
+ - lib/synapse_pay/resources/bank_status.rb
169
+ - lib/synapse_pay/resources/card.rb
170
+ - lib/synapse_pay/resources/deposit.rb
171
+ - lib/synapse_pay/resources/mass_pay.rb
172
+ - lib/synapse_pay/resources/order.rb
173
+ - lib/synapse_pay/resources/user.rb
174
+ - lib/synapse_pay/resources/wire.rb
175
+ - lib/synapse_pay/resources/withdrawal.rb
176
+ - lib/synapse_pay/version.rb
177
+ - synapse_pay.gemspec
178
+ - test/synapse_pay/api_list_test.rb
179
+ - test/synapse_pay/api_method_test.rb
180
+ - test/synapse_pay/headers_builder_test.rb
181
+ - test/synapse_pay/params_builder_test.rb
182
+ - test/synapse_pay/path_builder_test.rb
183
+ - test/synapse_pay/requester_test.rb
184
+ - test/synapse_pay/util_test.rb
185
+ - test/test_data.rb
186
+ - test/test_helper.rb
187
+ homepage: http://synapsepay.readme.io/v1.0/docs
188
+ licenses:
189
+ - MIT
190
+ metadata: {}
191
+ post_install_message:
192
+ rdoc_options: []
193
+ require_paths:
194
+ - lib
195
+ required_ruby_version: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ required_rubygems_version: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - ">="
203
+ - !ruby/object:Gem::Version
204
+ version: '0'
205
+ requirements: []
206
+ rubyforge_project:
207
+ rubygems_version: 2.4.5
208
+ signing_key:
209
+ specification_version: 4
210
+ summary: Ruby bindings for SynapsePay API
211
+ test_files:
212
+ - test/synapse_pay/api_list_test.rb
213
+ - test/synapse_pay/api_method_test.rb
214
+ - test/synapse_pay/headers_builder_test.rb
215
+ - test/synapse_pay/params_builder_test.rb
216
+ - test/synapse_pay/path_builder_test.rb
217
+ - test/synapse_pay/requester_test.rb
218
+ - test/synapse_pay/util_test.rb
219
+ - test/test_data.rb
220
+ - test/test_helper.rb