tylerhunt-remit 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README +38 -0
- data/lib/remit/cancel_token.rb +18 -0
- data/lib/remit/common.rb +88 -0
- data/lib/remit/data_types.rb +107 -0
- data/lib/remit/discard_results.rb +18 -0
- data/lib/remit/fund_prepaid.rb +31 -0
- data/lib/remit/get_account_activity.rb +60 -0
- data/lib/remit/get_account_balance.rb +29 -0
- data/lib/remit/get_all_credit_instruments.rb +18 -0
- data/lib/remit/get_all_prepaid_instruments.rb +18 -0
- data/lib/remit/get_debt_balance.rb +23 -0
- data/lib/remit/get_outstanding_debt_balance.rb +22 -0
- data/lib/remit/get_payment_instruction.rb +21 -0
- data/lib/remit/get_pipeline.rb +123 -0
- data/lib/remit/get_prepaid_balance.rb +23 -0
- data/lib/remit/get_results.rb +26 -0
- data/lib/remit/get_token_by_caller.rb +19 -0
- data/lib/remit/get_token_usage.rb +18 -0
- data/lib/remit/get_tokens.rb +20 -0
- data/lib/remit/get_total_prepaid_liability.rb +22 -0
- data/lib/remit/get_transaction.rb +42 -0
- data/lib/remit/install_payment_instruction.rb +22 -0
- data/lib/remit/pay.rb +34 -0
- data/lib/remit/refund.rb +38 -0
- data/lib/remit/reserve.rb +30 -0
- data/lib/remit/retry_transaction.rb +18 -0
- data/lib/remit/settle.rb +20 -0
- data/lib/remit/settle_debt.rb +30 -0
- data/lib/remit/subscribe_for_caller_notification.rb +18 -0
- data/lib/remit/unsubscribe_for_caller_notification.rb +17 -0
- data/lib/remit/write_off_debt.rb +28 -0
- data/lib/remit.rb +123 -0
- data/spec/get_account_activity_spec.rb +36 -0
- data/spec/get_pipeline_spec.rb +106 -0
- data/spec/get_tokens_spec.rb +38 -0
- data/spec/spec_helper.rb +26 -0
- metadata +102 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe 'a GetTokens call' do
|
4
|
+
it_should_behave_like 'a successful request'
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
@response = @remit.get_tokens
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should have a collection of tokens' do
|
11
|
+
@response.should have_at_least(1).tokens
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should have a token with all of its values set' do
|
15
|
+
token = @response.tokens.first
|
16
|
+
token.token_id.should_not be_empty
|
17
|
+
token.friendly_name.should_not be_empty
|
18
|
+
token.status.should_not be_empty
|
19
|
+
token.date_installed.should_not be_nil
|
20
|
+
token.caller_installed.should_not be_empty
|
21
|
+
token.caller_reference.should_not be_empty
|
22
|
+
token.token_type.should_not be_empty
|
23
|
+
token.old_token_id.should_not be_empty
|
24
|
+
token.payment_reason.should_not be_empty
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should have a token with a token ID' do
|
28
|
+
@response.tokens.first.token_id.should_not be_empty
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should have a token with a valid token status' do
|
32
|
+
@response.tokens.first.status.should match(/^(IN)?ACTIVE$/i)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should have a token with a valid installation date' do
|
36
|
+
@response.tokens.first.date_installed.should be_a_kind_of(Time)
|
37
|
+
end
|
38
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec'
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../lib/remit'
|
4
|
+
|
5
|
+
fail unless ENV.include?('AWS_ACCESS_KEY') and ENV.include?('AWS_SECRET_KEY')
|
6
|
+
|
7
|
+
ACCESS_KEY = ENV['AWS_ACCESS_KEY'] unless defined?(ACCESS_KEY)
|
8
|
+
SECRET_KEY = ENV['AWS_SECRET_KEY'] unless defined?(SECRET_KEY)
|
9
|
+
|
10
|
+
describe 'a successful request', :shared => true do
|
11
|
+
before(:all) do
|
12
|
+
@remit = Remit::API.new(ACCESS_KEY, SECRET_KEY, true)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should return success' do
|
16
|
+
@response.status.should eql('Success')
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should not have any errors' do
|
20
|
+
@response.errors.should be_nil
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should have a request ID' do
|
24
|
+
@response.request_id.should_not be_nil
|
25
|
+
end
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tylerhunt-remit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tyler Hunt
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-10-20 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: relax
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.0.3
|
23
|
+
version:
|
24
|
+
description:
|
25
|
+
email: tyler@tylerhunt.com
|
26
|
+
executables: []
|
27
|
+
|
28
|
+
extensions: []
|
29
|
+
|
30
|
+
extra_rdoc_files:
|
31
|
+
- README
|
32
|
+
- LICENSE
|
33
|
+
files:
|
34
|
+
- lib/remit
|
35
|
+
- lib/remit/cancel_token.rb
|
36
|
+
- lib/remit/common.rb
|
37
|
+
- lib/remit/data_types.rb
|
38
|
+
- lib/remit/discard_results.rb
|
39
|
+
- lib/remit/fund_prepaid.rb
|
40
|
+
- lib/remit/get_account_activity.rb
|
41
|
+
- lib/remit/get_account_balance.rb
|
42
|
+
- lib/remit/get_all_credit_instruments.rb
|
43
|
+
- lib/remit/get_all_prepaid_instruments.rb
|
44
|
+
- lib/remit/get_debt_balance.rb
|
45
|
+
- lib/remit/get_outstanding_debt_balance.rb
|
46
|
+
- lib/remit/get_payment_instruction.rb
|
47
|
+
- lib/remit/get_pipeline.rb
|
48
|
+
- lib/remit/get_prepaid_balance.rb
|
49
|
+
- lib/remit/get_results.rb
|
50
|
+
- lib/remit/get_token_by_caller.rb
|
51
|
+
- lib/remit/get_token_usage.rb
|
52
|
+
- lib/remit/get_tokens.rb
|
53
|
+
- lib/remit/get_total_prepaid_liability.rb
|
54
|
+
- lib/remit/get_transaction.rb
|
55
|
+
- lib/remit/install_payment_instruction.rb
|
56
|
+
- lib/remit/pay.rb
|
57
|
+
- lib/remit/refund.rb
|
58
|
+
- lib/remit/reserve.rb
|
59
|
+
- lib/remit/retry_transaction.rb
|
60
|
+
- lib/remit/settle.rb
|
61
|
+
- lib/remit/settle_debt.rb
|
62
|
+
- lib/remit/subscribe_for_caller_notification.rb
|
63
|
+
- lib/remit/unsubscribe_for_caller_notification.rb
|
64
|
+
- lib/remit/write_off_debt.rb
|
65
|
+
- lib/remit.rb
|
66
|
+
- spec/get_account_activity_spec.rb
|
67
|
+
- spec/get_pipeline_spec.rb
|
68
|
+
- spec/get_tokens_spec.rb
|
69
|
+
- spec/spec_helper.rb
|
70
|
+
- README
|
71
|
+
- LICENSE
|
72
|
+
has_rdoc: true
|
73
|
+
homepage: http://tylerhunt.com/
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: "0"
|
84
|
+
version:
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: "0"
|
90
|
+
version:
|
91
|
+
requirements: []
|
92
|
+
|
93
|
+
rubyforge_project: remit
|
94
|
+
rubygems_version: 1.2.0
|
95
|
+
signing_key:
|
96
|
+
specification_version: 2
|
97
|
+
summary: An API for using the Amazon Flexible Payment Service (FPS).
|
98
|
+
test_files:
|
99
|
+
- spec/get_account_activity_spec.rb
|
100
|
+
- spec/get_pipeline_spec.rb
|
101
|
+
- spec/get_tokens_spec.rb
|
102
|
+
- spec/spec_helper.rb
|