webpay 3.2.2 → 3.2.3

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: 3f621f9ffa54470ac55669273b03993e653fbf43
4
- data.tar.gz: 54f9faa7ca6431f08a5c185c379c27038a4f38a8
3
+ metadata.gz: c520623358d01e909c05e6e57c1562f100b9d76d
4
+ data.tar.gz: 1bf343f86ec973acc2ad717cc0c5bf643731b0ec
5
5
  SHA512:
6
- metadata.gz: e79199cccb030c29b8a07b1dc50c2a79b8089d4e73b1ff5a5bf29d043d2b0fbf29629dbbf2186a4c920852474c7a601b18f385b0fbcf728377a7815f8b689101
7
- data.tar.gz: fd1f5f13d4fa2dde32059c6cf57e8573189520c726839c8a48879a86657d463af374634aea146b9de517f17b089ad199dd079417b025d60f112e8c31210a5af6
6
+ metadata.gz: 04866d38750c23561818093fa9d30ab43c6fce735e886a6eae1cb603522cecc5c312c0ec2c15a5c2063e606ab2ddf31fc1dfcba88bc5d2af50d083baeb501504
7
+ data.tar.gz: ac59b6429d523c3a393a262bbf6b9d448dec81bddcaae137f6b83b9ea0976f44651f795cb12f610127967d2eae7c5de215727123f57f05e165a2e2cae50c4b54
@@ -30,7 +30,7 @@ class WebPay
30
30
 
31
31
  "Accept" => "application/json",
32
32
 
33
- "User-Agent" => "Apipa-webpay/3.2.2 ruby",
33
+ "User-Agent" => "Apipa-webpay/3.2.3 ruby",
34
34
 
35
35
  "Accept-Language" => "en",
36
36
  }
@@ -113,6 +113,7 @@ class WebPay
113
113
  rescue JSON_CLASS::ParserError => e
114
114
  raise WebPay::ApiConnectionError.invalid_json(e)
115
115
  end
116
+ data ||= {}
116
117
  status = response.status
117
118
  case status
118
119
  when 200..299
@@ -1,5 +1,5 @@
1
1
  class WebPay::Account < WebPay::ApiResource
2
- # Retrieve information of the current user
2
+ # Retrieve information of the current user.
3
3
  #
4
4
  # @param params [EmptyRequest|Hash] Parameters to API call
5
5
  # @return [AccountResponse]
@@ -9,7 +9,7 @@ class WebPay::Account < WebPay::ApiResource
9
9
  WebPay::AccountResponse.new(raw_response)
10
10
  end
11
11
 
12
- # Delete all test data of this account
12
+ # Delete all test data of this account.
13
13
  #
14
14
  # @param params [EmptyRequest|Hash] Parameters to API call
15
15
  # @return [DeletedResponse]
@@ -10,7 +10,7 @@ class WebPay::Charge < WebPay::ApiResource
10
10
  WebPay::ChargeResponse.new(raw_response)
11
11
  end
12
12
 
13
- # Retrieve a existing charge object by charge id
13
+ # Retrieve a existing charge object by charge id.
14
14
  #
15
15
  # @param params [ChargeIdRequest|Hash] Parameters to API call
16
16
  # @return [ChargeResponse]
@@ -31,7 +31,7 @@ class WebPay::Charge < WebPay::ApiResource
31
31
  WebPay::ChargeResponse.new(raw_response)
32
32
  end
33
33
 
34
- # Capture a not captured charge specified by charge id
34
+ # Capture a not captured charge specified by charge id.
35
35
  #
36
36
  # @param params [ChargeRequestWithAmount|Hash] Parameters to API call
37
37
  # @return [ChargeResponse]
@@ -41,7 +41,7 @@ class WebPay::Charge < WebPay::ApiResource
41
41
  WebPay::ChargeResponse.new(raw_response)
42
42
  end
43
43
 
44
- # List charges filtered by params
44
+ # List charges filtered by params.
45
45
  #
46
46
  # @param params [ChargeListRequest|Hash] Parameters to API call
47
47
  # @return [ChargeResponseList]
@@ -20,7 +20,7 @@ class WebPay::Customer < WebPay::ApiResource
20
20
  WebPay::CustomerResponse.new(raw_response)
21
21
  end
22
22
 
