remit2 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -76,9 +76,10 @@ module Remit
76
76
  end
77
77
  end
78
78
 
79
- class RefundResult < BaseResponse
80
- parameter :transaction_id
81
- parameter :transaction_status
79
+ class MarketplaceRefundPolicy
80
+ MASTER_TRANSACTION_ONLY = "MasterTxnOnly"
81
+ MARKEPLACE_TRANSACTION_ONLY = "MarketplaceTxnOnly"
82
+ MASTER_AND_MARKETPLACE_TRANSACTION = "MasterAndMarketplaceTxn"
82
83
  end
83
84
 
84
85
  class TransactionStatus
@@ -15,10 +15,15 @@ module Remit
15
15
  "#{convert_key(key).to_s}.#{convert_key(parameter).to_s}"
16
16
  end
17
17
  end
18
-
18
+
19
+ class InnerResponse < Remit::BaseResponse
20
+ parameter :transaction_id
21
+ parameter :transaction_status
22
+ end
23
+
19
24
  class Response < Remit::Response
20
- parser :rexml
21
- parameter :refund_result, :type => RefundResult
25
+ parameter :inner, :element => "RefundResult", :type => InnerResponse
26
+ inner_parameters :transaction_id, :transaction_status
22
27
  end
23
28
 
24
29
  def refund(request = Request.new)
@@ -0,0 +1,31 @@
1
+ require File.dirname(__FILE__) + '/units_helper'
2
+
3
+ describe "the Refund API" do
4
+ describe "a successful response" do
5
+ it_should_behave_like 'a successful response'
6
+
7
+ before do
8
+ doc = <<-XML
9
+ <RefundResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
10
+ <RefundResult>
11
+ <TransactionId>1547A4MZV3EJVR7R1ETZBIGO6BLR386P827</TransactionId>
12
+ <TransactionStatus>Pending</TransactionStatus>
13
+ </RefundResult>
14
+ <ResponseMetadata>
15
+ <RequestId>9d5b22f7-5d3e-4910-93ae-e41b4c808206:0</RequestId>
16
+ </ResponseMetadata>
17
+ </RefundResponse>
18
+ XML
19
+
20
+ @response = Remit::Refund::Response.new(doc)
21
+ end
22
+
23
+ it "has a transaction id" do
24
+ @response.transaction_id.should == '1547A4MZV3EJVR7R1ETZBIGO6BLR386P827'
25
+ end
26
+
27
+ it "has a transaction status" do
28
+ @response.transaction_status.should == 'Pending'
29
+ end
30
+ end
31
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 7
9
- version: 0.0.7
8
+ - 8
9
+ version: 0.0.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Micah Wedemeyer
@@ -114,6 +114,7 @@ test_files:
114
114
  - spec/units/get_pipeline_spec.rb
115
115
  - spec/units/ipn_request_spec.rb
116
116
  - spec/units/pay_spec.rb
117
+ - spec/units/refund_spec.rb
117
118
  - spec/units/remit_spec.rb
118
119
  - spec/spec_helper.rb
119
120
  - spec/units/units_helper.rb