braintree 2.102.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/braintree.gemspec +6 -3
  4. data/lib/braintree.rb +3 -17
  5. data/lib/braintree/address.rb +0 -22
  6. data/lib/braintree/address_gateway.rb +2 -2
  7. data/lib/braintree/base_module.rb +6 -0
  8. data/lib/braintree/bin_data.rb +9 -2
  9. data/lib/braintree/configuration.rb +1 -1
  10. data/lib/braintree/credit_card.rb +5 -76
  11. data/lib/braintree/credit_card_gateway.rb +3 -32
  12. data/lib/braintree/credit_card_verification.rb +14 -0
  13. data/lib/braintree/customer.rb +3 -72
  14. data/lib/braintree/customer_gateway.rb +0 -23
  15. data/lib/braintree/dispute.rb +1 -7
  16. data/lib/braintree/dispute/{history_event.rb → status_history.rb} +3 -1
  17. data/lib/braintree/dispute/transaction.rb +2 -0
  18. data/lib/braintree/dispute_gateway.rb +2 -7
  19. data/lib/braintree/error_codes.rb +152 -170
  20. data/lib/braintree/exceptions.rb +5 -3
  21. data/lib/braintree/gateway.rb +0 -14
  22. data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +1 -1
  23. data/lib/braintree/local_payment_completed.rb +1 -1
  24. data/lib/braintree/merchant_account_gateway.rb +2 -0
  25. data/lib/braintree/payment_instrument_type.rb +1 -4
  26. data/lib/braintree/payment_method_gateway.rb +4 -8
  27. data/lib/braintree/payment_method_parser.rb +1 -7
  28. data/lib/braintree/risk_data.rb +4 -1
  29. data/lib/braintree/subscription.rb +5 -5
  30. data/lib/braintree/successful_result.rb +0 -1
  31. data/lib/braintree/test/credit_card.rb +1 -0
  32. data/lib/braintree/test/nonce.rb +5 -20
  33. data/lib/braintree/transaction.rb +9 -73
  34. data/lib/braintree/transaction/address_details.rb +11 -0
  35. data/lib/braintree/transaction/disbursement_details.rb +1 -0
  36. data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +1 -1
  37. data/lib/braintree/transaction/paypal_details.rb +3 -0
  38. data/lib/braintree/transaction/subscription_details.rb +2 -0
  39. data/lib/braintree/transaction_gateway.rb +14 -21
  40. data/lib/braintree/transaction_search.rb +0 -1
  41. data/lib/braintree/util.rb +17 -2
  42. data/lib/braintree/version.rb +2 -2
  43. data/lib/braintree/webhook_notification.rb +0 -10
  44. data/lib/braintree/webhook_testing_gateway.rb +0 -43
  45. data/lib/braintree/xml/libxml.rb +1 -0
  46. data/lib/braintree/xml/parser.rb +11 -34
  47. data/spec/integration/braintree/address_spec.rb +2 -89
  48. data/spec/integration/braintree/client_api/spec_helper.rb +92 -66
  49. data/spec/integration/braintree/credit_card_spec.rb +20 -467
  50. data/spec/integration/braintree/credit_card_verification_spec.rb +1 -0
  51. data/spec/integration/braintree/customer_spec.rb +22 -362
  52. data/spec/integration/braintree/dispute_search_spec.rb +3 -3
  53. data/spec/integration/braintree/dispute_spec.rb +1 -2
  54. data/spec/integration/braintree/merchant_spec.rb +2 -2
  55. data/spec/integration/braintree/payment_method_spec.rb +77 -120
  56. data/spec/integration/braintree/paypal_account_spec.rb +1 -1
  57. data/spec/integration/braintree/subscription_spec.rb +11 -16
  58. data/spec/integration/braintree/transaction_search_spec.rb +3 -3
  59. data/spec/integration/braintree/transaction_spec.rb +274 -524
  60. data/spec/integration/spec_helper.rb +1 -4
  61. data/spec/spec_helper.rb +1 -11
  62. data/spec/unit/braintree/address_spec.rb +0 -8
  63. data/spec/unit/braintree/credit_card_spec.rb +28 -21
  64. data/spec/unit/braintree/credit_card_verification_spec.rb +7 -0
  65. data/spec/unit/braintree/customer_spec.rb +4 -12
  66. data/spec/unit/braintree/dispute_spec.rb +4 -12
  67. data/spec/unit/braintree/http_spec.rb +3 -3
  68. data/spec/unit/braintree/local_payment_completed_spec.rb +14 -0
  69. data/spec/unit/braintree/transaction/paypal_details_spec.rb +59 -0
  70. data/spec/unit/braintree/transaction_spec.rb +17 -37
  71. data/spec/unit/braintree/util_spec.rb +37 -3
  72. data/spec/unit/braintree/webhook_notification_spec.rb +1 -1
  73. data/spec/unit/braintree/xml/parser_spec.rb +21 -16
  74. metadata +28 -32
  75. data/lib/braintree/amex_express_checkout_card.rb +0 -38
  76. data/lib/braintree/coinbase_account.rb +0 -34
  77. data/lib/braintree/europe_bank_account.rb +0 -36
  78. data/lib/braintree/europe_bank_account_gateway.rb +0 -17
  79. data/lib/braintree/ideal_payment.rb +0 -61
  80. data/lib/braintree/ideal_payment_gateway.rb +0 -19
  81. data/lib/braintree/masterpass_card.rb +0 -81
  82. data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
  83. data/lib/braintree/transaction/coinbase_details.rb +0 -16
  84. data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
  85. data/lib/braintree/transaction/masterpass_card_details.rb +0 -47
  86. data/lib/braintree/transparent_redirect.rb +0 -40
  87. data/lib/braintree/transparent_redirect_gateway.rb +0 -105
  88. data/lib/braintree/xml/rexml.rb +0 -71
  89. data/spec/hacks/tcp_socket.rb +0 -18
  90. data/spec/integration/braintree/coinbase_spec.rb +0 -34
  91. data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
  92. data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
  93. data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
  94. 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