webpay 3.0.0 → 3.0.1

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
  SHA1:
3
- metadata.gz: f2ca7bfa04c0ed68afb5b9d18d21fc794512a981
4
- data.tar.gz: 83ca5f17ae63b12de47a2be3a1588bed74235b49
3
+ metadata.gz: 1223d7691b96e04b2b402559469879005904b623
4
+ data.tar.gz: 06adb123e708121a8344bb27195fc08f0689c5f1
5
5
  SHA512:
6
- metadata.gz: 5a0f1c55019eba364a5f2c1b3d855e2d85704e9a668781268854cb8291cc3555cfad2612c82a34900e31b28f09834afbab85ae1e79aed6bf6c4b0c2c67d62e57
7
- data.tar.gz: fe64c67d719db5755d6876915c9b66f6a2ce75c16b80fd3002c82e7611d992fd2dfd274f580c0eb268648cd3b3b2f09d443ceb028e0760afa15c60b159eef244
6
+ metadata.gz: 849b139e4d784eda4c838c22bc3c9cdc6a08ad023b45f8b6a27d9b9e6b9b763164f5285bcc22b92963be2400595e61fe04d7a880c8d791a0752368c558440931
7
+ data.tar.gz: a09359f1a3229ddc265df98040b78efd90032f4b5b76aef9574ffc178dfe69c97a79b57007fd2e16e3ecb564824e2a9607be987f88ac2541028745ad6908d14b
@@ -20,14 +20,14 @@ class WebPay
20
20
  # Initialize client
21
21
  #
22
22
  # @param options [Hash] options
23
- def initialize(options)
23
+ def initialize(auth_token, options = {})
24
24
  options = options.each_with_object({}) { |kv, obj| k,v = kv; obj[k.to_s] = v }
25
25
 
26
26
  connection_options = options['faraday_options'] || {}
27
27
  connection_options['headers'] = {
28
28
  "Content-Type" => "application/json",
29
29
  "Accept" => "application/json",
30
- "User-Agent" => "Apipa-webpay/3.0.0 ruby",
30
+ "User-Agent" => "Apipa-webpay/3.0.1 ruby",
31
31
  "Accept-Language" => "en",
32
32
  }
33
33
  connection_options['url'] = options['api_base'] || 'https://api.webpay.jp/v1'
@@ -37,7 +37,7 @@ class WebPay
37
37
  end
38
38
 
39
39
 
40
- @conn.authorization(:Bearer, options['api_key'])
40
+ @conn.authorization(:Bearer, auth_token)
41
41
 
42
42
  @charge = WebPay::Charge.new(self)
43
43
  @customer = WebPay::Customer.new(self)
@@ -43,10 +43,10 @@ class WebPay::Charge < WebPay::ApiResource
43
43
 
44
44
  # List charges filtered by params
45
45
  #
46
- # @param params [ListRequestWithCustomer|Hash] Parameters to API call
46
+ # @param params [ChargeListRequest|Hash] Parameters to API call
47
47
  # @return [ChargeResponseList]
48
48
  def all(params = {})
49
- req = WebPay::ListRequestWithCustomer.create(params)
49
+ req = WebPay::ChargeListRequest.create(params)
50
50
  raw_response = @client.request(:get, 'charges', req)
51
51
  WebPay::ChargeResponseList.new(raw_response)
52
52
  end
@@ -42,10 +42,10 @@ class WebPay::Customer < WebPay::ApiResource
42
42
 
43
43
  # List customers filtered by params
44
44
  #
45
- # @param params [ListRequest|Hash] Parameters to API call
45
+ # @param params [BasicListRequest|Hash] Parameters to API call
46
46
  # @return [CustomerResponseList]
47
47
  def all(params = {})
48
- req = WebPay::ListRequest.create(params)
48
+ req = WebPay::BasicListRequest.create(params)
49
49
  raw_response = @client.request(:get, 'customers', req)
50
50
  WebPay::CustomerResponseList.new(raw_response)
51
51
  end
@@ -103,7 +103,7 @@ class WebPay
103
103
  attr_reader :attributes
104
104
 
105
105
  def self.fields
106
- ['amount', 'currency', 'customer', 'card', 'description', 'capture', 'expire_days', 'uuid']
106
+ ['amount', 'currency', 'customer', 'shop', 'card', 'description', 'capture', 'expire_days', 'uuid']
107
107
  end
108
108
 
109
109
 
@@ -151,6 +151,15 @@ class WebPay
151
151
  attributes['customer'] = value
152
152
  end
153
153
 
154
+ def shop
155
+ attributes['shop']
156
+ end
157
+
158
+
159
+ def shop=(value)
160
+ attributes['shop'] = value
161
+ end
162
+
154
163
  def card