23
- # Update an existing customer with specified parameters
23
+ # Update an existing customer with specified parameters.
24
24
  #
25
25
  # @param params [CustomerRequestUpdate|Hash] Parameters to API call
26
26
  # @return [CustomerResponse]
@@ -30,7 +30,7 @@ class WebPay::Customer < WebPay::ApiResource
30
30
  WebPay::CustomerResponse.new(raw_response)
31
31
  end
32
32
 
33
- # Delete an existing customer
33
+ # Delete an existing customer.
34
34
  #
35
35
  # @param params [CustomerIdRequest|Hash] Parameters to API call
36
36
  # @return [CustomerResponse]
@@ -40,7 +40,7 @@ class WebPay::Customer < WebPay::ApiResource
40
40
  WebPay::CustomerResponse.new(raw_response)
41
41
  end
42
42
 
43
- # List customers filtered by params
43
+ # List customers filtered by params.
44
44
  #
45
45
  # @param params [BasicListRequest|Hash] Parameters to API call
46
46
  # @return [CustomerResponseList]
@@ -50,7 +50,7 @@ class WebPay::Customer < WebPay::ApiResource
50
50
  WebPay::CustomerResponseList.new(raw_response)
51
51
  end
52
52
 
53
- # Delete a card data of a customer
53
+ # Delete a card data of a customer.
54
54
  #
55
55
  # @param params [CustomerIdRequest|Hash] Parameters to API call
56
56
  # @return [CustomerResponse]
@@ -44,88 +44,6 @@ class WebPay
44
44
  end
45
45
  end
46
46
 
47
- class CardRequest < Entity
48
- attr_reader :attributes
49
-
50
- def self.fields
51
- ['number', 'exp_month', 'exp_year', 'cvc', 'name']
52
- end
53
-
54
-
55
- def self.create(params)
56
- return params if params.is_a?(self)
57
- hash = case params
58
- when Hash; params
59
- else
60
- raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
61
- end
62
- self.new(hash)
63
- end
64
-
65
- def initialize(hash = {})
66
- hash = normalize_hash(hash)
67
- @attributes = hash
68
- end
69
-
70
-
71
- def request_body
72
- result = {}
73
- copy_if_exists(@attributes, result, 'number', 'request_body');
74
- copy_if_exists(@attributes, result, 'exp_month', 'request_body');
75
- copy_if_exists(@attributes, result, 'exp_year', 'request_body');
76
- copy_if_exists(@attributes, result, 'cvc', 'request_body');
77
- copy_if_exists(@attributes, result, 'name', 'request_body');
78
- result
79
- end
80
-
81
- def query_params
82
- result = {}
83
- return result
84
- end
85
-
86
-
87
- # attributes accessors
88
- def number
89
- attributes['number']
90
- end
91
-
92
- def number=(value)
93
- attributes['number'] = value
94
- end
95
-
96
- def exp_month
97
- attributes['exp_month']
98
- end
99
-
100
- def exp_month=(value)
101
- attributes['exp_month'] = value
102
- end
103
-
104
- def exp_year
105
- attributes['exp_year']
106
- end
107
-
108
- def exp_year=(value)
109
- attributes['exp_year'] = value
110
- end
111
-
112
- def cvc
113
- attributes['cvc']
114
- end
115
-
116
- def cvc=(value)
117
- attributes['cvc'] = value
118
- end
119
-
120
- def name
121
- attributes['name']
122
- end
123
-
124
- def name=(value)
125
- attributes['name'] = value
126
- end
127
-
128
- end
129
47
  class ChargeRequestCreate < Entity
130
48
  attr_reader :attributes
131
49
 
@@ -246,97 +164,85 @@ class WebPay
246
164
  end
247
165
 
248
166
  end
249
- class CardResponse < Entity
167
+ class CardRequest < Entity
250
168
  attr_reader :attributes
251
169
 
252
170
  def self.fields
253
- ['object', 'exp_month', 'exp_year', 'fingerprint', 'last4', 'type', 'cvc_check', 'name', 'country']
171
+ ['number', 'exp_month', 'exp_year', 'cvc', 'name']
254
172
  end
255
173
 
256
174
 
175
+ def self.create(params)
176
+ return params if params.is_a?(self)
177
+ hash = case params
178
+ when Hash; params
179
+ else
180
+ raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
181
+ end
182
+ self.new(hash)
183
+ end
184
+
257
185
  def initialize(hash = {})
258
186
  hash = normalize_hash(hash)
259
187
  @attributes = hash
260
188
  end
261
189
 
262
190
 
263
-
264
- # attributes accessors
265
- def object
266
- attributes['object']
267
- end
268
-
269
- def exp_month
270
- attributes['exp_month']
271
- end
272
-
273
- def exp_year
274
- attributes['exp_year']
275
- end
276
-
277
- def fingerprint
278
- attributes['fingerprint']
279
- end
280
-
281
- def last4
282
- attributes['last4']
191
+ def request_body
192
+ result = {}
193
+ copy_if_exists(@attributes, result, 'number', 'request_body');
194
+ copy_if_exists(@attributes, result, 'exp_month', 'request_body');
195
+ copy_if_exists(@attributes, result, 'exp_year', 'request_body');
196
+ copy_if_exists(@attributes, result, 'cvc', 'request_body');
197
+ copy_if_exists(@attributes, result, 'name', 'request_body');
198
+ result
283
199
  end
284
200
 
285
- def type
286
- attributes['type']
201
+ def query_params
202
+ result = {}
203
+ return result
287
204
  end
288
205
 
289
- def cvc_check
290
- attributes['cvc_check']
291
- end
292
206
 
293
- def name
294
- attributes['name']
207
+ # attributes accessors
208
+ def number
209
+ attributes['number']
295
210
  end
296
211
 
297
- def country
298
- attributes['country']
212
+ def number=(value)
213
+ attributes['number'] = value
299
214
  end
300
215
 
301
- end
302
- class ChargeFeeResponse < Entity
303
- attr_reader :attributes
304
-
305
- def self.fields
306
- ['object', 'transaction_type', 'transaction_fee', 'rate', 'amount', 'created']
216
+ def exp_month
217
+ attributes['exp_month']
307
218
  end
308
219
 
309
-
310
- def initialize(hash = {})
311
- hash = normalize_hash(hash)
312
- @attributes = hash
220
+ def exp_month=(value)
221
+ attributes['exp_month'] = value
313
222
  end
314
223
 
315
-
316
-
317
- # attributes accessors
318
- def object
319
- attributes['object']
224
+ def exp_year
225
+ attributes['exp_year']
320
226
  end
321
227
 
322
- def transaction_type
323
- attributes['transaction_type']
228
+ def exp_year=(value)
229
+ attributes['exp_year'] = value
324
230
  end
325
231
 
326
- def transaction_fee
327
- attributes['transaction_fee']
232
+ def cvc
233
+ attributes['cvc']
328
234
  end
329
235
 
330
- def rate
331
- attributes['rate']
236
+ def cvc=(value)
237
+ attributes['cvc'] = value
332
238
  end
333
239
 
334
- def amount
335
- attributes['amount']
240
+ def name
241
+ attributes['name']
336
242
  end
337
243
 
338
- def created
339
- attributes['created']
244
+ def name=(value)
245
+ attributes['name'] = value
340
246
  end
341
247
 
342
248
  end
@@ -431,58 +337,105 @@ class WebPay
431
337
  end
432
338
 
433
339
  end
434
- class ChargeIdRequest < Entity
340
+ class CardResponse < Entity
435
341
  attr_reader :attributes
436
342
 
437
343
  def self.fields
438
- ['id']
344
+ ['object', 'exp_month', 'exp_year', 'fingerprint', 'last4', 'type', 'cvc_check', 'name', 'country']
439
345
  end
440
346
 
441
347
 
442
- def self.create(params)
443
- return params if params.is_a?(self)
444
- hash = case params
445
- when Hash; params
446
- when WebPay::ChargeResponse; {'id' => params.id}
447
- when String; {'id' => params}
448
- else
449
- raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
450
- end
451
- self.new(hash)
348
+ def initialize(hash = {})
349
+ hash = normalize_hash(hash)
350
+ @attributes = hash
351
+ end
352
+
353
+
354
+
355
+ # attributes accessors
356
+ def object
357
+ attributes['object']
358
+ end
359
+
360
+ def exp_month
361
+ attributes['exp_month']
362
+ end
363
+
364
+ def exp_year
365
+ attributes['exp_year']
452
366
  end
