braintree 2.102.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/braintree.gemspec +6 -3
- data/lib/braintree.rb +3 -17
- data/lib/braintree/address.rb +0 -22
- data/lib/braintree/address_gateway.rb +2 -2
- data/lib/braintree/base_module.rb +6 -0
- data/lib/braintree/bin_data.rb +9 -2
- data/lib/braintree/configuration.rb +1 -1
- data/lib/braintree/credit_card.rb +5 -76
- data/lib/braintree/credit_card_gateway.rb +3 -32
- data/lib/braintree/credit_card_verification.rb +14 -0
- data/lib/braintree/customer.rb +3 -72
- data/lib/braintree/customer_gateway.rb +0 -23
- data/lib/braintree/dispute.rb +1 -7
- data/lib/braintree/dispute/{history_event.rb → status_history.rb} +3 -1
- data/lib/braintree/dispute/transaction.rb +2 -0
- data/lib/braintree/dispute_gateway.rb +2 -7
- data/lib/braintree/error_codes.rb +152 -170
- data/lib/braintree/exceptions.rb +5 -3
- data/lib/braintree/gateway.rb +0 -14
- data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +1 -1
- data/lib/braintree/local_payment_completed.rb +1 -1
- data/lib/braintree/merchant_account_gateway.rb +2 -0
- data/lib/braintree/payment_instrument_type.rb +1 -4
- data/lib/braintree/payment_method_gateway.rb +4 -8
- data/lib/braintree/payment_method_parser.rb +1 -7
- data/lib/braintree/risk_data.rb +4 -1
- data/lib/braintree/subscription.rb +5 -5
- data/lib/braintree/successful_result.rb +0 -1
- data/lib/braintree/test/credit_card.rb +1 -0
- data/lib/braintree/test/nonce.rb +5 -20
- data/lib/braintree/transaction.rb +9 -73
- data/lib/braintree/transaction/address_details.rb +11 -0
- data/lib/braintree/transaction/disbursement_details.rb +1 -0
- data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +1 -1
- data/lib/braintree/transaction/paypal_details.rb +3 -0
- data/lib/braintree/transaction/subscription_details.rb +2 -0
- data/lib/braintree/transaction_gateway.rb +14 -21
- data/lib/braintree/transaction_search.rb +0 -1
- data/lib/braintree/util.rb +17 -2
- data/lib/braintree/version.rb +2 -2
- data/lib/braintree/webhook_notification.rb +0 -10
- data/lib/braintree/webhook_testing_gateway.rb +0 -43
- data/lib/braintree/xml/libxml.rb +1 -0
- data/lib/braintree/xml/parser.rb +11 -34
- data/spec/integration/braintree/address_spec.rb +2 -89
- data/spec/integration/braintree/client_api/spec_helper.rb +92 -66
- data/spec/integration/braintree/credit_card_spec.rb +20 -467
- data/spec/integration/braintree/credit_card_verification_spec.rb +1 -0
- data/spec/integration/braintree/customer_spec.rb +22 -362
- data/spec/integration/braintree/dispute_search_spec.rb +3 -3
- data/spec/integration/braintree/dispute_spec.rb +1 -2
- data/spec/integration/braintree/merchant_spec.rb +2 -2
- data/spec/integration/braintree/payment_method_spec.rb +77 -120
- data/spec/integration/braintree/paypal_account_spec.rb +1 -1
- data/spec/integration/braintree/subscription_spec.rb +11 -16
- data/spec/integration/braintree/transaction_search_spec.rb +3 -3
- data/spec/integration/braintree/transaction_spec.rb +274 -524
- data/spec/integration/spec_helper.rb +1 -4
- data/spec/spec_helper.rb +1 -11
- data/spec/unit/braintree/address_spec.rb +0 -8
- data/spec/unit/braintree/credit_card_spec.rb +28 -21
- data/spec/unit/braintree/credit_card_verification_spec.rb +7 -0
- data/spec/unit/braintree/customer_spec.rb +4 -12
- data/spec/unit/braintree/dispute_spec.rb +4 -12
- data/spec/unit/braintree/http_spec.rb +3 -3
- data/spec/unit/braintree/local_payment_completed_spec.rb +14 -0
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +59 -0
- data/spec/unit/braintree/transaction_spec.rb +17 -37
- data/spec/unit/braintree/util_spec.rb +37 -3
- data/spec/unit/braintree/webhook_notification_spec.rb +1 -1
- data/spec/unit/braintree/xml/parser_spec.rb +21 -16
- metadata +28 -32
- data/lib/braintree/amex_express_checkout_card.rb +0 -38
- data/lib/braintree/coinbase_account.rb +0 -34
- data/lib/braintree/europe_bank_account.rb +0 -36
- data/lib/braintree/europe_bank_account_gateway.rb +0 -17
- data/lib/braintree/ideal_payment.rb +0 -61
- data/lib/braintree/ideal_payment_gateway.rb +0 -19
- data/lib/braintree/masterpass_card.rb +0 -81
- data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
- data/lib/braintree/transaction/coinbase_details.rb +0 -16
- data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
- data/lib/braintree/transaction/masterpass_card_details.rb +0 -47
- data/lib/braintree/transparent_redirect.rb +0 -40
- data/lib/braintree/transparent_redirect_gateway.rb +0 -105
- data/lib/braintree/xml/rexml.rb +0 -71
- data/spec/hacks/tcp_socket.rb +0 -18
- data/spec/integration/braintree/coinbase_spec.rb +0 -34
- data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
- data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
- data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
- data/spec/unit/braintree/xml/rexml_spec.rb +0 -51
@@ -1,51 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
2
|
-
|
3
|
-
describe Braintree::Xml::Rexml do
|
4
|
-
describe "self.parse" do
|
5
|
-
it "typecasts integers" do
|
6
|
-
xml = "<root><foo type=\"integer\">123</foo></root>"
|
7
|
-
Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"foo"=>{"__content__"=>"123", "type"=>"integer"}}}
|
8
|
-
end
|
9
|
-
|
10
|
-
it "works with dashes or underscores" do
|
11
|
-
xml = <<-END
|
12
|
-
<root>
|
13
|
-
<dash-es />
|
14
|
-
<under_scores />
|
15
|
-
</root>
|
16
|
-
END
|
17
|
-
Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"dash-es"=>{}, "under_scores"=>{}}}
|
18
|
-
end
|
19
|
-
|
20
|
-
it "uses nil if nil=true, otherwise uses empty string" do
|
21
|
-
xml = <<-END
|
22
|
-
<root>
|
23
|
-
<a_nil_value nil="true"></a_nil_value>
|
24
|
-
<an_empty_string></an_empty_string>
|
25
|
-
</root>
|
26
|
-
END
|
27
|
-
Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"a_nil_value"=>{"nil"=>"true"}, "an_empty_string"=>{}}}
|
28
|
-
end
|
29
|
-
|
30
|
-
it "typecasts dates and times" do
|
31
|
-
xml = <<-END
|
32
|
-
<root>
|
33
|
-
<created-at type="datetime">2009-10-28T10:19:49Z</created-at>
|
34
|
-
</root>
|
35
|
-
END
|
36
|
-
Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"created-at"=>{"__content__"=>"2009-10-28T10:19:49Z", "type"=>"datetime"}}}
|
37
|
-
end
|
38
|
-
|
39
|
-
it "builds an array if type=array" do
|
40
|
-
xml = <<-END
|
41
|
-
<root>
|
42
|
-
<customers type="array">
|
43
|
-
<customer><name>Adam</name></customer>
|
44
|
-
<customer><name>Ben</name></customer>
|
45
|
-
</customers>
|
46
|
-
</root>
|
47
|
-
END
|
48
|
-
Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"customers"=>{"type"=>"array", "customer"=>[{"name"=>{"__content__"=>"Adam"}}, {"name"=>{"__content__"=>"Ben"}}]}}}
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|