amazon_flex_pay 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -28,7 +28,7 @@ module AmazonFlexPay::API #:nodoc:
28
28
  end
29
29
  end
30
30
 
31
- class Base < AmazonFlexPay::Model
31
+ class BaseRequest < AmazonFlexPay::Model
32
32
  # This compiles an API request object into a URL, sends it to Amazon, and processes
33
33
  # the response.
34
34
  def submit
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class Cancel < Base #:nodoc:
2
+ class Cancel < BaseRequest #:nodoc:
3
3
  attribute :transaction_id
4
4
  attribute :description
5
5
 
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class CancelToken < Base #:nodoc:
2
+ class CancelToken < BaseRequest #:nodoc:
3
3
  attribute :token_id
4
4
  attribute :reason_text
5
5
 
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class GetAccountActivity < Base #:nodoc:
2
+ class GetAccountActivity < BaseRequest #:nodoc:
3
3
  attribute :start_date # required
4
4
  attribute :end_date
5
5
  attribute :'FPSOperation', :enumeration => :fps_operation
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class GetAccountBalance < Base #:nodoc:
2
+ class GetAccountBalance < BaseRequest #:nodoc:
3
3
 
4
4
  class Response < BaseResponse #:nodoc:
5
5
  attribute :account_balance, :type => :account_balance
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class GetRecipientVerificationStatus < Base #:nodoc:
2
+ class GetRecipientVerificationStatus < BaseRequest #:nodoc:
3
3
  attribute :recipient_token_id
4
4
 
5
5
  class Response < BaseResponse #:nodoc:
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class GetTokenByCaller < Base #:nodoc:
2
+ class GetTokenByCaller < BaseRequest #:nodoc:
3
3
  attribute :token_id
4
4
  attribute :caller_reference
5
5
 
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class GetTokenUsage < Base #:nodoc:
2
+ class GetTokenUsage < BaseRequest #:nodoc:
3
3
  attribute :token_id
4
4
 
5
5
  class Response < BaseResponse #:nodoc:
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class GetTokens < Base #:nodoc:
2
+ class GetTokens < BaseRequest #:nodoc:
3
3
  attribute :caller_reference
4
4
  attribute :token_status
5
5
  attribute :token_type
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class GetTransaction < Base #:nodoc:
2
+ class GetTransaction < BaseRequest #:nodoc:
3
3
  attribute :transaction_id
4
4
 
5
5
  class Response < BaseResponse #:nodoc:
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class GetTransactionStatus < Base #:nodoc:
2
+ class GetTransactionStatus < BaseRequest #:nodoc:
3
3
  attribute :transaction_id
4
4
 
5
5
  class Response < BaseResponse #:nodoc:
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class Pay < Base #:nodoc:
2
+ class Pay < BaseRequest #:nodoc:
3
3
  attribute :caller_description
4
4
  attribute :caller_reference # required
5
5
  attribute :charge_fee_to, :enumeration => :charge_fee_to
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class Refund < Base #:nodoc:
2
+ class Refund < BaseRequest #:nodoc:
3
3
  attribute :caller_description
4
4
  attribute :caller_reference # required
5
5
  attribute :refund_amount, :type => :amount
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class Reserve < Base #:nodoc:
2
+ class Reserve < BaseRequest #:nodoc:
3
3
  attribute :caller_description
4
4
  attribute :caller_reference # required
5
5
  attribute :charge_fee_to, :enumeration => :charge_fee_to
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class Settle < Base #:nodoc:
2
+ class Settle < BaseRequest #:nodoc:
3
3
  attribute :reserve_transaction_id
4
4
  attribute :transaction_amount, :type => :amount
5
5
 
@@ -1,5 +1,5 @@
1
1
  module AmazonFlexPay::API #:nodoc:
2
- class VerifySignature < Base #:nodoc:
2
+ class VerifySignature < BaseRequest #:nodoc:
3
3
  attribute :url_end_point
4
4
  attribute :http_parameters
5
5
 
@@ -1,5 +1,5 @@
1
1
  # load all api classes
2
- require 'amazon_flex_pay/api/base'
2
+ require 'amazon_flex_pay/api/base_request'
3
3
  Dir[File.dirname(__FILE__) + '/api/*'].each do |p| require "amazon_flex_pay/api/#{File.basename(p)}" end
4
4
 
5
5
  module AmazonFlexPay
@@ -33,9 +33,7 @@ module AmazonFlexPay
33
33
  API::GetAccountBalance.new.submit
34
34
  end
35
35
 
