slidepay 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/slidepay/client.rb +9 -6
- data/lib/slidepay/version.rb +1 -1
- data/scenarios/company_retrieve.rb +19 -0
- data/scenarios/example.rb +7 -8
- data/scenarios/location_retrieve.rb +19 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cf7619f4c541983edb493fb3caa136c4c1eb1d4
|
4
|
+
data.tar.gz: 3af9338097e72789975c082244ffdce80af315b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17a174b5c5e057bb323fded70397604d7c788821929495ac917ad75d2dfb0ab67ec88d9e63b75b8e79672213521ccb46be8b0a153528fb2fea4e82eeb432be43
|
7
|
+
data.tar.gz: 908c1acf7987fd88dda966228a5a67c8bb6e46ad00043ae61fbd5e06928b01a88e41040ce2016df71dd0975a9bb5e7545452521dffac58f9712562fed436c1b2
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Slidepay Ruby Sdk
|
4
4
|
|
5
|
-
[![Build Status](https://travis-ci.org/SlidePay/slidepay-ruby-sdk.png)](https://travis-ci.org/SlidePay/slidepay-ruby-sdk) [![Code Climate](https://codeclimate.com/github/SlidePay/slidepay-ruby-sdk.png)](https://codeclimate.com/github/SlidePay/slidepay-ruby-sdk)
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/slidepay.png)](http://badge.fury.io/rb/slidepay) [![Build Status](https://travis-ci.org/SlidePay/slidepay-ruby-sdk.png)](https://travis-ci.org/SlidePay/slidepay-ruby-sdk) [![Code Climate](https://codeclimate.com/github/SlidePay/slidepay-ruby-sdk.png)](https://codeclimate.com/github/SlidePay/slidepay-ruby-sdk)
|
6
6
|
|
7
7
|
First version of the SlidePay Ruby SDK
|
8
8
|
|
@@ -31,7 +31,7 @@ Check out our [main documentation](https://getcube.atlassian.net/wiki/display/CD
|
|
31
31
|
Requests can be made three ways:
|
32
32
|
|
33
33
|
1. Using the SlidePay request methods directly with the desired API url and relevant request JSON
|
34
|
-
2.
|
34
|
+
2. Using an instance of the SlidePay::Client class to save an ApiResource, such as a payment, bank_account, or api_key
|
35
35
|
3. Using an instance of a SlidePay::ApiResource class, such as SlidePay::ApiKey or SlidePay::Payment
|
36
36
|
|
37
37
|
## Authentication
|
@@ -99,7 +99,7 @@ Each of these methods will return an array of zero or more instances of the ApiR
|
|
99
99
|
|
100
100
|
### find(search_filter_array)
|
101
101
|
|
102
|
-
```find``` is a flexible interface for
|
102
|
+
```find``` is a flexible interface for searching SlidePay resources. Search parameters must be supplied in the form of a [search filter array](https://getcube.atlassian.net/wiki/display/CDP/search_filter+and+search_filter_array). To supply them, pass an array of search filter Hashes as the first parameter.
|
103
103
|
|
104
104
|
```ruby
|
105
105
|
|
data/lib/slidepay/client.rb
CHANGED
@@ -41,12 +41,14 @@ module SlidePay
|
|
41
41
|
|
42
42
|
# Base Request Methods
|
43
43
|
def get(request_params)
|
44
|
+
options = {}
|
44
45
|
if request_params.is_a? String
|
45
|
-
|
46
|
+
options = { :path => request_params, :api_key => @api_key, :token => @token, :endpoint => @endpoint }
|
46
47
|
else
|
47
|
-
request_params.merge! api_key: @api_key, token: @token, endpoint: @endpoint
|
48
|
-
SlidePay.get(request_params)
|
48
|
+
options = request_params.merge! api_key: @api_key, token: @token, endpoint: @endpoint
|
49
49
|
end
|
50
|
+
|
51
|
+
SlidePay.get(options)
|
50
52
|
end
|
51
53
|
|
52
54
|
def put(request_params)
|
@@ -60,12 +62,13 @@ module SlidePay
|
|
60
62
|
end
|
61
63
|
|
62
64
|
def delete(request_params)
|
65
|
+
options = {}
|
63
66
|
if request_params.is_a? String
|
64
|
-
|
67
|
+
options = { :path => request_params, :api_key => @api_key, :token => @token, :endpoint => @endpoint }
|
65
68
|
else
|
66
|
-
request_params.merge! api_key: @api_key, token: @token, endpoint: @endpoint
|
67
|
-
SlidePay.delete(request_params)
|
69
|
+
options = request_params.merge! api_key: @api_key, token: @token, endpoint: @endpoint
|
68
70
|
end
|
71
|
+
SlidePay.delete(options)
|
69
72
|
end
|
70
73
|
|
71
74
|
|
data/lib/slidepay/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
$:.unshift(Fice.join(Fice.dirname(__FILE__), 'lib'))
|
2
|
+
$:.unshift(File.join(File.dirname(__FILE__), 'spec'))
|
3
|
+
|
4
|
+
require 'multi_json'
|
5
|
+
require 'slidepay'
|
6
|
+
require 'spec_helper'
|
7
|
+
|
8
|
+
include SlidePay
|
9
|
+
|
10
|
+
SlidePay.configure(development: true)
|
11
|
+
SlidePay.api_key = ENV["api_key"]
|
12
|
+
|
13
|
+
RestClient.proxy = "http://127.0.0.1:8888"
|
14
|
+
|
15
|
+
c = Company.new
|
16
|
+
c['company_id'] = ENV["company_id"]
|
17
|
+
c.retrieve()
|
18
|
+
|
19
|
+
puts "company: #{c}"
|
data/scenarios/example.rb
CHANGED
@@ -12,14 +12,8 @@ SlidePay.api_key = ENV["api_key"]
|
|
12
12
|
|
13
13
|
# RestClient.proxy = "http://127.0.0.1:8888"
|
14
14
|
|
15
|
-
# a = ApiKey.new
|
16
|
-
# a["api_key_id"] = 17
|
17
|
-
# a.is_new?
|
18
|
-
# a.id_attribute
|
19
|
-
# a.retrieve()
|
20
|
-
|
21
15
|
p = Payment.new
|
22
|
-
p["amount"] =
|
16
|
+
p["amount"] = 2.01
|
23
17
|
p["method"] = "CreditCard"
|
24
18
|
p["cc_number"] = "4111111111111111"
|
25
19
|
p["cc_cvv2"] = "111"
|
@@ -27,6 +21,11 @@ p["cc_billing_zip"] = "11111"
|
|
27
21
|
p["cc_expiry_month"] = "10"
|
28
22
|
p["cc_expiry_year"] = "14"
|
29
23
|
r = p.process()
|
30
|
-
p.refund()
|
24
|
+
# p.refund()
|
31
25
|
|
26
|
+
p2 = Payment.new
|
27
|
+
p2['payment_id'] = p.id
|
32
28
|
|
29
|
+
p2.retrieve()
|
30
|
+
p2['under_review'] = 1
|
31
|
+
p2.save()
|
@@ -0,0 +1,19 @@
|
|
1
|
+
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
2
|
+
$:.unshift(File.join(File.dirname(__FILE__), 'spec'))
|
3
|
+
|
4
|
+
require 'multi_json'
|
5
|
+
require 'slidepay'
|
6
|
+
require 'spec_helper'
|
7
|
+
|
8
|
+
include SlidePay
|
9
|
+
|
10
|
+
SlidePay.configure(development: true)
|
11
|
+
SlidePay.api_key = ENV["api_key"]
|
12
|
+
|
13
|
+
RestClient.proxy = "http://127.0.0.1:8888"
|
14
|
+
|
15
|
+
l = Location.new
|
16
|
+
l['location_id'] = ENV["location_id"]
|
17
|
+
l.retrieve()
|
18
|
+
|
19
|
+
puts "Location: #{l}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slidepay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Rothstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -168,7 +168,9 @@ files:
|
|
168
168
|
- lib/slidepay/response.rb
|
169
169
|
- lib/slidepay/util.rb
|
170
170
|
- lib/slidepay/version.rb
|
171
|
+
- scenarios/company_retrieve.rb
|
171
172
|
- scenarios/example.rb
|
173
|
+
- scenarios/location_retrieve.rb
|
172
174
|
- scenarios/payment_find_where_id.rb
|
173
175
|
- scenarios/payment_find_where_under_review.rb
|
174
176
|
- scenarios/use_api_resource_for_arbitrary_object.rb
|