155
164
  attributes['card']
156
165
  end
@@ -519,11 +528,11 @@ class WebPay
519
528
  end
520
529
 
521
530
  end
522
- class ListRequestWithCustomer < Entity
531
+ class ChargeListRequest < Entity
523
532
  attr_reader :attributes
524
533
 
525
534
  def self.fields
526
- ['count', 'offset', 'created', 'customer', 'recursion']
535
+ ['count', 'offset', 'created', 'customer', 'recursion', 'shop']
527
536
  end
528
537
 
529
538
 
@@ -590,6 +599,15 @@ class WebPay
590
599
  attributes['recursion'] = value
591
600
  end
592
601
 
602
+ def shop
603
+ attributes['shop']
604
+ end
605
+
606
+
607
+ def shop=(value)
608
+ attributes['shop'] = value
609
+ end
610
+
593
611
  end
594
612
  class ChargeResponseList < Entity
595
613
  attr_reader :attributes
@@ -913,7 +931,7 @@ class WebPay
913
931
  end
914
932
 
915
933
  end
916
- class ListRequest < Entity
934
+ class BasicListRequest < Entity
917
935
  attr_reader :attributes
918
936
 
919
937
  def self.fields
@@ -1237,11 +1255,11 @@ class WebPay
1237
1255
  end
1238
1256
 
1239
1257
  end
1240
- class ListRequestWithEventType < Entity
1258
+ class EventListRequest < Entity
1241
1259
  attr_reader :attributes
1242
1260
 
1243
1261
  def self.fields
1244
- ['count', 'offset', 'created', 'type']
1262
+ ['count', 'offset', 'created', 'type', 'shop']
1245
1263
  end
1246
1264
 
1247
1265
 
@@ -1299,6 +1317,15 @@ class WebPay
1299
1317
  attributes['type'] = value
1300
1318
  end
1301
1319
 
1320
+ def shop
1321
+ attributes['shop']
1322
+ end
1323
+
1324
+
1325
+ def shop=(value)
1326
+ attributes['shop'] = value
1327
+ end
1328
+
1302
1329
  end
1303
1330
  class EventResponseList < Entity
1304
1331
  attr_reader :attributes
@@ -1336,7 +1363,7 @@ class WebPay
1336
1363
  attr_reader :attributes
1337
1364
 
1338
1365
  def self.fields
1339
- ['description', 'details', 'live']
1366
+ ['description', 'details']
1340
1367
  end
1341
1368
 
1342
1369
 
@@ -1374,15 +1401,6 @@ class WebPay
1374
1401
  attributes['details'] = value
1375
1402
  end
1376
1403
 
1377
- def live
1378
- attributes['live']
1379
- end
1380
-
1381
-
1382
- def live=(value)
1383
- attributes['live'] = value
1384
- end
1385
-
1386
1404
  end
1387
1405
  class ShopResponse < Entity
1388
1406
  attr_reader :attributes
@@ -1443,7 +1461,7 @@ class WebPay
1443
1461
  attr_reader :attributes
1444
1462
 
1445
1463
  def self.fields
1446
- ['id', 'live']
1464
+ ['id']
1447
1465
  end
1448
1466
 
1449
1467
 
@@ -1474,21 +1492,12 @@ class WebPay
1474
1492
  attributes['id'] = value
1475
1493
  end
1476
1494
 
1477
- def live
1478
- attributes['live']
1479
- end
1480
-
1481
-
1482
- def live=(value)
1483
- attributes['live'] = value
1484
- end
1485
-
1486
1495
  end
1487
1496
  class ShopRequestUpdate < Entity
1488
1497
  attr_reader :attributes
1489
1498
 
1490
1499
  def self.fields
1491
- ['id', 'description', 'details', 'live']
1500
+ ['id', 'description', 'details']
1492
1501
  end
1493
1502
 
1494
1503
 
@@ -1537,78 +1546,6 @@ class WebPay
1537
1546
  attributes['details'] = value
1538
1547
  end
1539
1548
 
