Permalink
Browse files

rename Api::Base to Api::BaseRequest

  • Loading branch information...
1 parent 15edf16 commit bf47529cd95e1eb3aea6b0d9c1ac168be76c9ebd @cainlevy cainlevy committed Nov 14, 2011
@@ -1,5 +1,5 @@
# load all api classes
-require 'amazon_flex_pay/api/base'
+require 'amazon_flex_pay/api/base_request'
Dir[File.dirname(__FILE__) + '/api/*'].each do |p| require "amazon_flex_pay/api/#{File.basename(p)}" end
module AmazonFlexPay
@@ -28,7 +28,7 @@ class Error < AmazonFlexPay::Model #:nodoc:
end
end
- class Base < AmazonFlexPay::Model
+ class BaseRequest < AmazonFlexPay::Model
# This compiles an API request object into a URL, sends it to Amazon, and processes
# the response.
def submit
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class Cancel < Base #:nodoc:
+ class Cancel < BaseRequest #:nodoc:
attribute :transaction_id
attribute :description
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class CancelToken < Base #:nodoc:
+ class CancelToken < BaseRequest #:nodoc:
attribute :token_id
attribute :reason_text
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class GetAccountActivity < Base #:nodoc:
+ class GetAccountActivity < BaseRequest #:nodoc:
attribute :start_date # required
attribute :end_date
attribute :'FPSOperation', :enumeration => :fps_operation
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class GetAccountBalance < Base #:nodoc:
+ class GetAccountBalance < BaseRequest #:nodoc:
class Response < BaseResponse #:nodoc:
attribute :account_balance, :type => :account_balance
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class GetRecipientVerificationStatus < Base #:nodoc:
+ class GetRecipientVerificationStatus < BaseRequest #:nodoc:
attribute :recipient_token_id
class Response < BaseResponse #:nodoc:
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class GetTokenByCaller < Base #:nodoc:
+ class GetTokenByCaller < BaseRequest #:nodoc:
attribute :token_id
attribute :caller_reference
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class GetTokenUsage < Base #:nodoc:
+ class GetTokenUsage < BaseRequest #:nodoc:
attribute :token_id
class Response < BaseResponse #:nodoc:
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class GetTokens < Base #:nodoc:
+ class GetTokens < BaseRequest #:nodoc:
attribute :caller_reference
attribute :token_status
attribute :token_type
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class GetTransaction < Base #:nodoc:
+ class GetTransaction < BaseRequest #:nodoc:
attribute :transaction_id
class Response < BaseResponse #:nodoc:
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class GetTransactionStatus < Base #:nodoc:
+ class GetTransactionStatus < BaseRequest #:nodoc:
attribute :transaction_id
class Response < BaseResponse #:nodoc:
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class Pay < Base #:nodoc:
+ class Pay < BaseRequest #:nodoc:
attribute :caller_description
attribute :caller_reference # required
attribute :charge_fee_to, :enumeration => :charge_fee_to
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class Refund < Base #:nodoc:
+ class Refund < BaseRequest #:nodoc:
attribute :caller_description
attribute :caller_reference # required
attribute :refund_amount, :type => :amount
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class Reserve < Base #:nodoc:
+ class Reserve < BaseRequest #:nodoc:
attribute :caller_description
attribute :caller_reference # required
attribute :charge_fee_to, :enumeration => :charge_fee_to
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class Settle < Base #:nodoc:
+ class Settle < BaseRequest #:nodoc:
attribute :reserve_transaction_id
attribute :transaction_amount, :type => :amount
@@ -1,5 +1,5 @@
module AmazonFlexPay::API #:nodoc:
- class VerifySignature < Base #:nodoc:
+ class VerifySignature < BaseRequest #:nodoc:
attribute :url_end_point
attribute :http_parameters
@@ -41,12 +41,12 @@ class AmazonFlexPayTest < AmazonFlexPay::Test
# api basics
- class TestRequest < AmazonFlexPay::API::Base
+ class TestRequest < AmazonFlexPay::API::BaseRequest
attribute :foo
attribute :amount, :type => :amount
attribute :stuffs, :collection => :amount
- class Response < AmazonFlexPay::API::Base::BaseResponse; end
+ class Response < AmazonFlexPay::API::BaseRequest::BaseResponse; end
end
should "respond with data structures even when models are empty" do

0 comments on commit bf47529

Please sign in to comment.