omise 0.3.0 → 0.4.0

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: 6582f42a8eff692792f15819c73d604bfa94e295
4
- data.tar.gz: 6f28d4f5b34c5e85f041bf19a12cb844179d0ef0
3
+ metadata.gz: 0ff392328416601e36ba46368afcbb591eeb811b
4
+ data.tar.gz: e3317b3b98779651c2cfc7bd99621500f57a101d
5
5
  SHA512:
6
- metadata.gz: 7f28d94fde9630b4b3d07ffc25fcc4f6319c65f1edc6264055b90bd9503c857a7a44cdfc58b94c4082fa6952c8f1a539cc8a93d3b573895e29ed74c682a3d9bd
7
- data.tar.gz: 5b1fc4c28f7d80eb0018b5953049b6e23fb5b834cc4b4544cadadfe42284f254ca5b2fad5c949514bc5bbd0386ecb9a380e55e1998692390158b0071598ddb43
6
+ metadata.gz: 61bb3e5a0bfac06e1c930bb78d0e2cf89e07453e8ed1911a8874197d7152e69975457d9e923c2984b92e2a01f44a14180ec9f03707f5495120c585912aab2227
7
+ data.tar.gz: d5e4f4475e8cc0fc395d2c747206cbb60e569dd3dc8cceb11b3f3478eb9f00e82431197062a4e7d2dbacd3f90e1e1c2aacf8112194dc067a4b3de73441c54856
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
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.4.0] 2016-06-01
6
+
7
+ - [Added] Add charge reversal method (@zentetsukenz)
8
+ - [Updated] Update Rest-Client version (@zacksiri)
9
+
5
10
  ## [0.3.0] 2016-02-18
6
11
 
7
12
  - [Added] Add Events API
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![CodeClimate](https://img.shields.io/codeclimate/github/omise/omise-ruby.svg?style=flat)](https://codeclimate.com/github/omise/omise-ruby)
4
4
  ![CircleCI](https://img.shields.io/circleci/project/omise/omise-ruby.svg?style=flat)
5
5
  [![Gem](https://img.shields.io/gem/v/omise.svg?style=flat)](https://rubygems.org/gems/omise)
6
+ [![Join the chat at https://gitter.im/omise/omise-ruby](https://badges.gitter.im/omise/omise-ruby.svg)](https://gitter.im/omise/omise-ruby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
7
 
7
8
  ## Installation
8
9
 
data/lib/omise/charge.rb CHANGED
@@ -33,6 +33,10 @@ module Omise
33
33
  assign_attributes nested_resource("capture", options).post
34
34
  end
35
35
 
36
+ def reverse(options = {})
37
+ assign_attributes nested_resource("reverse", options).post
38
+ end
39
+
36
40
  def customer(options = {})
37
41
  expand_attribute Customer, "customer", options
38
42
  end
data/lib/omise/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Omise
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
data/omise.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "rest-client", "~> 1.7.2"
20
+ spec.add_dependency "rest-client", "~> 1.8.0"
21
21
  spec.add_dependency "json", "~> 1.8.1"
22
22
 
23
23
  spec.add_development_dependency "bundler"
@@ -0,0 +1,50 @@
1
+ {
2
+ "object": "charge",
3
+ "id": "chrg_test_4yq7duw15p9hdrjp8oq",
4
+ "livemode": false,
5
+ "location": "/charges/chrg_test_4yq7duw15p9hdrjp8oq",
6
+ "amount": 100000,
7
+ "currency": "thb",
8
+ "description": "Charge for order 3947",
9
+ "capture": true,
10
+ "authorized": true,
11
+ "reversed": true,
12
+ "captured": false,
13
+ "transaction": "trxn_test_4yq7duwb9jts1vxgqua",
14
+ "refunded": 0,
15
+ "refunds": {
16
+ "object": "list",
17
+ "from": "1970-01-01T00:00:00+00:00",
18
+ "to": "2015-01-16T07:23:49+00:00",
19
+ "offset": 0,
20
+ "limit": 20,
21
+ "total": 1,
22
+ "data": [
23
+
24
+ ],
25
+ "location": "/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds"
26
+ },
27
+ "failure_code": null,
28
+ "failure_message": null,
29
+ "card": {
30
+ "object": "card",
31
+ "id": "card_test_4yq6tuucl9h4erukfl0",
32
+ "livemode": false,
33
+ "location": "/customers/cust_test_4yq6txdpfadhbaqnwp3/cards/card_test_4yq6tuucl9h4erukfl0",
34
+ "country": "",
35
+ "city": "Bangkok",
36
+ "postal_code": "10320",
37
+ "financing": "",
38
+ "last_digits": "4242",
39
+ "brand": "Visa",
40
+ "expiration_month": 1,
41
+ "expiration_year": 2017,
42
+ "fingerprint": "sRF/oMw2UQJJp/WbU+2/ZbVzwROjpMf1lyhOHhOqziw=",
43
+ "name": "JOHN DOE",
44
+ "security_code_check": true,
45
+ "created": "2015-01-15T04:03:40Z"
46
+ },
47
+ "customer": "cust_test_4yq6txdpfadhbaqnwp3",
48
+ "ip": null,
49
+ "created": "2015-01-15T05:00:29Z"
50
+ }
@@ -97,4 +97,8 @@ class TestCharge < Omise::Test
97
97
  def test_that_we_can_send_a_capture_request
98
98
  assert @charge.capture
99
99
  end
100
+
101
+ def test_that_we_can_send_a_reverse_request
102
+ assert @charge.reverse
103
+ end
100
104
  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.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Clart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-18 00:00:00.000000000 Z
11
+ date: 2016-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.7.2
19
+ version: 1.8.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.7.2
26
+ version: 1.8.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,7 @@ files:
136
136
  - test/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-post.json
137
137
  - test/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds/404-get.json
138
138
  - test/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds/rfnd_test_4yqmv79ahghsiz23y3c-get.json
139
+ - test/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/reverse-post.json
139
140
  - test/fixtures/api.omise.co/customers-get.json
140
141
  - test/fixtures/api.omise.co/customers-post.json
141
142
  - test/fixtures/api.omise.co/customers/404-get.json
@@ -223,6 +224,7 @@ test_files:
223
224
  - test/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds-post.json
224
225
  - test/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds/404-get.json
225
226
  - test/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/refunds/rfnd_test_4yqmv79ahghsiz23y3c-get.json
227
+ - test/fixtures/api.omise.co/charges/chrg_test_4yq7duw15p9hdrjp8oq/reverse-post.json
226
228
  - test/fixtures/api.omise.co/customers-get.json
227
229
  - test/fixtures/api.omise.co/customers-post.json
228
230
  - test/fixtures/api.omise.co/customers/404-get.json