36
- # Returns the status of a recipient's Amazon account. This is a high-level status indicating whether
37
- # the recipient can receive up to $10k per month (VerificationComplete) or has no receiving limitations
38
- # at all (VerificationCompleteNoLimits).
36
+ # Returns the status of a recipient's Amazon account.
39
37
  #
40
38
  # See http://docs.amazonwebservices.com/AmazonFPS/latest/FPSAdvancedGuide/GetRecipientVerificationStatus.html
41
39
  def get_recipient_verification_status(recipient_token_id)
@@ -11,7 +11,7 @@ module AmazonFlexPay::Enumerations
11
11
  InstrumentStatus = %w(Active All Cancelled)
12
12
  MarketplaceRefundPolicy = %w(MarketplaceTxnOnly MasterAndMarketplaceTxn MasterTxnOnly) # moved from DataTypes
13
13
  PaymentMethod = %w(ABT ACH CC Debt Prepaid)
14
- RecipientVerificationStatus = %w(VerificationComplete VerificationPending VerificationCompleteNoLimits) # moved from DataTypes
14
+ RecipientVerificationStatus = %w(PendingUserAction PendingReview Closed Active) # moved from DataTypes
15
15
  RelationType = %w(MarketplaceFee Parent Refund RefundReversal Reserve Settle)
16
16
  SoftDescriptorType = %w(Static Dynamic) # undocumented
17
17
  SortOrderByDate = %w(Ascending Descending)
@@ -17,8 +17,8 @@ require 'amazon_flex_pay/api'
17
17
  require 'amazon_flex_pay/pipelines'
18
18
 
19
19
  module AmazonFlexPay
20
- VERSION = '0.9.6'
21
- API_VERSION = '2010-08-28'
20
+ VERSION = '0.9.7'
21
+ API_VERSION = '2011-09-20'
22
22
  PIPELINE_VERSION = '2009-01-09'
23
23
 
24
24
  class << self
@@ -41,12 +41,12 @@ class AmazonFlexPayTest < AmazonFlexPay::Test
41
41
 
42
42
  # api basics
43
43
 
44
- class TestRequest < AmazonFlexPay::API::Base
44
+ class TestRequest < AmazonFlexPay::API::BaseRequest
45
45
  attribute :foo
46
46
  attribute :amount, :type => :amount
47
47
  attribute :stuffs, :collection => :amount
48
48
 
49
- class Response < AmazonFlexPay::API::Base::BaseResponse; end
49
+ class Response < AmazonFlexPay::API::BaseRequest::BaseResponse; end
50
50
  end
51
51
 
52
52
  should "respond with data structures even when models are empty" do
@@ -73,10 +73,10 @@ class AmazonFlexPayTest < AmazonFlexPay::Test
73
73
  # standard additions
74
74
  assert_equal 'foo', params['AWSAccessKeyId']
75
75
  assert_equal 'TestRequest', params['Action']
76
- assert_equal '2010-08-28', params['Version']
76
+ assert_equal '2011-09-20', params['Version']
77
77
 
78
78
  # the signature is backwards-calculated for regression testing
79
- assert_equal 'kVNr+W7L3Z/A6sBrcz1FHdshQqPFU0YOPZJpMglofNk=', params['Signature']
79
+ assert_equal 'WVrkmK7qt/T+gtHWcdzqtkLRH8c06l/mPv3ZfxyvNyg=', params['Signature']
80
80
  assert_equal 'HmacSHA256', params['SignatureMethod']
81
81
  assert_equal 2, params['SignatureVersion']
82
82
  end
@@ -352,7 +352,7 @@ module ResponseSamples
352
352
  <GetRecipientVerificationResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
353
353
  <GetRecipientVerificationResult>
354
354
  <RecipientVerificationStatus>
355
- VerificationComplete
355
+ PendingUserAction
356
356
  </RecipientVerificationStatus>
357
357
  </GetRecipientVerificationResult>
358
358
  <ResponseMetadata>
data/test/test_helper.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'test/unit'
3
3
  require 'rubygems'
4
4
  #gem 'rails', '2.3.11'
5
- gem 'rails', '3.0.7'
5
+ gem 'rails', '3.0.10'
6
6
  require 'mocha'
7
7
 
8
8
  # load the gem
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon_flex_pay
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
5
- prerelease: false
4
+ hash: 53
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 6
10
- version: 0.9.6
9
+ - 7
10
+ version: 0.9.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lance Ivy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-27 00:00:00 -07:00
18
+ date: 2011-11-14 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -89,42 +89,42 @@ extensions: []
89
89
  extra_rdoc_files: []
90
90
 
91
91
  files:
92
- - lib/amazon_flex_pay/pipelines.rb
93
- - lib/amazon_flex_pay/enumerations.rb
94
- - lib/amazon_flex_pay/signing.rb
95
- - lib/amazon_flex_pay/pipelines/base.rb
96
- - lib/amazon_flex_pay/pipelines/single_use.rb
97
- - lib/amazon_flex_pay/pipelines/edit_token.rb
98
- - lib/amazon_flex_pay/pipelines/recipient.rb
99
- - lib/amazon_flex_pay/pipelines/multi_use.rb
100
- - lib/amazon_flex_pay/model.rb
101
- - lib/amazon_flex_pay/api/get_transaction.rb
102
- - lib/amazon_flex_pay/api/get_token_usage.rb
103
- - lib/amazon_flex_pay/api/reserve.rb
104
- - lib/amazon_flex_pay/api/base.rb
105
- - lib/amazon_flex_pay/api/get_transaction_status.rb
106
- - lib/amazon_flex_pay/api/verify_signature.rb
107
- - lib/amazon_flex_pay/api/get_account_balance.rb
108
- - lib/amazon_flex_pay/api/get_recipient_verification_status.rb
109
- - lib/amazon_flex_pay/api/get_account_activity.rb
110
- - lib/amazon_flex_pay/api/refund.rb
111
- - lib/amazon_flex_pay/api/pay.rb
92
+ - lib/amazon_flex_pay/api/base_request.rb
112
93
  - lib/amazon_flex_pay/api/cancel.rb
113
94
  - lib/amazon_flex_pay/api/cancel_token.rb
95
+ - lib/amazon_flex_pay/api/get_account_activity.rb
96
+ - lib/amazon_flex_pay/api/get_account_balance.rb
97
+ - lib/amazon_flex_pay/api/get_recipient_verification_status.rb
114
98
  - lib/amazon_flex_pay/api/get_token_by_caller.rb
99
+ - lib/amazon_flex_pay/api/get_token_usage.rb
115
100
  - lib/amazon_flex_pay/api/get_tokens.rb
101
+ - lib/amazon_flex_pay/api/get_transaction.rb
102
+ - lib/amazon_flex_pay/api/get_transaction_status.rb
103
+ - lib/amazon_flex_pay/api/pay.rb
104
+ - lib/amazon_flex_pay/api/refund.rb
105
+ - lib/amazon_flex_pay/api/reserve.rb
116
106
  - lib/amazon_flex_pay/api/settle.rb
107
+ - lib/amazon_flex_pay/api/verify_signature.rb
117
108
  - lib/amazon_flex_pay/api.rb
118
109
  - lib/amazon_flex_pay/data_types.rb
110
+ - lib/amazon_flex_pay/enumerations.rb
111
+ - lib/amazon_flex_pay/model.rb
112
+ - lib/amazon_flex_pay/pipelines/base.rb
113
+ - lib/amazon_flex_pay/pipelines/edit_token.rb
114
+ - lib/amazon_flex_pay/pipelines/multi_use.rb
115
+ - lib/amazon_flex_pay/pipelines/recipient.rb
116
+ - lib/amazon_flex_pay/pipelines/single_use.rb
117
+ - lib/amazon_flex_pay/pipelines.rb
118
+ - lib/amazon_flex_pay/signing.rb
119
119
  - lib/amazon_flex_pay.rb
120
120
  - LICENSE
121
121
  - README.rdoc
122
122
  - Rakefile
123
- - test/test_helper.rb
124
- - test/response_samples.rb
125
123
  - test/amazon_flex_pay_test.rb
126
- - test/pipelines_test.rb
127
124
  - test/api_test.rb
125
+ - test/pipelines_test.rb
126
+ - test/response_samples.rb
127
+ - test/test_helper.rb
128
128
  has_rdoc: true
129
129
  homepage: http://github.com/kickstarter/amazon_flex_pay
130
130
  licenses: []
@@ -155,13 +155,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  requirements: []
156
156
 
157
157
  rubyforge_project:
158
- rubygems_version: 1.3.7
158
+ rubygems_version: 1.6.2
159
159
  signing_key:
160
160
  specification_version: 3
161
161
  summary: API layer for Amazon FPS
162
162
  test_files:
163
- - test/test_helper.rb
164
- - test/response_samples.rb
165
163
  - test/amazon_flex_pay_test.rb
166
- - test/pipelines_test.rb
167
164
  - test/api_test.rb
165
+ - test/pipelines_test.rb
166
+ - test/response_samples.rb
167
+ - test/test_helper.rb