453
367
 
368
+ def fingerprint
369
+ attributes['fingerprint']
370
+ end
371
+
372
+ def last4
373
+ attributes['last4']
374
+ end
375
+
376
+ def type
377
+ attributes['type']
378
+ end
379
+
380
+ def cvc_check
381
+ attributes['cvc_check']
382
+ end
383
+
384
+ def name
385
+ attributes['name']
386
+ end
387
+
388
+ def country
389
+ attributes['country']
390
+ end
391
+
392
+ end
393
+ class ChargeFeeResponse < Entity
394
+ attr_reader :attributes
395
+
396
+ def self.fields
397
+ ['object', 'transaction_type', 'transaction_fee', 'rate', 'amount', 'created']
398
+ end
399
+
400
+
454
401
  def initialize(hash = {})
455
402
  hash = normalize_hash(hash)
456
403
  @attributes = hash
457
404
  end
458
405
 
459
406
 
460
- def request_body
461
- result = {}
462
- result
407
+
408
+ # attributes accessors
409
+ def object
410
+ attributes['object']
463
411
  end
464
412
 
465
- def query_params
466
- result = {}
467
- return result
413
+ def transaction_type
414
+ attributes['transaction_type']
415
+ end
416
+
417
+ def transaction_fee
418
+ attributes['transaction_fee']
468
419
  end
469
420
 
421
+ def rate
422
+ attributes['rate']
423
+ end
470
424
 
471
- # attributes accessors
472
- def id
473
- attributes['id']
425
+ def amount
426
+ attributes['amount']
474
427
  end
475
428
 
476
- def id=(value)
477
- attributes['id'] = value
429
+ def created
430
+ attributes['created']
478
431
  end
479
432
 
480
433
  end
481
- class ChargeRequestRefund < Entity
434
+ class ChargeIdRequest < Entity
482
435
  attr_reader :attributes
483
436
 
484
437
  def self.fields
485
- ['id', 'amount', 'uuid']
438
+ ['id']
486
439
  end
487
440
 
488
441
 
@@ -506,8 +459,6 @@ class WebPay
506
459
 
507
460
  def request_body
508
461
  result = {}
509
- copy_if_exists(@attributes, result, 'amount', 'request_body');
510
- copy_if_exists(@attributes, result, 'uuid', 'request_body');
511
462
  result
512
463
  end
513
464
 
@@ -526,28 +477,12 @@ class WebPay
526
477
  attributes['id'] = value
527
478
  end
528
479
 
529
- def amount
530
- attributes['amount']
531
- end
532
-
533
- def amount=(value)
534
- attributes['amount'] = value
535
- end
536
-
537
- def uuid
538
- attributes['uuid']
539
- end
540
-
541
- def uuid=(value)
542
- attributes['uuid'] = value
543
- end
544
-
545
480
  end
546
- class ChargeRequestWithAmount < Entity
481
+ class ChargeRequestRefund < Entity
547
482
  attr_reader :attributes
548
483
 
549
484
  def self.fields
550
- ['id', 'amount']
485
+ ['id', 'amount', 'uuid']
551
486
  end
552
487
 
553
488
 
@@ -572,6 +507,7 @@ class WebPay
572
507
  def request_body
573
508
  result = {}
574
509
  copy_if_exists(@attributes, result, 'amount', 'request_body');
510
+ copy_if_exists(@attributes, result, 'uuid', 'request_body');
575
511
  result
576
512
  end
577
513
 
@@ -598,12 +534,20 @@ class WebPay
598
534
  attributes['amount'] = value
599
535
  end
600
536
 
537
+ def uuid
538
+ attributes['uuid']
539
+ end
540
+
541
+ def uuid=(value)
542
+ attributes['uuid'] = value
543
+ end
544
+
601
545
  end
602
- class CreatedRange < Entity
546
+ class ChargeRequestWithAmount < Entity
603
547
  attr_reader :attributes
604
548
 
605
549
  def self.fields
606
- ['gt', 'gte', 'lt', 'lte']
550
+ ['id', 'amount']
607
551
  end
608
552
 
609
553
 
@@ -611,6 +555,8 @@ class WebPay
611
555
  return params if params.is_a?(self)
612
556
  hash = case params
613
557
  when Hash; params
