pin_up 0.8.2 → 0.9.0

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: e59da48ef3bcacba53c1811825e908960ebe367f
4
- data.tar.gz: 65d406663585b1857645986e2785785530974998
3
+ metadata.gz: 280c7ecdf2bd755f221456d9d5d36667756131a6
4
+ data.tar.gz: dce5c730c0786407bb41680ca1873b6ae73bbaa4
5
5
  SHA512:
6
- metadata.gz: 37dfd4bcdaee497be3b7814b2106a7a718b17799e1a42fd49c93b636f6713b96383a8bf3cd08f37688382c34e8b11d935c923c19a2799db3dcf610e532c4b0ca
7
- data.tar.gz: 7a9a577e19bda851815adcf786e2849a4e949cacace69c9e90000a5a95e23732c11b9836a04bacaf96e1a7f112c92880de6d4e74164c00a6b948f926a1d046e1
6
+ metadata.gz: 71cdb892e73263c5dc2edbb9b1d672914a22877d7fa0efb1adfb1c6128ea3b84d97edc4665087d508b7a013a45443d0beb7ae48a6c1b8d97511b06d9550c248c
7
+ data.tar.gz: 3a79be89a6bf4536a5333e31064b638ee8e3ece3b15d876c1ffb5c2c244e38ba5cea3288d8be3fcb3692cb4c92f4b7677db12957a00541241718b2b0b7428f25
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.2
1
+ 0.9.0
data/lib/pin_up/charge.rb CHANGED
@@ -43,5 +43,15 @@ module Pin
43
43
  def self.create(options = {})
44
44
  build_response(auth_post("charges", options))
45
45
  end
46
+
47
+ # Captures a previously authorised charge and returns its details.
48
+ # args: charge-token (String)
49
+ # returns: charge object
50
+ # https://pin.net.au/docs/api/charges#put-charges
51
+
52
+ def self.capture(token)
53
+ build_response(auth_put("/charges/#{token}/capture"))
54
+ end
55
+
46
56
  end
47
57
  end
data/pin_up.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: pin_up 0.8.2 ruby lib
5
+ # stub: pin_up 0.9.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "pin_up"
9
- s.version = "0.8.2"
9
+ s.version = "0.9.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Daniel Nitsikopoulos"]
14
- s.date = "2014-02-04"
14
+ s.date = "2014-02-11"
15
15
  s.description = "A Ruby gem wrapper for the pin-payments (pin.net.au) API"
16
16
  s.email = "dnitza@gmail.com"
17
17
  s.extra_rdoc_files = [
data/spec/charges_spec.rb CHANGED
@@ -33,4 +33,15 @@ describe "Charge", :vcr, class: Pin::Charges do
33
33
  it "should list charges on a page given a page" do
34
34
  Pin::Charges.all(1).should_not == []
35
35
  end
36
+
37
+ it "should create a pre-auth (capture a charge)" do
38
+ options = {email: "dNitza@gmail.com", description: "A new captured charge from testing Pin gem", amount: "400", currency: "AUD", ip_address: "127.0.0.1", customer_token: "cus_8ImkZdEZ6BXUA6NcJDZg_g", capture: false }
39
+ Pin::Charges.create(options)["captured"].should eq false
40
+ end
41
+
42
+ it "should capture a charge" do
43
+ options = {email: "dNitza@gmail.com", description: "A new captured charge from testing Pin gem", amount: "400", currency: "AUD", ip_address: "127.0.0.1", customer_token: "cus_8ImkZdEZ6BXUA6NcJDZg_g", capture: false }
44
+ token = Pin::Charges.create(options)["token"]
45
+ Pin::Charges.capture(token)["success"].should eq true
46
+ end
36
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pin_up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Nitsikopoulos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-04 00:00:00.000000000 Z
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty