remit 0.0.6 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +36 -5
- data/lib/remit.rb +35 -39
- data/lib/remit/common.rb +79 -24
- data/lib/remit/data_types.rb +118 -17
- data/lib/remit/get_pipeline.rb +160 -80
- data/lib/remit/inbound_request.rb +85 -0
- data/lib/remit/ipn_request.rb +4 -39
- data/lib/remit/operations/cancel.rb +20 -0
- data/lib/remit/operations/cancel_subscription_and_refund.rb +5 -1
- data/lib/remit/operations/cancel_token.rb +1 -0
- data/lib/remit/operations/fund_prepaid.rb +6 -4
- data/lib/remit/operations/get_account_activity.rb +5 -34
- data/lib/remit/operations/get_account_balance.rb +14 -11
- data/lib/remit/operations/get_all_credit_instruments.rb +2 -0
- data/lib/remit/operations/get_all_prepaid_instruments.rb +2 -0
- data/lib/remit/operations/get_debt_balance.rb +9 -4
- data/lib/remit/operations/get_outstanding_debt_balance.rb +8 -5
- data/lib/remit/operations/get_payment_instruction.rb +2 -0
- data/lib/remit/operations/get_prepaid_balance.rb +9 -5
- data/lib/remit/operations/get_recipient_verification_status.rb +25 -0
- data/lib/remit/operations/get_token_by_caller.rb +5 -1
- data/lib/remit/operations/get_token_usage.rb +5 -1
- data/lib/remit/operations/get_tokens.rb +5 -1
- data/lib/remit/operations/get_total_prepaid_liability.rb +9 -5
- data/lib/remit/operations/get_transaction.rb +1 -25
- data/lib/remit/operations/get_transaction_status.rb +28 -0
- data/lib/remit/operations/install_payment_instruction.rb +8 -1
- data/lib/remit/operations/pay.rb +5 -9
- data/lib/remit/operations/refund.rb +20 -11
- data/lib/remit/operations/reserve.rb +2 -4
- data/lib/remit/operations/settle.rb +2 -1
- data/lib/remit/operations/settle_debt.rb +2 -4
- data/lib/remit/operations/subscribe_for_caller_notification.rb +2 -0
- data/lib/remit/operations/unsubscribe_for_caller_notification.rb +2 -0
- data/lib/remit/operations/write_off_debt.rb +2 -4
- data/lib/remit/pipeline_response.rb +8 -41
- data/lib/remit/signature_utils_for_outbound.rb +74 -0
- data/lib/remit/verify_signature.rb +21 -0
- data/spec/integrations/get_account_activity_spec.rb +25 -19
- data/spec/integrations/get_tokens_spec.rb +9 -7
- data/spec/integrations/integrations_helper.rb +7 -0
- data/spec/integrations/ipn_request_spec.rb +28 -20
- data/spec/integrations/pipeline_response_spec.rb +27 -0
- data/spec/integrations/verify_signature_spec.rb +140 -0
- data/spec/mocks/CancelResponse.xml +13 -0
- data/spec/mocks/CancelSubscriptionAndRefundResponse.xml +10 -0
- data/spec/mocks/CancelTokenResponse.xml +6 -0
- data/spec/mocks/ErrorResponse.xml +15 -0
- data/spec/mocks/FundPrepaidResponse.xml +11 -0
- data/spec/mocks/GetAccountActivityResponse.xml +68 -0
- data/spec/mocks/GetAccountBalanceResponse.xml +34 -0
- data/spec/mocks/GetDebtBalanceResponse.xml +21 -0
- data/spec/mocks/GetOutstandingDebtBalanceResponse.xml +21 -0
- data/spec/mocks/GetPaymentInstructionResponse.xml +25 -0
- data/spec/mocks/GetPrepaidBalanceResponse.xml +21 -0
- data/spec/mocks/GetRecipientVerificationStatusResponse.xml +9 -0
- data/spec/mocks/GetTokenByCallerResponse.xml +22 -0
- data/spec/mocks/GetTokenUsageResponse.xml +28 -0
- data/spec/mocks/GetTokensResponse.xml +22 -0
- data/spec/mocks/GetTotalPrepaidLiabilityResponse.xml +21 -0
- data/spec/mocks/GetTransactionResponse.xml +76 -0
- data/spec/mocks/GetTransactionStatusResponse.xml +16 -0
- data/spec/mocks/InstallPaymentInstructionResponse.xml +10 -0
- data/spec/mocks/PayResponse.xml +11 -0
- data/spec/mocks/RefundResponse.xml +11 -0
- data/spec/mocks/ReserveResponse.xml +11 -0
- data/spec/mocks/SettleDebtResponse.xml +11 -0
- data/spec/mocks/SettleResponse.xml +11 -0
- data/spec/mocks/VerifySignatureResponse.xml +11 -0
- data/spec/mocks/WriteOffDebtResponse.xml +11 -0
- data/spec/mocks/errors/InvalidParameterValue.xml +10 -0
- data/spec/mocks/errors/InvalidParams_certificateUrl.xml +2 -0
- data/spec/mocks/errors/RequestExpired.xml +10 -0
- data/spec/spec_helper.rb +59 -10
- data/spec/units/cancel_subscription_and_refund_spec.rb +29 -0
- data/spec/units/cancel_token_spec.rb +24 -0
- data/spec/units/fund_prepaid_spec.rb +28 -0
- data/spec/units/get_account_activity_spec.rb +58 -0
- data/spec/units/get_account_balance_spec.rb +28 -0
- data/spec/units/get_debt_balance_spec.rb +29 -0
- data/spec/units/get_outstanding_debt_balance_spec.rb +29 -0
- data/spec/units/get_pipeline_spec.rb +16 -0
- data/spec/units/get_prepaid_balance_spec.rb +29 -0
- data/spec/units/get_recipient_verification_status_spec.rb +26 -0
- data/spec/units/get_token_by_caller_spec.rb +56 -0
- data/spec/units/get_token_usage_spec.rb +51 -0
- data/spec/units/get_tokens_spec.rb +56 -0
- data/spec/units/get_total_prepaid_liability_spec.rb +26 -0
- data/spec/units/get_transaction_spec.rb +103 -0
- data/spec/units/get_transaction_status_spec.rb +44 -0
- data/spec/units/pay_spec.rb +36 -57
- data/spec/units/refund_spec.rb +41 -0
- data/spec/units/reserve_spec.rb +41 -0
- data/spec/units/settle_debt_spec.rb +41 -0
- data/spec/units/settle_spec.rb +41 -0
- data/spec/units/units_helper.rb +23 -2
- data/spec/units/write_off_debt_spec.rb +41 -0
- metadata +116 -12
- data/lib/remit/operations/discard_results.rb +0 -18
- data/lib/remit/operations/get_results.rb +0 -27
- data/lib/remit/operations/retry_transaction.rb +0 -18
- data/spec/units/get_results_spec.rb +0 -49
data/spec/units/units_helper.rb
CHANGED
@@ -1,4 +1,25 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# figure out where we are being loaded from
|
2
|
+
if $LOADED_FEATURES.grep(/spec\/units\/units_helper\.rb/).any?
|
3
|
+
begin
|
4
|
+
raise "foo"
|
5
|
+
rescue => e
|
6
|
+
puts <<-MSG
|
7
|
+
===================================================
|
8
|
+
It looks like units/units_helper.rb has been loaded
|
9
|
+
multiple times. Normalize the require to:
|
3
10
|
|
11
|
+
require "spec/units/units_helper"
|
12
|
+
|
13
|
+
Things like File.join and File.expand_path will
|
14
|
+
cause it to be loaded multiple times.
|
15
|
+
|
16
|
+
Loaded this time from:
|
17
|
+
|
18
|
+
#{e.backtrace.join("\n ")}
|
19
|
+
===================================================
|
20
|
+
MSG
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Actual code of Units Helper below:
|
4
25
|
require File.dirname(__FILE__) + '/../spec_helper'
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/units_helper'
|
2
|
+
|
3
|
+
describe "the WriteOffDebt API" do
|
4
|
+
describe "a successful response" do
|
5
|
+
it_should_behave_like 'a successful response'
|
6
|
+
|
7
|
+
before do
|
8
|
+
doc = <<-XML
|
9
|
+
<WriteOffDebtResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
|
10
|
+
<WriteOffDebtResult>
|
11
|
+
<TransactionId>14GK6F2QU755ODS27SGHEURLKPG72Z54KMF</TransactionId>
|
12
|
+
<TransactionStatus>Pending</TransactionStatus>
|
13
|
+
</WriteOffDebtResult>
|
14
|
+
<ResponseMetadata>
|
15
|
+
<RequestId>1a146b9a-b37b-4f5f-bda6-012a5b9e45c3:0</RequestId>
|
16
|
+
</ResponseMetadata>
|
17
|
+
</WriteOffDebtResponse>
|
18
|
+
XML
|
19
|
+
|
20
|
+
@response = Remit::WriteOffDebt::Response.new(doc)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "has metadata" do
|
24
|
+
@response.response_metadata.should_not be_nil
|
25
|
+
end
|
26
|
+
|
27
|
+
it "has results" do
|
28
|
+
@response.write_off_debt_result.should_not be_nil
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
it "has a transaction id" do
|
33
|
+
@response.write_off_debt_result.transaction_id.should_not be_nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it "has a transaction status" do
|
37
|
+
@response.write_off_debt_result.transaction_status.should_not be_nil
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
+
- 2
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 0.0.6
|
9
|
+
- 1
|
10
|
+
version: 2.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tyler Hunt
|
14
|
+
- Peter Boling
|
14
15
|
autorequire:
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
@@ -35,7 +36,7 @@ dependencies:
|
|
35
36
|
type: :runtime
|
36
37
|
version_requirements: *id001
|
37
38
|
description:
|
38
|
-
email:
|
39
|
+
email: peter.boling+remit@gmail.com
|
39
40
|
executables: []
|
40
41
|
|
41
42
|
extensions: []
|
@@ -52,10 +53,11 @@ files:
|
|
52
53
|
- lib/remit/data_types.rb
|
53
54
|
- lib/remit/error_codes.rb
|
54
55
|
- lib/remit/get_pipeline.rb
|
56
|
+
- lib/remit/inbound_request.rb
|
55
57
|
- lib/remit/ipn_request.rb
|
58
|
+
- lib/remit/operations/cancel.rb
|
56
59
|
- lib/remit/operations/cancel_subscription_and_refund.rb
|
57
60
|
- lib/remit/operations/cancel_token.rb
|
58
|
-
- lib/remit/operations/discard_results.rb
|
59
61
|
- lib/remit/operations/fund_prepaid.rb
|
60
62
|
- lib/remit/operations/get_account_activity.rb
|
61
63
|
- lib/remit/operations/get_account_balance.rb
|
@@ -65,36 +67,88 @@ files:
|
|
65
67
|
- lib/remit/operations/get_outstanding_debt_balance.rb
|
66
68
|
- lib/remit/operations/get_payment_instruction.rb
|
67
69
|
- lib/remit/operations/get_prepaid_balance.rb
|
68
|
-
- lib/remit/operations/
|
70
|
+
- lib/remit/operations/get_recipient_verification_status.rb
|
69
71
|
- lib/remit/operations/get_token_by_caller.rb
|
70
72
|
- lib/remit/operations/get_token_usage.rb
|
71
73
|
- lib/remit/operations/get_tokens.rb
|
72
74
|
- lib/remit/operations/get_total_prepaid_liability.rb
|
73
75
|
- lib/remit/operations/get_transaction.rb
|
76
|
+
- lib/remit/operations/get_transaction_status.rb
|
74
77
|
- lib/remit/operations/install_payment_instruction.rb
|
75
78
|
- lib/remit/operations/pay.rb
|
76
79
|
- lib/remit/operations/refund.rb
|
77
80
|
- lib/remit/operations/reserve.rb
|
78
|
-
- lib/remit/operations/retry_transaction.rb
|
79
81
|
- lib/remit/operations/settle.rb
|
80
82
|
- lib/remit/operations/settle_debt.rb
|
81
83
|
- lib/remit/operations/subscribe_for_caller_notification.rb
|
82
84
|
- lib/remit/operations/unsubscribe_for_caller_notification.rb
|
83
85
|
- lib/remit/operations/write_off_debt.rb
|
84
86
|
- lib/remit/pipeline_response.rb
|
87
|
+
- lib/remit/signature_utils_for_outbound.rb
|
88
|
+
- lib/remit/verify_signature.rb
|
85
89
|
- LICENSE
|
86
90
|
- README.markdown
|
87
91
|
- spec/integrations/get_account_activity_spec.rb
|
88
92
|
- spec/integrations/get_tokens_spec.rb
|
89
93
|
- spec/integrations/ipn_request_spec.rb
|
94
|
+
- spec/integrations/pipeline_response_spec.rb
|
95
|
+
- spec/integrations/verify_signature_spec.rb
|
96
|
+
- spec/units/cancel_subscription_and_refund_spec.rb
|
97
|
+
- spec/units/cancel_token_spec.rb
|
98
|
+
- spec/units/fund_prepaid_spec.rb
|
99
|
+
- spec/units/get_account_activity_spec.rb
|
100
|
+
- spec/units/get_account_balance_spec.rb
|
101
|
+
- spec/units/get_debt_balance_spec.rb
|
102
|
+
- spec/units/get_outstanding_debt_balance_spec.rb
|
90
103
|
- spec/units/get_pipeline_spec.rb
|
91
|
-
- spec/units/
|
104
|
+
- spec/units/get_prepaid_balance_spec.rb
|
105
|
+
- spec/units/get_recipient_verification_status_spec.rb
|
106
|
+
- spec/units/get_token_by_caller_spec.rb
|
107
|
+
- spec/units/get_token_usage_spec.rb
|
108
|
+
- spec/units/get_tokens_spec.rb
|
109
|
+
- spec/units/get_total_prepaid_liability_spec.rb
|
110
|
+
- spec/units/get_transaction_spec.rb
|
111
|
+
- spec/units/get_transaction_status_spec.rb
|
92
112
|
- spec/units/pay_spec.rb
|
113
|
+
- spec/units/refund_spec.rb
|
114
|
+
- spec/units/reserve_spec.rb
|
115
|
+
- spec/units/settle_debt_spec.rb
|
116
|
+
- spec/units/settle_spec.rb
|
117
|
+
- spec/units/write_off_debt_spec.rb
|
93
118
|
- spec/integrations/integrations_helper.rb
|
94
119
|
- spec/spec_helper.rb
|
95
120
|
- spec/units/units_helper.rb
|
121
|
+
- spec/mocks/CancelResponse.xml
|
122
|
+
- spec/mocks/CancelSubscriptionAndRefundResponse.xml
|
123
|
+
- spec/mocks/CancelTokenResponse.xml
|
124
|
+
- spec/mocks/ErrorResponse.xml
|
125
|
+
- spec/mocks/errors/InvalidParameterValue.xml
|
126
|
+
- spec/mocks/errors/InvalidParams_certificateUrl.xml
|
127
|
+
- spec/mocks/errors/RequestExpired.xml
|
128
|
+
- spec/mocks/FundPrepaidResponse.xml
|
129
|
+
- spec/mocks/GetAccountActivityResponse.xml
|
130
|
+
- spec/mocks/GetAccountBalanceResponse.xml
|
131
|
+
- spec/mocks/GetDebtBalanceResponse.xml
|
132
|
+
- spec/mocks/GetOutstandingDebtBalanceResponse.xml
|
133
|
+
- spec/mocks/GetPaymentInstructionResponse.xml
|
134
|
+
- spec/mocks/GetPrepaidBalanceResponse.xml
|
135
|
+
- spec/mocks/GetRecipientVerificationStatusResponse.xml
|
136
|
+
- spec/mocks/GetTokenByCallerResponse.xml
|
137
|
+
- spec/mocks/GetTokensResponse.xml
|
138
|
+
- spec/mocks/GetTokenUsageResponse.xml
|
139
|
+
- spec/mocks/GetTotalPrepaidLiabilityResponse.xml
|
140
|
+
- spec/mocks/GetTransactionResponse.xml
|
141
|
+
- spec/mocks/GetTransactionStatusResponse.xml
|
142
|
+
- spec/mocks/InstallPaymentInstructionResponse.xml
|
143
|
+
- spec/mocks/PayResponse.xml
|
144
|
+
- spec/mocks/RefundResponse.xml
|
145
|
+
- spec/mocks/ReserveResponse.xml
|
146
|
+
- spec/mocks/SettleDebtResponse.xml
|
147
|
+
- spec/mocks/SettleResponse.xml
|
148
|
+
- spec/mocks/VerifySignatureResponse.xml
|
149
|
+
- spec/mocks/WriteOffDebtResponse.xml
|
96
150
|
has_rdoc: true
|
97
|
-
homepage: http://github.com/
|
151
|
+
homepage: http://github.com/nyc-ruby-meetup/remit
|
98
152
|
licenses: []
|
99
153
|
|
100
154
|
post_install_message:
|
@@ -122,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
176
|
version: "0"
|
123
177
|
requirements: []
|
124
178
|
|
125
|
-
rubyforge_project: remit
|
179
|
+
rubyforge_project: remit-nyc
|
126
180
|
rubygems_version: 1.3.7
|
127
181
|
signing_key:
|
128
182
|
specification_version: 3
|
@@ -131,9 +185,59 @@ test_files:
|
|
131
185
|
- spec/integrations/get_account_activity_spec.rb
|
132
186
|
- spec/integrations/get_tokens_spec.rb
|
133
187
|
- spec/integrations/ipn_request_spec.rb
|
188
|
+
- spec/integrations/pipeline_response_spec.rb
|
189
|
+
- spec/integrations/verify_signature_spec.rb
|
190
|
+
- spec/units/cancel_subscription_and_refund_spec.rb
|
191
|
+
- spec/units/cancel_token_spec.rb
|
192
|
+
- spec/units/fund_prepaid_spec.rb
|
193
|
+
- spec/units/get_account_activity_spec.rb
|
194
|
+
- spec/units/get_account_balance_spec.rb
|
195
|
+
- spec/units/get_debt_balance_spec.rb
|
196
|
+
- spec/units/get_outstanding_debt_balance_spec.rb
|
134
197
|
- spec/units/get_pipeline_spec.rb
|
135
|
-
- spec/units/
|
198
|
+
- spec/units/get_prepaid_balance_spec.rb
|
199
|
+
- spec/units/get_recipient_verification_status_spec.rb
|
200
|
+
- spec/units/get_token_by_caller_spec.rb
|
201
|
+
- spec/units/get_token_usage_spec.rb
|
202
|
+
- spec/units/get_tokens_spec.rb
|
203
|
+
- spec/units/get_total_prepaid_liability_spec.rb
|
204
|
+
- spec/units/get_transaction_spec.rb
|
205
|
+
- spec/units/get_transaction_status_spec.rb
|
136
206
|
- spec/units/pay_spec.rb
|
207
|
+
- spec/units/refund_spec.rb
|
208
|
+
- spec/units/reserve_spec.rb
|
209
|
+
- spec/units/settle_debt_spec.rb
|
210
|
+
- spec/units/settle_spec.rb
|
211
|
+
- spec/units/write_off_debt_spec.rb
|
137
212
|
- spec/integrations/integrations_helper.rb
|
138
213
|
- spec/spec_helper.rb
|
139
214
|
- spec/units/units_helper.rb
|
215
|
+
- spec/mocks/CancelResponse.xml
|
216
|
+
- spec/mocks/CancelSubscriptionAndRefundResponse.xml
|
217
|
+
- spec/mocks/CancelTokenResponse.xml
|
218
|
+
- spec/mocks/ErrorResponse.xml
|
219
|
+
- spec/mocks/errors/InvalidParameterValue.xml
|
220
|
+
- spec/mocks/errors/InvalidParams_certificateUrl.xml
|
221
|
+
- spec/mocks/errors/RequestExpired.xml
|
222
|
+
- spec/mocks/FundPrepaidResponse.xml
|
223
|
+
- spec/mocks/GetAccountActivityResponse.xml
|
224
|
+
- spec/mocks/GetAccountBalanceResponse.xml
|
225
|
+
- spec/mocks/GetDebtBalanceResponse.xml
|
226
|
+
- spec/mocks/GetOutstandingDebtBalanceResponse.xml
|
227
|
+
- spec/mocks/GetPaymentInstructionResponse.xml
|
228
|
+
- spec/mocks/GetPrepaidBalanceResponse.xml
|
229
|
+
- spec/mocks/GetRecipientVerificationStatusResponse.xml
|
230
|
+
- spec/mocks/GetTokenByCallerResponse.xml
|
231
|
+
- spec/mocks/GetTokensResponse.xml
|
232
|
+
- spec/mocks/GetTokenUsageResponse.xml
|
233
|
+
- spec/mocks/GetTotalPrepaidLiabilityResponse.xml
|
234
|
+
- spec/mocks/GetTransactionResponse.xml
|
235
|
+
- spec/mocks/GetTransactionStatusResponse.xml
|
236
|
+
- spec/mocks/InstallPaymentInstructionResponse.xml
|
237
|
+
- spec/mocks/PayResponse.xml
|
238
|
+
- spec/mocks/RefundResponse.xml
|
239
|
+
- spec/mocks/ReserveResponse.xml
|
240
|
+
- spec/mocks/SettleDebtResponse.xml
|
241
|
+
- spec/mocks/SettleResponse.xml
|
242
|
+
- spec/mocks/VerifySignatureResponse.xml
|
243
|
+
- spec/mocks/WriteOffDebtResponse.xml
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'remit/common'
|
2
|
-
|
3
|
-
module Remit
|
4
|
-
module DiscardResults
|
5
|
-
class Request < Remit::Request
|
6
|
-
action :DiscardResults
|
7
|
-
parameter :transaction_ids, :required => true
|
8
|
-
end
|
9
|
-
|
10
|
-
class Response < Remit::Response
|
11
|
-
parameter :discard_errors
|
12
|
-
end
|
13
|
-
|
14
|
-
def discard_results(request = Request.new)
|
15
|
-
call(request, Response)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'remit/common'
|
2
|
-
|
3
|
-
module Remit
|
4
|
-
module GetResults
|
5
|
-
class Request < Remit::Request
|
6
|
-
action :GetResults
|
7
|
-
parameter :operation
|
8
|
-
parameter :max_results_count
|
9
|
-
end
|
10
|
-
|
11
|
-
class Response < Remit::Response
|
12
|
-
class TransactionResults < Remit::BaseResponse
|
13
|
-
parameter :transaction_id
|
14
|
-
parameter :operation_type, :element => :operation
|
15
|
-
parameter :caller_reference
|
16
|
-
parameter :transaction_status, :element => :status
|
17
|
-
end
|
18
|
-
|
19
|
-
parameter :transaction_results, :collection => TransactionResults
|
20
|
-
parameter :number_pending, :type => :integer
|
21
|
-
end
|
22
|
-
|
23
|
-
def get_results(request = Request.new)
|
24
|
-
call(request, Response)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'remit/common'
|
2
|
-
|
3
|
-
module Remit
|
4
|
-
module RetryTransaction
|
5
|
-
class Request < Remit::Request
|
6
|
-
action :RetryTransaction
|
7
|
-
parameter :original_transaction_id, :required => true
|
8
|
-
end
|
9
|
-
|
10
|
-
class Response < Remit::Response
|
11
|
-
parameter :transaction_response, :type => TransactionResponse
|
12
|
-
end
|
13
|
-
|
14
|
-
def retry_transaction(request = Request.new)
|
15
|
-
call(request, Response)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/units_helper'
|
2
|
-
|
3
|
-
describe "the GetResults API" do
|
4
|
-
describe "a successful response" do
|
5
|
-
it_should_behave_like 'a successful response'
|
6
|
-
|
7
|
-
before do
|
8
|
-
doc = <<-XML
|
9
|
-
<?xml version=\"1.0\"?>
|
10
|
-
<ns3:GetResultsResponse xmlns:ns3=\"http://fps.amazonaws.com/doc/2007-01-08/\">
|
11
|
-
<TransactionResults>
|
12
|
-
<TransactionId>abc123</TransactionId>
|
13
|
-
<Operation>Pay</Operation>
|
14
|
-
<CallerReference>1827</CallerReference>
|
15
|
-
<Status>Success</Status>
|
16
|
-
</TransactionResults>
|
17
|
-
<NumberPending>1</NumberPending>
|
18
|
-
<Status>Success</Status>
|
19
|
-
<RequestId>f89727ba-9ff6-4ca8-87a3-0fd6c9de6b95:0</RequestId>
|
20
|
-
</ns3:GetResultsResponse>
|
21
|
-
XML
|
22
|
-
|
23
|
-
@response = Remit::GetResults::Response.new(doc)
|
24
|
-
end
|
25
|
-
|
26
|
-
it "has one result" do
|
27
|
-
@response.number_pending.should == 1
|
28
|
-
@response.transaction_results.size == "1"
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "the result" do
|
32
|
-
before do
|
33
|
-
@result = @response.transaction_results.first
|
34
|
-
end
|
35
|
-
|
36
|
-
it "references a previous transaction" do
|
37
|
-
@result.transaction_id.should == "abc123"
|
38
|
-
end
|
39
|
-
|
40
|
-
it "references a pay transaction" do
|
41
|
-
@result.operation_type.should == 'Pay'
|
42
|
-
end
|
43
|
-
|
44
|
-
it "reports the transaction's new status" do
|
45
|
-
@result.transaction_status.should == 'Success'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|