558
+ when WebPay::ChargeResponse; {'id' => params.id}
559
+ when String; {'id' => params}
614
560
  else
615
561
  raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
616
562
  end
@@ -625,50 +571,31 @@ class WebPay
625
571
 
626
572
  def request_body
627
573
  result = {}
574
+ copy_if_exists(@attributes, result, 'amount', 'request_body');
628
575
  result
629
576
  end
630
577
 
631
578
  def query_params
632
579
  result = {}
633
- copy_if_exists(@attributes, result, 'gt', 'query_params');
634
- copy_if_exists(@attributes, result, 'gte', 'query_params');
635
- copy_if_exists(@attributes, result, 'lt', 'query_params');
636
- copy_if_exists(@attributes, result, 'lte', 'query_params');
637
580
  return result
638
581
  end
639
582
 
640
583
 
641
584
  # attributes accessors
642
- def gt
643
- attributes['gt']
644
- end
645
-
646
- def gt=(value)
647
- attributes['gt'] = value
648
- end
649
-
650
- def gte
651
- attributes['gte']
652
- end
653
-
654
- def gte=(value)
655
- attributes['gte'] = value
656
- end
657
-
658
- def lt
659
- attributes['lt']
585
+ def id
586
+ attributes['id']
660
587
  end
661
588
 
662
- def lt=(value)
663
- attributes['lt'] = value
589
+ def id=(value)
590
+ attributes['id'] = value
664
591
  end
665
592
 
666
- def lte
667
- attributes['lte']
593
+ def amount
594
+ attributes['amount']
668
595
  end
669
596
 
670
- def lte=(value)
671
- attributes['lte'] = value
597
+ def amount=(value)
598
+ attributes['amount'] = value
672
599
  end
673
600
 
674
601
  end
@@ -782,6 +709,79 @@ class WebPay
782
709
  attributes['paid'] = value
783
710
  end
784
711
 
712
+ end
713
+ class CreatedRange < Entity
714
+ attr_reader :attributes
715
+
716
+ def self.fields
717
+ ['gt', 'gte', 'lt', 'lte']
718
+ end
719
+
720
+
721
+ def self.create(params)
722
+ return params if params.is_a?(self)
723
+ hash = case params
724
+ when Hash; params
725
+ else
726
+ raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
727
+ end
728
+ self.new(hash)
729
+ end
730
+
731
+ def initialize(hash = {})
732
+ hash = normalize_hash(hash)
733
+ @attributes = hash
734
+ end
735
+
736
+
737
+ def request_body
738
+ result = {}
739
+ result
740
+ end
741
+
742
+ def query_params
743
+ result = {}
744
+ copy_if_exists(@attributes, result, 'gt', 'query_params');
745
+ copy_if_exists(@attributes, result, 'gte', 'query_params');
746
+ copy_if_exists(@attributes, result, 'lt', 'query_params');
747
+ copy_if_exists(@attributes, result, 'lte', 'query_params');
748
+ return result
749
+ end
750
+
751
+
752
+ # attributes accessors
753
+ def gt
754
+ attributes['gt']
755
+ end
756
+
757
+ def gt=(value)
758
+ attributes['gt'] = value
759
+ end
760
+
761
+ def gte
762
+ attributes['gte']
763
+ end
764
+
765
+ def gte=(value)
766
+ attributes['gte'] = value
767
+ end
768
+
769
+ def lt
770
+ attributes['lt']
771
+ end
772
+
773
+ def lt=(value)
774
+ attributes['lt'] = value
775
+ end
776
+
777
+ def lte
778
+ attributes['lte']
779
+ end
780
+
781
+ def lte=(value)
782
+ attributes['lte'] = value
783
+ end
784
+
785
785
  end
786
786
  class ChargeResponseList < Entity
787
787
  attr_reader :attributes
@@ -892,16 +892,18 @@ class WebPay
892
892
  end
893
893
 
894
894
  end
895
- class RecursionResponse < Entity
895
+ class CustomerResponse < Entity
896
896
  attr_reader :attributes
897
897
 
898
898
  def self.fields
899
- ['id', 'object', 'livemode', 'created', 'amount', 'currency', 'period', 'description', 'customer', 'shop', 'last_executed', 'next_scheduled', 'status', 'deleted']
899
+ ['id', 'object', 'livemode', 'created', 'active_card', 'description', 'email', 'recursions', 'deleted']
900
900
  end
