fat_zebra 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +5 -0
- data/README.markdown +4 -2
- data/lib/fat_zebra/gateway.rb +7 -2
- data/lib/fat_zebra/version.rb +1 -1
- data/spec/gateway_spec.rb +2 -2
- metadata +17 -16
data/.travis.yml
ADDED
data/README.markdown
CHANGED
@@ -8,10 +8,12 @@ A Ruby client for the [Fat Zebra](https://www.fatzebra.com.au) Online Payment Ga
|
|
8
8
|
Dependencies
|
9
9
|
------------
|
10
10
|
|
11
|
-
* Ruby (tested on 1.9.2, 1.9.3)
|
11
|
+
* Ruby (tested on 1.8.7, 1.9.2, 1.9.3)
|
12
12
|
* Rest Client
|
13
13
|
* JSON
|
14
14
|
|
15
|
+
[![Build Status](https://secure.travis-ci.org/fatzebra/Ruby-Library.png?branch=master)](http://travis-ci.org/fatzebra/Ruby-Library)
|
16
|
+
|
15
17
|
Installing
|
16
18
|
----------
|
17
19
|
|
@@ -35,7 +37,7 @@ card_data = {
|
|
35
37
|
card_expiry: "05/2013",
|
36
38
|
ccv: "123"
|
37
39
|
}
|
38
|
-
response = gateway.purchase(10000, card_data, "ORDER-23, "203.99.87.4")
|
40
|
+
response = gateway.purchase(10000, card_data, "ORDER-23", "203.99.87.4")
|
39
41
|
|
40
42
|
if response.successful? && response.result.successful
|
41
43
|
puts "Transaction ID: #{response.result.id}"
|
data/lib/fat_zebra/gateway.rb
CHANGED
@@ -62,7 +62,7 @@ module FatZebra
|
|
62
62
|
# @return [Array<Purchase>] array of purchases
|
63
63
|
def purchases(options = {})
|
64
64
|
id = options.delete(:id)
|
65
|
-
options.merge!({offets
|
65
|
+
options.merge!({:offets => 0, :limit => 10})
|
66
66
|
|
67
67
|
if id.nil?
|
68
68
|
response = make_request(:get, "purchases", options)
|
@@ -191,7 +191,12 @@ module FatZebra
|
|
191
191
|
"http://"
|
192
192
|
end
|
193
193
|
version = options[:version]
|
194
|
-
|
194
|
+
if version.nil?
|
195
|
+
url = "#{proto}#{self.gateway_server}/#{resource}"
|
196
|
+
else
|
197
|
+
url = "#{proto}#{self.gateway_server}/v#{version}/#{resource}"
|
198
|
+
end
|
199
|
+
|
195
200
|
unless data.nil?
|
196
201
|
url = url + "?"
|
197
202
|
data.each do |key, value|
|
data/lib/fat_zebra/version.rb
CHANGED
data/spec/gateway_spec.rb
CHANGED
@@ -2,12 +2,12 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
TEST_USER = "TEST"
|
4
4
|
TEST_TOKEN = "TEST"
|
5
|
-
TEST_LOCAL =
|
5
|
+
TEST_LOCAL = false
|
6
6
|
|
7
7
|
describe FatZebra::Gateway do
|
8
8
|
before :each do
|
9
9
|
# Setup the gateway for testing
|
10
|
-
server = TEST_LOCAL == true ? "fatapi.dev" : "gateway.fatzebra.com.au"
|
10
|
+
server = TEST_LOCAL == true ? "fatapi.dev" : "gateway.sandbox.fatzebra.com.au"
|
11
11
|
@gw = FatZebra::Gateway.new(TEST_USER, TEST_TOKEN, server, {:secure => !TEST_LOCAL})
|
12
12
|
end
|
13
13
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fat_zebra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70318652470480 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70318652470480
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70318652469920 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70318652469920
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: yard
|
38
|
-
requirement: &
|
38
|
+
requirement: &70318652469100 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70318652469100
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: yard-tomdoc
|
49
|
-
requirement: &
|
49
|
+
requirement: &70318652468180 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70318652468180
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rest-client
|
60
|
-
requirement: &
|
60
|
+
requirement: &70318652467700 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70318652467700
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: json
|
71
|
-
requirement: &
|
71
|
+
requirement: &70318652466820 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70318652466820
|
80
80
|
description: Provides integration with the Fat Zebra internet payment gateway (www.fatzebra.com.au),
|
81
81
|
including purchase, refund, auth, capture and recurring billing functionality.
|
82
82
|
email:
|
@@ -86,6 +86,7 @@ extensions: []
|
|
86
86
|
extra_rdoc_files: []
|
87
87
|
files:
|
88
88
|
- .gitignore
|
89
|
+
- .travis.yml
|
89
90
|
- FatZebra.gemspec
|
90
91
|
- Gemfile
|
91
92
|
- README.markdown
|
@@ -119,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
120
|
version: '0'
|
120
121
|
segments:
|
121
122
|
- 0
|
122
|
-
hash: -
|
123
|
+
hash: -775473894571667432
|
123
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
125
|
none: false
|
125
126
|
requirements:
|
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
129
|
version: '0'
|
129
130
|
segments:
|
130
131
|
- 0
|
131
|
-
hash: -
|
132
|
+
hash: -775473894571667432
|
132
133
|
requirements: []
|
133
134
|
rubyforge_project: fat_zebra
|
134
135
|
rubygems_version: 1.8.10
|