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
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/units_helper'
|
2
|
+
|
3
|
+
describe "the GetTotalPrepaidLiability API" do
|
4
|
+
describe "a successful response" do
|
5
|
+
it_should_behave_like 'a successful response'
|
6
|
+
|
7
|
+
before do
|
8
|
+
doc = File.read("spec/mocks/GetTotalPrepaidLiabilityResponse.xml")
|
9
|
+
|
10
|
+
@response = Remit::GetTotalPrepaidLiability::Response.new(doc)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "has metadata" do
|
14
|
+
@response.response_metadata.should_not be_nil
|
15
|
+
end
|
16
|
+
|
17
|
+
it "has results" do
|
18
|
+
@response.get_total_prepaid_liability_result.should be_a_kind_of Remit::GetTotalPrepaidLiability::Response::GetTotalPrepaidLiabilityResult
|
19
|
+
end
|
20
|
+
|
21
|
+
it "has outstanding prepaid liability" do
|
22
|
+
@response.get_total_prepaid_liability_result.outstanding_prepaid_liability.should be_a_kind_of Remit::GetTotalPrepaidLiability::Response::GetTotalPrepaidLiabilityResult::OutstandingPrepaidLiability
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/units_helper'
|
2
|
+
|
3
|
+
describe "the GetTransaction API" do
|
4
|
+
describe "a successful response" do
|
5
|
+
it_should_behave_like 'a successful response'
|
6
|
+
|
7
|
+
before(:all) do
|
8
|
+
doc = File.read("spec/mocks/GetTransactionResponse.xml")
|
9
|
+
|
10
|
+
@response = Remit::GetTransaction::Response.new(doc)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "has one transaction" do
|
14
|
+
@response.transaction.should_not be_nil
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "the result" do
|
18
|
+
before(:all) do
|
19
|
+
@transaction = @response.transaction
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should have a transaction_id" do
|
23
|
+
@transaction.transaction_id.should_not be_nil
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should have caller_reference" do
|
27
|
+
@transaction.caller_reference.should_not be_nil
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should have caller_description" do
|
31
|
+
@transaction.caller_description.should_not be_nil
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should have date_received" do
|
35
|
+
@transaction.date_received.should_not be_nil
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should have date_completed" do
|
39
|
+
@transaction.date_completed.should_not be_nil
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should have transaction_amount" do
|
43
|
+
@transaction.transaction_amount.should_not be_nil
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should have transaction_amount.value" do
|
47
|
+
@transaction.transaction_amount.value.should == 0
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should have fps_fess_paid_by" do
|
51
|
+
@transaction.fps_fees_paid_by.should_not be_nil
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should have sender_token_id" do
|
55
|
+
@transaction.sender_token_id.strip.should_not be_nil
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should have fps_operation" do
|
59
|
+
@transaction.fps_operation.should_not be_nil
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should have payment_method" do
|
63
|
+
@transaction.payment_method.should_not be_nil
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should have transaction_status" do
|
67
|
+
@transaction.transaction_status.should_not be_nil
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should have status_code" do
|
71
|
+
@transaction.status_code.should_not be_nil
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should have status_message" do
|
75
|
+
@transaction.status_message.should_not be_nil
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should have sender name" do
|
79
|
+
@transaction.sender_name.should_not be_nil
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should have sender email" do
|
83
|
+
@transaction.sender_email.should_not be_nil
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should have caller name" do
|
87
|
+
@transaction.caller_name.should_not be_nil
|
88
|
+
end
|
89
|
+
|
90
|
+
it "should have recipient name" do
|
91
|
+
@transaction.recipient_name.should_not be_nil
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should have recipient email" do
|
95
|
+
@transaction.recipient_email.should_not be_nil
|
96
|
+
end
|
97
|
+
|
98
|
+
it "reports the transaction's new status" do
|
99
|
+
@transaction.transaction_status.should_not be_nil
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/units_helper'
|
2
|
+
|
3
|
+
describe "the GetTransaction API" do
|
4
|
+
describe "a successful response" do
|
5
|
+
it_should_behave_like 'a successful response'
|
6
|
+
|
7
|
+
before do
|
8
|
+
doc = File.read("spec/mocks/GetTransactionStatusResponse.xml")
|
9
|
+
|
10
|
+
@response = Remit::GetTransactionStatus::Response.new(doc)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "has one transaction" do
|
14
|
+
@response.get_transaction_status_result.should_not be_nil
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "the result" do
|
18
|
+
before do
|
19
|
+
@transaction = @response.get_transaction_status_result
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should have a transaction_id" do
|
23
|
+
@transaction.transaction_id.should_not be_nil
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
it "should have transaction_status" do
|
28
|
+
@transaction.transaction_status.should_not be_nil
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should have status_code" do
|
32
|
+
@transaction.status_code.should_not be_nil
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should have status_message" do
|
36
|
+
@transaction.status_message.should_not be_nil
|
37
|
+
end
|
38
|
+
|
39
|
+
it "reports the transaction's new status" do
|
40
|
+
@transaction.transaction_status.should_not be_nil
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/spec/units/pay_spec.rb
CHANGED
@@ -6,100 +6,79 @@ describe "the Pay API" do
|
|
6
6
|
|
7
7
|
before do
|
8
8
|
doc = <<-XML
|
9
|
-
|
10
|
-
|
9
|
+
<PayResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
|
10
|
+
<PayResult>
|
11
11
|
<TransactionId>abc123</TransactionId>
|
12
|
-
<
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
<TransactionStatus>Success</TransactionStatus>
|
13
|
+
</PayResult>
|
14
|
+
<ResponseMetadata>
|
15
|
+
<RequestId>foo-bar</RequestId>
|
16
|
+
</ResponseMetadata>
|
17
|
+
</PayResponse>
|
17
18
|
XML
|
18
19
|
|
19
20
|
@response = Remit::Pay::Response.new(doc)
|
20
21
|
end
|
21
22
|
|
22
23
|
it "has a transaction response" do
|
23
|
-
@response.
|
24
|
+
@response.pay_result.should_not be_nil
|
24
25
|
end
|
25
26
|
|
26
27
|
it "has a transaction id" do
|
27
|
-
@response.
|
28
|
+
@response.pay_result.transaction_id.should == 'abc123'
|
28
29
|
end
|
29
30
|
|
30
31
|
it "has a transaction status" do
|
31
|
-
@response.
|
32
|
+
@response.pay_result.transaction_status.should == 'Success'
|
32
33
|
end
|
33
34
|
|
34
|
-
it "has status shortcuts" do
|
35
|
-
|
36
|
-
end
|
35
|
+
#it "has status shortcuts" do
|
36
|
+
# @response.pay_result.should be_initiated
|
37
|
+
#end
|
37
38
|
end
|
38
39
|
|
39
|
-
describe "for a
|
40
|
+
describe "for a pending request" do
|
40
41
|
before do
|
41
42
|
doc = <<-XML
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
<
|
49
|
-
|
50
|
-
|
51
|
-
</Errors>
|
52
|
-
</Errors>
|
53
|
-
<RequestId>7966a2d9-5ce9-4902-aefc-b01d254c931a:0</RequestId>
|
54
|
-
</ns3:PayResponse>
|
43
|
+
<PayResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
|
44
|
+
<PayResult>
|
45
|
+
<TransactionId>14GK6BGKA7U6OU6SUTNLBI5SBBV9PGDJ6UL</TransactionId>
|
46
|
+
<TransactionStatus>Pending</TransactionStatus>
|
47
|
+
</PayResult>
|
48
|
+
<ResponseMetadata>
|
49
|
+
<RequestId>c21e7735-9c08-4cd8-99bf-535a848c79b4:0</RequestId>
|
50
|
+
</ResponseMetadata>
|
51
|
+
</PayResponse>
|
55
52
|
XML
|
56
53
|
|
57
54
|
@response = Remit::Pay::Response.new(doc)
|
58
55
|
@error = @response.errors.first
|
59
56
|
end
|
60
57
|
|
61
|
-
it_should_behave_like 'a
|
58
|
+
it_should_behave_like 'a pending response'
|
62
59
|
|
63
|
-
describe "with an invalid params error" do
|
64
|
-
it "should be a service error" do
|
65
|
-
@error.should be_kind_of(Remit::ServiceError)
|
66
|
-
end
|
67
|
-
|
68
|
-
it "should have an error type of 'Business'" do
|
69
|
-
@error.error_type.should == 'Business'
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should have an error code of 'InvalidParams'" do
|
73
|
-
@error.error_code.should == 'InvalidParams'
|
74
|
-
end
|
75
|
-
|
76
|
-
it "should not be retriable" do
|
77
|
-
@error.is_retriable.should == 'false'
|
78
|
-
end
|
79
|
-
|
80
|
-
it "should have reason text" do
|
81
|
-
@error.reason_text.should == 'callerTokenId can not be empty'
|
82
|
-
end
|
83
|
-
end
|
84
60
|
end
|
85
61
|
|
86
62
|
describe "for a failed request" do
|
87
63
|
before do
|
88
64
|
doc = <<-XML
|
89
|
-
|
90
|
-
|
91
|
-
|
65
|
+
<PayResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
|
66
|
+
<PayResult>
|
67
|
+
<TransactionId>14GK6BGKA7U6OU6SUTNLBI5SBBV9PGDJ6UL</TransactionId>
|
68
|
+
<TransactionStatus>Pending</TransactionStatus>
|
69
|
+
</PayResult>
|
70
|
+
<ResponseMetadata>
|
71
|
+
<RequestId>c21e7735-9c08-4cd8-99bf-535a848c79b4:0</RequestId>
|
72
|
+
</ResponseMetadata>
|
92
73
|
<Errors>
|
93
74
|
<Errors>
|
94
75
|
<ErrorType>Business</ErrorType>
|
95
76
|
<IsRetriable>false</IsRetriable>
|
96
77
|
<ErrorCode>TokenUsageError</ErrorCode>
|
97
|
-
<ReasonText>The token
|
98
|
-
</Errors>
|
78
|
+
<ReasonText>The token "45XU7TLBN995ZQA2U1PS1ZCTJXJMJ3H1GH6VZAB82C1BGLK9X3AXUQDA3QDLJVPX" has violated its usage policy.</ReasonText>
|
99
79
|
</Errors>
|
100
|
-
|
101
|
-
|
102
|
-
</ns3:PayResponse>
|
80
|
+
</Errors>
|
81
|
+
</PayResponse>
|
103
82
|
XML
|
104
83
|
|
105
84
|
@response = Remit::Pay::Response.new(doc)
|
@@ -0,0 +1,41 @@
|
|
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>14GK6F2QU755ODS27SGHEURLKPG72Z54KMF</TransactionId>
|
12
|
+
<TransactionStatus>Pending</TransactionStatus>
|
13
|
+
</RefundResult>
|
14
|
+
<ResponseMetadata>
|
15
|
+
<RequestId>1a146b9a-b37b-4f5f-bda6-012a5b9e45c3:0</RequestId>
|
16
|
+
</ResponseMetadata>
|
17
|
+
</RefundResponse>
|
18
|
+
XML
|
19
|
+
|
20
|
+
@response = Remit::Refund::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.refund_result.should_not be_nil
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
it "has a transaction id" do
|
33
|
+
@response.refund_result.transaction_id.should_not be_nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it "has a transaction status" do
|
37
|
+
@response.refund_result.transaction_status.should_not be_nil
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/units_helper'
|
2
|
+
|
3
|
+
describe "the Reserve API" do
|
4
|
+
describe "a successful response" do
|
5
|
+
it_should_behave_like 'a successful response'
|
6
|
+
|
7
|
+
before do
|
8
|
+
doc = <<-XML
|
9
|
+
<ReserveResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
|
10
|
+
<ReserveResult>
|
11
|
+
<TransactionId>14GK6F2QU755ODS27SGHEURLKPG72Z54KMF</TransactionId>
|
12
|
+
<TransactionStatus>Pending</TransactionStatus>
|
13
|
+
</ReserveResult>
|
14
|
+
<ResponseMetadata>
|
15
|
+
<RequestId>1a146b9a-b37b-4f5f-bda6-012a5b9e45c3:0</RequestId>
|
16
|
+
</ResponseMetadata>
|
17
|
+
</ReserveResponse>
|
18
|
+
XML
|
19
|
+
|
20
|
+
@response = Remit::Reserve::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.reserve_result.should_not be_nil
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
it "has a transaction id" do
|
33
|
+
@response.reserve_result.transaction_id.should_not be_nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it "has a transaction status" do
|
37
|
+
@response.reserve_result.transaction_status.should_not be_nil
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/units_helper'
|
2
|
+
|
3
|
+
describe "the SettleDebt API" do
|
4
|
+
describe "a successful response" do
|
5
|
+
it_should_behave_like 'a successful response'
|
6
|
+
|
7
|
+
before do
|
8
|
+
doc = <<-XML
|
9
|
+
<SettleDebtResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
|
10
|
+
<SettleDebtResult>
|
11
|
+
<TransactionId>14GK6F2QU755ODS27SGHEURLKPG72Z54KMF</TransactionId>
|
12
|
+
<TransactionStatus>Pending</TransactionStatus>
|
13
|
+
</SettleDebtResult>
|
14
|
+
<ResponseMetadata>
|
15
|
+
<RequestId>1a146b9a-b37b-4f5f-bda6-012a5b9e45c3:0</RequestId>
|
16
|
+
</ResponseMetadata>
|
17
|
+
</SettleDebtResponse>
|
18
|
+
XML
|
19
|
+
|
20
|
+
@response = Remit::SettleDebt::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.settle_debt_result.should_not be_nil
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
it "has a transaction id" do
|
33
|
+
@response.settle_debt_result.transaction_id.should_not be_nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it "has a transaction status" do
|
37
|
+
@response.settle_debt_result.transaction_status.should_not be_nil
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/units_helper'
|
2
|
+
|
3
|
+
describe "the Settle API" do
|
4
|
+
describe "a successful response" do
|
5
|
+
it_should_behave_like 'a successful response'
|
6
|
+
|
7
|
+
before do
|
8
|
+
doc = <<-XML
|
9
|
+
<SettleResponse xmlns="http://fps.amazonaws.com/doc/2008-09-17/">
|
10
|
+
<SettleResult>
|
11
|
+
<TransactionId>14GK6F2QU755ODS27SGHEURLKPG72Z54KMF</TransactionId>
|
12
|
+
<TransactionStatus>Pending</TransactionStatus>
|
13
|
+
</SettleResult>
|
14
|
+
<ResponseMetadata>
|
15
|
+
<RequestId>1a146b9a-b37b-4f5f-bda6-012a5b9e45c3:0</RequestId>
|
16
|
+
</ResponseMetadata>
|
17
|
+
</SettleResponse>
|
18
|
+
XML
|
19
|
+
|
20
|
+
@response = Remit::Settle::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.settle_result.should_not be_nil
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
it "has a transaction id" do
|
33
|
+
@response.settle_result.transaction_id.should_not be_nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it "has a transaction status" do
|
37
|
+
@response.settle_result.transaction_status.should_not be_nil
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|