901
901
 
902
902
 
903
903
  def initialize(hash = {})
904
904
  hash = normalize_hash(hash)
905
+ hash['active_card'] = WebPay::CardResponse.new(hash['active_card']) if hash['active_card'].is_a?(Hash)
906
+ hash['recursions'] = hash['recursions'].is_a?(Array) ? hash['recursions'].map { |x| WebPay::RecursionResponse.new(x) if x.is_a?(Hash) } : hash['recursions']
905
907
  hash['deleted'] ||= false
906
908
  @attributes = hash
907
909
  end
@@ -925,40 +927,20 @@ class WebPay
925
927
  attributes['created']
926
928
  end
927
929
 
928
- def amount
929
- attributes['amount']
930
- end
931
-
932
- def currency
933
- attributes['currency']
934
- end
935
-
936
- def period
937
- attributes['period']
930
+ def active_card
931
+ attributes['active_card']
938
932
  end
939
933
 
940
934
  def description
941
935
  attributes['description']
942
936
  end
943
937
 
944
- def customer
945
- attributes['customer']
946
- end
947
-
948
- def shop
949
- attributes['shop']
950
- end
951
-
952
- def last_executed
953
- attributes['last_executed']
954
- end
955
-
956
- def next_scheduled
957
- attributes['next_scheduled']
938
+ def email
939
+ attributes['email']
958
940
  end
959
941
 
960
- def status
961
- attributes['status']
942
+ def recursions
943
+ attributes['recursions']
962
944
  end
963
945
 
964
946
  def deleted
@@ -966,18 +948,16 @@ class WebPay
966
948
  end
967
949
 
968
950
  end
969
- class CustomerResponse < Entity
951
+ class RecursionResponse < Entity
970
952
  attr_reader :attributes
971
953
 
972
954
  def self.fields
973
- ['id', 'object', 'livemode', 'created', 'active_card', 'description', 'email', 'recursions', 'deleted']
955
+ ['id', 'object', 'livemode', 'created', 'amount', 'currency', 'period', 'description', 'customer', 'shop', 'last_executed', 'next_scheduled', 'status', 'deleted']
974
956
  end
975
957
 
976
958
 
977
959
  def initialize(hash = {})
978
960
  hash = normalize_hash(hash)
979
- hash['active_card'] = WebPay::CardResponse.new(hash['active_card']) if hash['active_card'].is_a?(Hash)
980
- hash['recursions'] = hash['recursions'].is_a?(Array) ? hash['recursions'].map { |x| WebPay::RecursionResponse.new(x) if x.is_a?(Hash) } : hash['recursions']
981
961
  hash['deleted'] ||= false
982
962
  @attributes = hash
983
963
  end
@@ -1001,20 +981,40 @@ class WebPay
1001
981
  attributes['created']
1002
982
  end
1003
983
 
1004
- def active_card
1005
- attributes['active_card']
984
+ def amount
985
+ attributes['amount']
986
+ end
987
+
988
+ def currency
989
+ attributes['currency']
990
+ end
991
+
992
+ def period
993
+ attributes['period']
1006
994
  end
1007
995
 
1008
996
  def description
1009
997
  attributes['description']
1010
998
  end
1011
999
 
1012
- def email
1013
- attributes['email']
1000
+ def customer
1001
+ attributes['customer']
1014
1002
  end
1015
1003
 
1016
- def recursions
1017
- attributes['recursions']
1004
+ def shop
1005
+ attributes['shop']
1006
+ end
1007
+
1008
+ def last_executed
1009
+ attributes['last_executed']
1010
+ end
1011
+
1012
+ def next_scheduled
1013
+ attributes['next_scheduled']
1014
+ end
1015
+
1016
+ def status
1017
+ attributes['status']
1018
1018
  end
1019
1019
 
1020
1020
  def deleted
@@ -1447,40 +1447,6 @@ class WebPay
1447
1447
  attributes['id'] = value
1448
1448
  end
1449
1449
 
1450
- end
1451
- class EventData < Entity
1452
- attr_reader :attributes
1453
-
1454
- def self.fields
1455
- ['object', 'previous_attributes']
1456
- end
1457
-
1458
-
1459
- def initialize(hash = {})
1460
- hash = normalize_hash(hash)
1461
- hash['object'] =
1462
- case hash['object'].is_a?(Hash) && hash['object']['object']
1463
- when 'charge'; WebPay::ChargeResponse.new(hash['object'])
1464
- when 'customer'; WebPay::CustomerResponse.new(hash['object'])
1465
- when 'shop'; WebPay::ShopResponse.new(hash['object'])
1466
- when 'recursion'; WebPay::RecursionResponse.new(hash['object'])
1467
- when 'account'; WebPay::AccountResponse.new(hash['object'])
1468
- else; hash['object']
1469
- end
1470
- @attributes = hash
1471
- end
1472
-
1473
-
1474
-
1475
- # attributes accessors
1476
- def object
1477
- attributes['object']
1478
- end
1479
-
1480
- def previous_attributes
1481
- attributes['previous_attributes']
1482
- end
1483
-
1484
1450
  end
1485
1451
  class EventResponse < Entity
1486
1452
  attr_reader :attributes
@@ -1531,6 +1497,41 @@ class WebPay
1531
1497
  attributes['shop']
1532
1498
  end
1533
1499
 
1500
+ end
1501
+ class EventData < Entity
1502
+ attr_reader :attributes
1503
+
1504
+ def self.fields
1505
+ ['object', 'previous_attributes']
1506
+ end
1507
+
1508
+
1509
+ def initialize(hash = {})
1510
+ hash = normalize_hash(hash)
1511
+ hash['object'] =
1512
+ case hash['object'].is_a?(Hash) && hash['object']['object']
1513
+ when 'account'; AccountResponse.new(hash['object'])
1514
+ when 'charge'; ChargeResponse.new(hash['object'])
1515
+ when 'customer'; CustomerResponse.new(hash['object'])
1516
+ when 'recursion'; RecursionResponse.new(hash['object'])
1517
+ when 'shop'; ShopResponse.new(hash['object'])
1518
+ else; hash['object']
1519
+ end
1520
+
1521
+ @attributes = hash
1522
+ end
1523
+
1524
+
1525
+
1526
+ # attributes accessors
1527
+ def object
1528
+ attributes['object']
1529
+ end
1530
+
1531
+ def previous_attributes
1532
+ attributes['previous_attributes']
1533
+ end
1534
+
1534
1535
  end
1535
1536
  class EventListRequest < Entity
1536
1537
  attr_reader :attributes
@@ -2409,6 +2410,28 @@ class WebPay
2409
2410
  attributes['deleted']
2410
2411
  end
2411
2412
 
2413
+ end
2414
+ class ErrorData < Entity
2415
+ attr_reader :attributes
2416
+
2417
+ def self.fields
2418
+ ['error']
2419
+ end
2420
+
2421
+
2422
+ def initialize(hash = {})
2423
+ hash = normalize_hash(hash)
2424
+ hash['error'] = WebPay::ErrorBody.new(hash['error']) if hash['error'].is_a?(Hash)
2425
+ @attributes = hash
2426
+ end
2427
+
2428
+
2429
+
2430
+ # attributes accessors
2431
+ def error
2432
+ attributes['error']
2433
+ end
2434
+
2412
2435
  end
2413
2436
  class ErrorBody < Entity
2414
2437
  attr_reader :attributes
@@ -2451,26 +2474,4 @@ class WebPay
2451
2474
  end
2452
2475
 
2453
2476
  end
2454
- class ErrorData < Entity
2455
- attr_reader :attributes
2456
-
2457
- def self.fields
2458
- ['error']
2459
- end
2460
-
2461
-
2462
- def initialize(hash = {})
2463
- hash = normalize_hash(hash)
2464
- hash['error'] = WebPay::ErrorBody.new(hash['error']) if hash['error'].is_a?(Hash)
2465
- @attributes = hash
2466
- end
2467
-
2468
-
2469
-
2470
- # attributes accessors
2471
- def error
2472
- attributes['error']
2473
- end
2474
-
2475
- end
2476
2477
  end
@@ -9,7 +9,7 @@ class WebPay::Event < WebPay::ApiResource
9
9
  WebPay::EventResponse.new(raw_response)
10
10
  end
11
11
 
12
- # List events filtered by params
12
+ # List events filtered by params.
13
13
  #
14
14
  # @param params [EventListRequest|Hash] Parameters to API call
15
15
  # @return [EventResponseList]
@@ -20,7 +20,7 @@ class WebPay::Recursion < WebPay::ApiResource
20
20
  WebPay::RecursionResponse.new(raw_response)
21
21
  end
22
22
 
23
- # Resume a suspended recursion
23
+ # Resume a suspended recursion.
24
24
  #
25
25
  # @param params [RecursionRequestResume|Hash] Parameters to API call
26
26
  # @return [RecursionResponse]
@@ -30,7 +30,7 @@ class WebPay::Recursion < WebPay::ApiResource
30
30
  WebPay::RecursionResponse.new(raw_response)
31
31
  end
32
32
 
33
- # Delete an existing recursion
33
+ # Delete an existing recursion.
34
34
  #
35
35
  # @param params [RecursionIdRequest|Hash] Parameters to API call
36
36
  # @return [RecursionResponse]
@@ -40,7 +40,7 @@ class WebPay::Recursion < WebPay::ApiResource
40
40
  WebPay::RecursionResponse.new(raw_response)
41
41
  end
42
42
 
43
- # List recursions filtered by params
43
+ # List recursions filtered by params.
44
44
  #
45
45
  # @param params [RecursionListRequest|Hash] Parameters to API call
46
46
  # @return [RecursionResponseList]
@@ -19,7 +19,7 @@ class WebPay::Shop < WebPay::ApiResource
19
19
  WebPay::ShopResponse.new(raw_response)
20
20
  end
21
21
 
22
- # Update an existing shop with specified parameters
22
+ # Update an existing shop with specified parameters.
23
23
  #
24
24
  # @param params [ShopRequestUpdate|Hash] Parameters to API call
25
25
  # @return [ShopResponse]
@@ -29,7 +29,7 @@ class WebPay::Shop < WebPay::ApiResource
29
29
  WebPay::ShopResponse.new(raw_response)
30
30
  end
31
31
 
32
- # Alter the test shop's status to the specified one
32
+ # Alter the test shop's status to the specified one.
33
33
  #
34
34
  # @param params [ShopRequestAlterStatus|Hash] Parameters to API call
35
35
  # @return [ShopResponse]
@@ -39,7 +39,7 @@ class WebPay::Shop < WebPay::ApiResource
39
39
  WebPay::ShopResponse.new(raw_response)
40
40
  end
41
41
 
42
- # List shops filtered by params
42
+ # List shops filtered by params.
43
43
  #
44
44
  # @param params [BasicListRequest|Hash] Parameters to API call
45
45
  # @return [ShopResponseList]
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'webpay'
5
- spec.version = '3.2.2'
5
+ spec.version = '3.2.3'
6
6
  spec.authors = ['webpay', 'tomykaira']
7
7
  spec.email = ['administrators@webpay.jp', 'tomykaira@webpay.jp']
8
- spec.description = 'WebPay is payment gateway service in Japan. see also https://webpay.jp/'
8
+ spec.description = 'WebPay is payment gateway service in Japan. See also https://webpay.jp/.'
9
9
  spec.summary = 'Bindings of WebPay API'
10
- spec.homepage = 'https://webpay.jp'
10
+ spec.homepage = 'https://webpay.jp/docs/api/ruby'
11
11
  spec.license = 'MIT'
12
12
 
13
13
  spec.files = File.read(File.expand_path(File.join(__FILE__, "..", "FILELIST"))).split("\n")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - webpay
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-19 00:00:00.000000000 Z
12
+ date: 2015-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -53,7 +53,7 @@ dependencies:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
55
  version: 10.3.1
56
- description: WebPay is payment gateway service in Japan. see also https://webpay.jp/
56
+ description: WebPay is payment gateway service in Japan. See also https://webpay.jp/.
57
57
  email:
58
58
  - administrators@webpay.jp
59
59
  - tomykaira@webpay.jp
@@ -76,7 +76,7 @@ files:
76
76
  - lib/webpay/shop.rb
77
77
  - lib/webpay/token.rb
78
78
  - webpay.gemspec
79
- homepage: https://webpay.jp
79
+ homepage: https://webpay.jp/docs/api/ruby
80
80
  licenses:
81
81
  - MIT
82
82
  metadata: {}