omise 0.2.0 → 0.2.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: 071c06e6a320fa5d993a2291f62c985b982c1eda
4
- data.tar.gz: 4021e157e6f3b623ca960fd7aaec603b5a63c7c9
3
+ metadata.gz: a7f0f0af87f90ea42296a85216fee5da2c49bbd7
4
+ data.tar.gz: c53aca0d0ea2b064ff86c02c5999a513d7f77b36
5
5
  SHA512:
6
- metadata.gz: 6a7485c139f8ae933527c487a17cf48eb0ce8053a3e9c99784ed7b8370cf976c7d5d43b5e10fe313ee392b6e4e02e89e153b0517a91b9ad5ea4eed15283b8f9e
7
- data.tar.gz: bc402a2ba97a6eff222c2a606840e1741c3862c604ed4da884bf58b5403ed700ef7da3b57e9c84ee6fdad1803bc8f629f043a8db892a66297f906a80b1ec1615
6
+ metadata.gz: ba34266b22f1a00251c20e85dd5384ebfa4d2f7a9057eb77a5351e6c1d6f14e1ec8e9755a87ce6f0c5cbb0b54604e888bd07c727639c096bd07446a2ef48a571
7
+ data.tar.gz: 66d601cd6d4975c281791643f3f1646d8a83460cfae06f3c6dfcb71fc6c893a548641d8c18d2266fd71ea6aea1c093a0e9c88a593ac362157532d3e4dab437e7
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  An [unreleased] version is not available on rubygems and is subject to changes and must not be considered final. Elements of unreleased list may be edited or removed at any time.
4
4
 
5
+ ## [0.2.1] 2015-12-01
6
+
7
+ - [Added] Add fetching options to customer cards (6ef31e6)
8
+
5
9
  ## [0.2.0] 2015-11-13
6
10
 
7
11
  - [Added] Add Omise-Version header to request.
@@ -34,8 +34,13 @@ module Omise
34
34
  expand_attribute cards, "default_card", options
35
35
  end
36
36
 
37
- def cards
38
- list_attribute CardList, "cards"
37
+ def cards(options = {})
38
+ if options.empty?
39
+ list_attribute CardList, "cards"
40
+ else
41
+ response = collection.resource(location("cards")).get(options)
42
+ CardList.new(self, response)
43
+ end
39
44
  end
40
45
  end
41
46
  end
data/lib/omise/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Omise
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -0,0 +1,29 @@
1
+ {
2
+ "object": "list",
3
+ "from": "1970-01-01T00:00:00+00:00",
4
+ "to": "2015-01-15T04:03:52+00:00",
5
+ "offset": 0,
6
+ "limit": 20,
7
+ "total": 1,
8
+ "data": [
9
+ {
10
+ "object": "card",
11
+ "id": "card_test_4yq6tuucl9h4erukfl0",
12
+ "livemode": false,
13
+ "location": "/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0",
14
+ "country": "",
15
+ "city": "Bangkok",
16
+ "postal_code": "10320",
17
+ "financing": "",
18
+ "last_digits": "4242",
19
+ "brand": "Visa",
20
+ "expiration_month": 1,
21
+ "expiration_year": 2017,
22
+ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=",
23
+ "name": "JOHN DOE",
24
+ "security_code_check": true,
25
+ "created": "2015-01-15T04:03:40Z"
26
+ }
27
+ ],
28
+ "location": "/customers/cust_test_4yq6txdpfadhbaqnwp3/cards"
29
+ }
@@ -53,6 +53,11 @@ class TestCustomer < Omise::Test
53
53
  assert_instance_of Omise::CardList, @customer.cards
54
54
  end
55
55
 
56
+ def test_that_a_customer_can_fetch_a_list_of_ordered_cards
57
+ cards = @customer.cards(order: "chronological")
58
+ assert_instance_of Omise::CardList, cards
59
+ end
60
+
56
61
  def test_that_a_customer_has_a_default_card
57
62
  assert_instance_of Omise::Card, @customer.default_card
58
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Clart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-13 00:00:00.000000000 Z
11
+ date: 2015-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -141,6 +141,7 @@ files:
141
141
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-delete.json
142
142
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-get.json
143
143
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-patch.json
144
+ - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards-get-order-chronological.json
144
145
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/404-get.json
145
146
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-delete.json
146
147
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-get.json
@@ -224,6 +225,7 @@ test_files:
224
225
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-delete.json
225
226
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-get.json
226
227
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3-patch.json
228
+ - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards-get-order-chronological.json
227
229
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/404-get.json
228
230
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-delete.json
229
231
  - test/fixtures/api.omise.co/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0-get.json