1540
- def live
1541
- attributes['live']
1542
- end
1543
-
1544
-
1545
- def live=(value)
1546
- attributes['live'] = value
1547
- end
1548
-
1549
- end
1550
- class ListRequestWithLive < Entity
1551
- attr_reader :attributes
1552
-
1553
- def self.fields
1554
- ['count', 'offset', 'created', 'live']
1555
- end
1556
-
1557
-
1558
- def self.create(params)
1559
- return params if params.is_a?(self)
1560
- hash = case params
1561
- when Hash; params
1562
- else
1563
- raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
1564
- end
1565
- self.new(hash)
1566
- end
1567
-
1568
- def initialize(hash = {})
1569
- hash = normalize_hash(hash)
1570
- hash['created'] = hash['created'].is_a?(Hash) ? WebPay::CreatedRange.new(hash['created']) : hash['created']
1571
- @attributes = hash
1572
- end
1573
-
1574
- # attributes accessors
1575
- def count
1576
- attributes['count']
1577
- end
1578
-
1579
-
1580
- def count=(value)
1581
- attributes['count'] = value
1582
- end
1583
-
1584
- def offset
1585
- attributes['offset']
1586
- end
1587
-
1588
-
1589
- def offset=(value)
1590
- attributes['offset'] = value
1591
- end
1592
-
1593
- def created
1594
- attributes['created']
1595
- end
1596
-
1597
-
1598
- def created=(value)
1599
- value = value.is_a?(Hash) ? WebPay::CreatedRange.new(value) : value
1600
- attributes['created'] = value
1601
- end
1602
-
1603
- def live
1604
- attributes['live']
1605
- end
1606
-
1607
-
1608
- def live=(value)
1609
- attributes['live'] = value
1610
- end
1611
-
1612
1549
  end
1613
1550
  class ShopResponseList < Entity
1614
1551
  attr_reader :attributes
@@ -1820,11 +1757,11 @@ class WebPay
1820
1757
  end
1821
1758
 
1822
1759
  end
1823
- class ListRequestWithCustomerAndSuspended < Entity
1760
+ class RecursionListRequest < Entity
1824
1761
  attr_reader :attributes
1825
1762
 
1826
1763
  def self.fields
1827
- ['count', 'offset', 'created', 'customer', 'suspended']
1764
+ ['count', 'offset', 'created', 'customer', 'shop', 'suspended']
1828
1765
  end
1829
1766
 
1830
1767
 
@@ -1882,6 +1819,15 @@ class WebPay
1882
1819
  attributes['customer'] = value
1883
1820
  end
1884
1821
 
1822
+ def shop
1823
+ attributes['shop']
1824
+ end
1825
+
1826
+
1827
+ def shop=(value)
1828
+ attributes['shop'] = value
1829
+ end
1830
+
1885
1831
  def suspended
1886
1832
  attributes['suspended']
1887
1833
  end
@@ -11,10 +11,10 @@ class WebPay::Event < WebPay::ApiResource
11
11
 
12
12
  # List events filtered by params
13
13
  #
14
- # @param params [ListRequestWithEventType|Hash] Parameters to API call
14
+ # @param params [EventListRequest|Hash] Parameters to API call
15
15
  # @return [EventResponseList]
16
16
  def all(params = {})
17
- req = WebPay::ListRequestWithEventType.create(params)
17
+ req = WebPay::EventListRequest.create(params)
18
18
  raw_response = @client.request(:get, 'events', req)
19
19
  WebPay::EventResponseList.new(raw_response)
20
20
  end
@@ -42,10 +42,10 @@ class WebPay::Recursion < WebPay::ApiResource
42
42
 
43
43
  # List recursions filtered by params
44
44
  #
45
- # @param params [ListRequestWithCustomerAndSuspended|Hash] Parameters to API call
45
+ # @param params [RecursionListRequest|Hash] Parameters to API call
46
46
  # @return [RecursionResponseList]
47
47
  def all(params = {})
48
- req = WebPay::ListRequestWithCustomerAndSuspended.create(params)
48
+ req = WebPay::RecursionListRequest.create(params)
49
49
  raw_response = @client.request(:get, 'recursions', req)
50
50
  WebPay::RecursionResponseList.new(raw_response)
51
51
  end
@@ -31,10 +31,10 @@ class WebPay::Shop < WebPay::ApiResource
31
31
 
32
32
  # List shops filtered by params
33
33
  #
34
- # @param params [ListRequestWithLive|Hash] Parameters to API call
34
+ # @param params [BasicListRequest|Hash] Parameters to API call
35
35
  # @return [ShopResponseList]
36
36
  def all(params = {})
37
- req = WebPay::ListRequestWithLive.create(params)
37
+ req = WebPay::BasicListRequest.create(params)
38
38
  raw_response = @client.request(:get, 'shops', req)
39
39
  WebPay::ShopResponseList.new(raw_response)
40
40
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'webpay'
5
- spec.version = '3.0.0'
5
+ spec.version = '3.0.1'
6
6
  spec.authors = ['webpay', 'tomykaira']
7
7
  spec.email = ['administrators@webpay.jp', 'tomykaira@webpay.jp']
8
8
  spec.description = 'WebPay is payment gateway service in Japan. see also https://webpay.jp/'
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.0.0
4
+ version: 3.0.1
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-06-03 00:00:00.000000000 Z
12
+ date: 2014-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday