levelup 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +36 -0
  3. data/.rubocop.yml +427 -0
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +58 -0
  6. data/LICENSE +21 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +113 -0
  9. data/Rakefile +1 -0
  10. data/levelup.gemspec +32 -0
  11. data/lib/levelup.rb +55 -0
  12. data/lib/levelup/api.rb +102 -0
  13. data/lib/levelup/configuration.rb +23 -0
  14. data/lib/levelup/endpoints/access_tokens.rb +40 -0
  15. data/lib/levelup/endpoints/app_users.rb +30 -0
  16. data/lib/levelup/endpoints/apps.rb +30 -0
  17. data/lib/levelup/endpoints/base.rb +25 -0
  18. data/lib/levelup/endpoints/credit_cards.rb +26 -0
  19. data/lib/levelup/endpoints/location_orders.rb +32 -0
  20. data/lib/levelup/endpoints/merchant_funded_credits.rb +19 -0
  21. data/lib/levelup/endpoints/merchant_locations.rb +32 -0
  22. data/lib/levelup/endpoints/merchant_orders.rb +28 -0
  23. data/lib/levelup/endpoints/orders.rb +19 -0
  24. data/lib/levelup/endpoints/permissions_requests.rb +28 -0
  25. data/lib/levelup/endpoints/qr_codes.rb +28 -0
  26. data/lib/levelup/endpoints/specific_location.rb +24 -0
  27. data/lib/levelup/endpoints/specific_merchant.rb +28 -0
  28. data/lib/levelup/endpoints/specific_order.rb +28 -0
  29. data/lib/levelup/endpoints/specific_permissions_request.rb +26 -0
  30. data/lib/levelup/endpoints/user_addresses.rb +25 -0
  31. data/lib/levelup/endpoints/user_orders.rb +18 -0
  32. data/lib/levelup/endpoints/users.rb +16 -0
  33. data/lib/levelup/errors/invalid_request.rb +8 -0
  34. data/lib/levelup/errors/unauthenticated.rb +8 -0
  35. data/lib/levelup/requests/authenticate_app.rb +19 -0
  36. data/lib/levelup/requests/authenticate_merchant.rb +26 -0
  37. data/lib/levelup/requests/base.rb +87 -0
  38. data/lib/levelup/requests/create_address.rb +19 -0
  39. data/lib/levelup/requests/create_card.rb +21 -0
  40. data/lib/levelup/requests/create_order.rb +33 -0
  41. data/lib/levelup/requests/create_user.rb +34 -0
  42. data/lib/levelup/requests/get_order.rb +17 -0
  43. data/lib/levelup/requests/get_qr_code.rb +16 -0
  44. data/lib/levelup/requests/get_user.rb +17 -0
  45. data/lib/levelup/requests/give_merchant_credit.rb +23 -0
  46. data/lib/levelup/requests/list_addresses.rb +20 -0
  47. data/lib/levelup/requests/list_locations.rb +24 -0
  48. data/lib/levelup/requests/list_orders.rb +23 -0
  49. data/lib/levelup/requests/list_user_orders.rb +20 -0
  50. data/lib/levelup/requests/refund_order.rb +21 -0
  51. data/lib/levelup/requests/request_permissions.rb +27 -0
  52. data/lib/levelup/requests/show_permissions_request.rb +21 -0
  53. data/lib/levelup/responses/error.rb +36 -0
  54. data/lib/levelup/responses/success.rb +11 -0
  55. data/lib/levelup/templates/data_parcel.rb +41 -0
  56. data/lib/levelup/templates/merchant_and_user_authenticated.rb +21 -0
  57. data/lib/levelup/templates/merchant_authenticated.rb +19 -0
  58. data/lib/levelup/templates/user_address_data.rb +20 -0
  59. data/lib/levelup/templates/user_authenticated.rb +17 -0
  60. data/spec/data_objects/requests/authenticate_app_spec.rb +13 -0
  61. data/spec/data_objects/requests/authenticate_merchant_spec.rb +14 -0
  62. data/spec/data_objects/requests/create_order_spec.rb +14 -0
  63. data/spec/data_objects/requests/get_order_spec.rb +13 -0
  64. data/spec/data_objects/requests/list_locations_spec.rb +13 -0
  65. data/spec/data_objects/requests/list_orders_spec.rb +13 -0
  66. data/spec/data_objects/requests/refund_order_spec.rb +19 -0
  67. data/spec/data_objects/requests/request_permissions_spec.rb +21 -0
  68. data/spec/data_objects/responses/error_spec.rb +67 -0
  69. data/spec/data_objects/responses/response_spec.rb +13 -0
  70. data/spec/endpoints/access_tokens_spec.rb +81 -0
  71. data/spec/endpoints/app_users_spec.rb +43 -0
  72. data/spec/endpoints/location_orders_spec.rb +34 -0
  73. data/spec/endpoints/merchant_funded_credits_spec.rb +16 -0
  74. data/spec/endpoints/merchant_locations_spec.rb +35 -0
  75. data/spec/endpoints/orders_spec.rb +37 -0
  76. data/spec/endpoints/permissions_requests_spec.rb +22 -0
  77. data/spec/endpoints/qr_codes_spec.rb +12 -0
  78. data/spec/endpoints/specific_order_spec.rb +33 -0
  79. data/spec/endpoints/specific_permissions_request_spec.rb +24 -0
  80. data/spec/endpoints/user_addresses_spec.rb +41 -0
  81. data/spec/endpoints/user_orders_spec.rb +12 -0
  82. data/spec/fixtures/keys.yml.example +15 -0
  83. data/spec/spec_helper.rb +28 -0
  84. data/spec/support/vcr_filter_sensitive_data.rb +53 -0
  85. metadata +281 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fffe35cc46fcd692944cc88cceb1685b374cec2f
4
+ data.tar.gz: fc77b72ad732430eae0d59cc57149293d5139ff4
5
+ SHA512:
6
+ metadata.gz: 0ea9f4468368ea50a351f85538c6017cb959bf682ea53e64fa5763b18f0945d44907094caf073a4cbf28813f0029e8e177a83856820f57a92e0d01d079586f34
7
+ data.tar.gz: 76119e8ab76d59bfd30c9069b2886237bc7d83778dd8d469338efe078898bebf25d71c2ca1b80ae2c7f07cccd40d3c0cfb04084436b2081801e461b24010773d
@@ -0,0 +1,36 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/fixtures/keys.yml
9
+ /spec/fixtures/vcr_cassettes
10
+ /test/tmp/
11
+ /test/version_tmp/
12
+ /tmp/
13
+
14
+ ## Specific to RubyMotion:
15
+ .dat*
16
+ .repl_history
17
+ build/
18
+
19
+ ## Documentation cache and generated files:
20
+ /.yardoc/
21
+ /_yardoc/
22
+ /doc/
23
+ /rdoc/
24
+
25
+ ## Environment normalisation:
26
+ /.bundle/
27
+ /lib/bundler/man/
28
+
29
+ # for a library or gem, you might want to ignore these files since the code is
30
+ # intended to run in multiple environments; otherwise, check them in:
31
+ # Gemfile.lock
32
+ # .ruby-version
33
+ # .ruby-gemset
34
+
35
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
36
+ .rvmrc
@@ -0,0 +1,427 @@
1
+ # Rubocop comes with most cops enabled and some disabled by default.
2
+ # Our style guide does not match these defaults, so we explicitly enable/disable each cop below.
3
+ # We should add an entry for any cop introduced via Rubocop updates
4
+ # (with 'rubocop --auto-gen-config' helping out)
5
+
6
+ AccessModifierIndentation:
7
+ Enabled: true
8
+
9
+ AccessorMethodName:
10
+ Enabled: false
11
+
12
+ Alias:
13
+ Enabled: true
14
+
15
+ AlignArray:
16
+ Enabled: false
17
+
18
+ AlignHash:
19
+ Enabled: false
20
+
21
+ AlignParameters:
22
+ Enabled: false
23
+
24
+ AndOr:
25
+ Enabled: true
26
+
27
+ AsciiComments:
28
+ Enabled: true
29
+
30
+ AsciiIdentifiers:
31
+ Enabled: true
32
+
33
+ AssignmentInCondition:
34
+ Enabled: false
35
+
36
+ Attr:
37
+ Enabled: true
38
+
39
+ BeginBlock:
40
+ Enabled: true
41
+
42
+ BlockAlignment:
43
+ Enabled: false
44
+
45
+ BlockComments:
46
+ Enabled: true
47
+
48
+ BlockNesting:
49
+ Enabled: false
50
+
51
+ Blocks:
52
+ Enabled: false
53
+
54
+ BracesAroundHashParameters:
55
+ Enabled: false
56
+
57
+ CaseEquality:
58
+ Enabled: true
59
+
60
+ CaseIndentation:
61
+ Enabled: false
62
+
63
+ CharacterLiteral:
64
+ Enabled: true
65
+
66
+ ClassAndModuleCamelCase:
67
+ Enabled: true
68
+
69
+ ClassLength:
70
+ Enabled: false
71
+
72
+ ClassMethods:
73
+ Enabled: true
74
+
75
+ ClassVars:
76
+ Enabled: true
77
+
78
+ CollectionMethods:
79
+ Enabled: false
80
+
81
+ ColonMethodCall:
82
+ Enabled: true
83
+
84
+ CommentAnnotation:
85
+ Enabled: true
86
+
87
+ ConstantName:
88
+ Enabled: false
89
+
90
+ CyclomaticComplexity:
91
+ Enabled: false
92
+
93
+ Debugger:
94
+ Enabled: true
95
+
96
+ DefaultScope:
97
+ Enabled: true
98
+
99
+ DefWithParentheses:
100
+ Enabled: true
101
+
102
+ Documentation:
103
+ Enabled: false
104
+
105
+ DotPosition:
106
+ Enabled: false
107
+
108
+ EmptyEnsure:
109
+ Enabled: true
110
+
111
+ EmptyLineBetweenDefs:
112
+ Enabled: false
113
+
114
+ EmptyLines:
115
+ Enabled: true
116
+
117
+ EmptyLinesAroundAccessModifier:
118
+ Enabled: true
119
+
120
+ EmptyLineBetweenDefs:
121
+ AllowAdjacentOneLineDefs: true
122
+ Enabled: true
123
+
124
+ EmptyLinesAroundBody:
125
+ Enabled: true
126
+
127
+ EmptyLiteral:
128
+ Enabled: true
129
+
130
+ Encoding:
131
+ Enabled: true
132
+
133
+ EndAlignment:
134
+ Enabled: false
135
+
136
+ EndBlock:
137
+ Enabled: true
138
+
139
+ EndInMethod:
140
+ Enabled: true
141
+
142
+ EndOfLine:
143
+ Enabled: true
144
+
145
+ EnsureReturn:
146
+ Enabled: true
147
+
148
+ Eval:
149
+ Enabled: true
150
+
151
+ EvenOdd:
152
+ Enabled: true
153
+
154
+ FavorJoin:
155
+ Enabled: true
156
+
157
+ FavorSprintf:
158
+ Enabled: false
159
+
160
+ FavorUnlessOverNegatedIf:
161
+ Enabled: true
162
+
163
+ FavorUntilOverNegatedWhile:
164
+ Enabled: true
165
+
166
+ FlipFlop:
167
+ Enabled: true
168
+
169
+ FinalNewline:
170
+ Enabled: true
171
+
172
+ For:
173
+ Enabled: true
174
+
175
+ GlobalVars:
176
+ Enabled: true
177
+
178
+ HandleExceptions:
179
+ Enabled: false
180
+
181
+ HasAndBelongsToMany:
182
+ Enabled: true
183
+
184
+ HashMethods:
185
+ Enabled: true
186
+
187
+ HashSyntax:
188
+ Enabled: true
189
+
190
+ IfUnlessModifier:
191
+ Enabled: false
192
+
193
+ IfWithSemicolon:
194
+ Enabled: true
195
+
196
+ IndentationWidth:
197
+ Enabled: false
198
+
199
+ Lambda:
200
+ Enabled: false
201
+
202
+ LambdaCall:
203
+ Enabled: true
204
+
205
+ LeadingCommentSpace:
206
+ Enabled: true
207
+
208
+ LineLength:
209
+ Enabled: true
210
+ Max: 80 #differs from platform spec because it's open source
211
+
212
+ LiteralInCondition:
213
+ Enabled: true
214
+
215
+ Loop:
216
+ Enabled: false
217
+
218
+ MethodCalledOnDoEndBlock:
219
+ Enabled: false
220
+
221
+ MethodCallParentheses:
222
+ Enabled: true
223
+
224
+ MethodLength:
225
+ Enabled: false
226
+
227
+ MethodName:
228
+ Enabled: true
229
+
230
+ ModuleFunction:
231
+ Enabled: true
232
+
233
+ MultilineBlockChain:
234
+ Enabled: true
235
+
236
+ MultilineIfThen:
237
+ Enabled: true
238
+
239
+ MultilineTernaryOperator:
240
+ Enabled: true
241
+
242
+ NestedTernaryOperator:
243
+ Enabled: true
244
+
245
+ NilComparison:
246
+ Enabled: true
247
+
248
+ Not:
249
+ Enabled: true
250
+
251
+ NumericLiterals:
252
+ Enabled: false
253
+
254
+ OneLineConditional:
255
+ Enabled: true
256
+
257
+ OpMethod:
258
+ Enabled: true
259
+
260
+ Output:
261
+ Enabled: true
262
+
263
+ ParameterLists:
264
+ Enabled: false
265
+
266
+ ParenthesesAroundCondition:
267
+ Enabled: true
268
+
269
+ ParenthesesAsGroupedExpression:
270
+ Enabled: false
271
+
272
+ PerlBackrefs:
273
+ Enabled: false
274
+
275
+ PredicateName:
276
+ Enabled: false
277
+
278
+ Proc:
279
+ Enabled: false
280
+
281
+ RaiseArgs:
282
+ Enabled: true
283
+
284
+ ReadAttribute:
285
+ Enabled: true
286
+
287
+ RedundantBegin:
288
+ Enabled: true
289
+
290
+ RedundantException:
291
+ Enabled: true
292
+
293
+ RedundantReturn:
294
+ Enabled: true
295
+
296
+ RedundantSelf:
297
+ Enabled: true
298
+
299
+ RegexpLiteral:
300
+ Enabled: false
301
+
302
+ RescueException:
303
+ Enabled: true
304
+
305
+ RescueModifier:
306
+ Enabled: false
307
+
308
+ Semicolon:
309
+ Enabled: true
310
+
311
+ ShadowingOuterLocalVariable:
312
+ Enabled: true
313
+
314
+ SignalException:
315
+ Enabled: false
316
+
317
+ SingleLineBlockParams:
318
+ Enabled: true
319
+
320
+ SingleLineMethods:
321
+ Enabled: true
322
+
323
+ SpaceAfterColon:
324
+ Enabled: true
325
+
326
+ SpaceAfterComma:
327
+ Enabled: true
328
+
329
+ SpaceAfterControlKeyword:
330
+ Enabled: true
331
+
332
+ SpaceAfterMethodName:
333
+ Enabled: true
334
+
335
+ SpaceAfterNot:
336
+ Enabled: true
337
+
338
+ SpaceAfterSemicolon:
339
+ Enabled: true
340
+
341
+ SpaceAroundBlockBraces:
342
+ Enabled: true
343
+ EnforcedStyle: space_inside_braces
344
+ EnforcedStyleForEmptyBraces: no_space
345
+ SpaceBeforeBlockParameters: true
346
+
347
+ SpaceAroundEqualsInParameterDefault:
348
+ Enabled: true
349
+
350
+ SpaceAroundOperators:
351
+ Enabled: true
352
+
353
+ SpaceBeforeModifierKeyword:
354
+ Enabled: true
355
+
356
+ SpaceInsideBrackets:
357
+ Enabled: true
358
+
359
+ SpaceInsideHashLiteralBraces:
360
+ Enabled: true
361
+
362
+ SpaceInsideParens:
363
+ Enabled: true
364
+
365
+ SpecialGlobalVars:
366
+ Enabled: true
367
+
368
+ StringLiterals:
369
+ Enabled: false
370
+
371
+ SymbolArray:
372
+ Enabled: false
373
+
374
+ Syntax:
375
+ Enabled: false
376
+
377
+ Tab:
378
+ Enabled: true
379
+
380
+ TrailingBlankLines:
381
+ Enabled: true
382
+
383
+ TrailingWhitespace:
384
+ Enabled: true
385
+
386
+ TrivialAccessors:
387
+ Enabled: false
388
+
389
+ UnlessElse:
390
+ Enabled: true
391
+
392
+ UnreachableCode:
393
+ Enabled: true
394
+
395
+ UselessAssignment:
396
+ Enabled: false
397
+
398
+ UselessComparison:
399
+ Enabled: true
400
+
401
+ UselessSetterCall:
402
+ Enabled: true
403
+
404
+ Validation:
405
+ Enabled: true
406
+
407
+ VariableInterpolation:
408
+ Enabled: true
409
+
410
+ VariableName:
411
+ Enabled: true
412
+ EnforcedStyle: snake_case
413
+
414
+ Void:
415
+ Enabled: false
416
+
417
+ WhenThen:
418
+ Enabled: true
419
+
420
+ WhileUntilDo:
421
+ Enabled: true
422
+
423
+ WhileUntilModifier:
424
+ Enabled: false
425
+
426
+ WordArray:
427
+ Enabled: false