braintree 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/braintree.gemspec +1 -1
  3. data/lib/braintree.rb +2 -1
  4. data/lib/braintree/account_updater_daily_report.rb +1 -1
  5. data/lib/braintree/address.rb +1 -1
  6. data/lib/braintree/apple_pay.rb +1 -1
  7. data/lib/braintree/apple_pay_card.rb +1 -1
  8. data/lib/braintree/apple_pay_options.rb +1 -1
  9. data/lib/braintree/authorization_adjustment.rb +1 -1
  10. data/lib/braintree/client_token.rb +1 -1
  11. data/lib/braintree/configuration.rb +11 -11
  12. data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
  13. data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
  14. data/lib/braintree/credit_card.rb +2 -2
  15. data/lib/braintree/credit_card_gateway.rb +3 -3
  16. data/lib/braintree/credit_card_verification.rb +5 -5
  17. data/lib/braintree/credit_card_verification_search.rb +1 -1
  18. data/lib/braintree/customer.rb +2 -2
  19. data/lib/braintree/customer_search.rb +1 -1
  20. data/lib/braintree/disbursement.rb +1 -1
  21. data/lib/braintree/dispute.rb +1 -1
  22. data/lib/braintree/dispute_gateway.rb +2 -2
  23. data/lib/braintree/dispute_search.rb +2 -2
  24. data/lib/braintree/document_upload.rb +1 -1
  25. data/lib/braintree/error_codes.rb +7 -0
  26. data/lib/braintree/google_pay_card.rb +1 -1
  27. data/lib/braintree/granted_payment_instrument_update.rb +1 -1
  28. data/lib/braintree/graphql_client.rb +7 -7
  29. data/lib/braintree/http.rb +3 -3
  30. data/lib/braintree/local_payment_completed.rb +1 -1
  31. data/lib/braintree/local_payment_reversed.rb +19 -0
  32. data/lib/braintree/merchant.rb +1 -1
  33. data/lib/braintree/merchant_account.rb +1 -1
  34. data/lib/braintree/merchant_account_gateway.rb +1 -1
  35. data/lib/braintree/merchant_gateway.rb +1 -1
  36. data/lib/braintree/modification.rb +1 -1
  37. data/lib/braintree/oauth_credentials.rb +1 -1
  38. data/lib/braintree/oauth_gateway.rb +5 -5
  39. data/lib/braintree/payment_instrument_type.rb +10 -10
  40. data/lib/braintree/payment_method_gateway.rb +3 -3
  41. data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
  42. data/lib/braintree/plan.rb +1 -1
  43. data/lib/braintree/processor_response_types.rb +3 -3
  44. data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
  45. data/lib/braintree/samsung_pay_card.rb +1 -1
  46. data/lib/braintree/settlement_batch_summary.rb +2 -2
  47. data/lib/braintree/subscription.rb +6 -6
  48. data/lib/braintree/transaction.rb +32 -24
  49. data/lib/braintree/transaction_gateway.rb +23 -4
  50. data/lib/braintree/transaction_line_item.rb +1 -1
  51. data/lib/braintree/transaction_search.rb +3 -1
  52. data/lib/braintree/unknown_payment_method.rb +1 -1
  53. data/lib/braintree/us_bank_account.rb +3 -3
  54. data/lib/braintree/us_bank_account_verification.rb +1 -1
  55. data/lib/braintree/us_bank_account_verification_gateway.rb +1 -1
  56. data/lib/braintree/util.rb +4 -4
  57. data/lib/braintree/venmo_account.rb +1 -1
  58. data/lib/braintree/version.rb +1 -1
  59. data/lib/braintree/visa_checkout_card.rb +2 -2
  60. data/lib/braintree/webhook_notification.rb +28 -19
  61. data/lib/braintree/webhook_notification_gateway.rb +5 -5
  62. data/lib/braintree/webhook_testing_gateway.rb +10 -0
  63. data/lib/braintree/xml/generator.rb +5 -4
  64. data/lib/braintree/xml/libxml.rb +1 -1
  65. data/lib/braintree/xml/parser.rb +10 -10
  66. data/spec/integration/braintree/add_on_spec.rb +1 -1
  67. data/spec/integration/braintree/address_spec.rb +24 -24
  68. data/spec/integration/braintree/advanced_search_spec.rb +45 -45
  69. data/spec/integration/braintree/apple_pay_spec.rb +3 -3
  70. data/spec/integration/braintree/braintree_gateway_spec.rb +2 -1
  71. data/spec/integration/braintree/client_api/client_token_spec.rb +14 -14
  72. data/spec/integration/braintree/client_api/spec_helper.rb +5 -5
  73. data/spec/integration/braintree/credit_card_spec.rb +119 -119
  74. data/spec/integration/braintree/credit_card_verification_search_spec.rb +2 -2
  75. data/spec/integration/braintree/credit_card_verification_spec.rb +1 -1
  76. data/spec/integration/braintree/customer_search_spec.rb +8 -8
  77. data/spec/integration/braintree/customer_spec.rb +165 -165
  78. data/spec/integration/braintree/dispute_search_spec.rb +3 -3
  79. data/spec/integration/braintree/dispute_spec.rb +6 -6
  80. data/spec/integration/braintree/error_codes_spec.rb +1 -1
  81. data/spec/integration/braintree/http_spec.rb +2 -2
  82. data/spec/integration/braintree/merchant_account_spec.rb +25 -26
  83. data/spec/integration/braintree/merchant_spec.rb +12 -12
  84. data/spec/integration/braintree/oauth_spec.rb +11 -11
  85. data/spec/integration/braintree/payment_method_nonce_spec.rb +12 -12
  86. data/spec/integration/braintree/payment_method_spec.rb +165 -165
  87. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +9 -9
  88. data/spec/integration/braintree/paypal_account_spec.rb +28 -28
  89. data/spec/integration/braintree/samsung_pay_card_spec.rb +9 -9
  90. data/spec/integration/braintree/settlement_batch_summary_spec.rb +8 -8
  91. data/spec/integration/braintree/subscription_spec.rb +133 -133
  92. data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
  93. data/spec/integration/braintree/test_transaction_spec.rb +10 -10
  94. data/spec/integration/braintree/transaction_search_spec.rb +93 -67
  95. data/spec/integration/braintree/transaction_spec.rb +498 -344
  96. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +20 -20
  97. data/spec/integration/braintree/us_bank_account_spec.rb +6 -6
  98. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +7 -7
  99. data/spec/integration/braintree/us_bank_account_verification_spec.rb +8 -8
  100. data/spec/integration/braintree/visa_checkout_card_spec.rb +5 -5
  101. data/spec/integration/spec_helper.rb +2 -2
  102. data/spec/oauth_test_helper.rb +1 -1
  103. data/spec/script/httpsd.rb +6 -6
  104. data/spec/spec_helper.rb +4 -3
  105. data/spec/unit/braintree/address_spec.rb +1 -1
  106. data/spec/unit/braintree/apple_pay_card_spec.rb +1 -1
  107. data/spec/unit/braintree/client_token_spec.rb +2 -2
  108. data/spec/unit/braintree/configuration_spec.rb +42 -42
  109. data/spec/unit/braintree/credit_card_spec.rb +7 -7
  110. data/spec/unit/braintree/credit_card_verification_search_spec.rb +1 -1
  111. data/spec/unit/braintree/credit_card_verification_spec.rb +2 -2
  112. data/spec/unit/braintree/customer_spec.rb +3 -3
  113. data/spec/unit/braintree/disbursement_spec.rb +7 -7
  114. data/spec/unit/braintree/dispute_spec.rb +8 -8
  115. data/spec/unit/braintree/error_result_spec.rb +5 -5
  116. data/spec/unit/braintree/errors_spec.rb +8 -8
  117. data/spec/unit/braintree/http_spec.rb +5 -5
  118. data/spec/unit/braintree/merchant_account_spec.rb +1 -1
  119. data/spec/unit/braintree/payment_method_spec.rb +1 -1
  120. data/spec/unit/braintree/paypal_account_spec.rb +2 -2
  121. data/spec/unit/braintree/resource_collection_spec.rb +9 -9
  122. data/spec/unit/braintree/subscription_search_spec.rb +1 -1
  123. data/spec/unit/braintree/successful_result_spec.rb +1 -1
  124. data/spec/unit/braintree/three_d_secure_info_spec.rb +1 -1
  125. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +3 -3
  126. data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
  127. data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
  128. data/spec/unit/braintree/transaction/paypal_details_spec.rb +1 -1
  129. data/spec/unit/braintree/transaction_search_spec.rb +12 -12
  130. data/spec/unit/braintree/transaction_spec.rb +25 -17
  131. data/spec/unit/braintree/util_spec.rb +18 -18
  132. data/spec/unit/braintree/validation_error_collection_spec.rb +36 -36
  133. data/spec/unit/braintree/webhook_notification_spec.rb +72 -56
  134. data/spec/unit/braintree/xml_spec.rb +31 -31
  135. metadata +3 -3
  136. data/lib/braintree/settlement_batch.rb +0 -0
@@ -99,34 +99,34 @@ describe Braintree::Xml do
99
99
  verify_to_xml_and_back hash
100
100
  end
101
101
 
102
- context "Integer" do
103
- it "works for integers" do
104
- hash = { :root => {:foo => 1 } }
105
- Braintree::Xml.hash_to_xml(hash).should include("<foo type=\"integer\">1</foo>")
106
- end
107
- end
108
-
109
- context "BigDecimal" do
110
- it "works for BigDecimals" do
111
- hash = {:root => {:foo => BigDecimal("123.45")}}
112
- Braintree::Xml.hash_to_xml(hash).should include("<foo>123.45</foo>")
113
- end
114
-
115
- it "works for BigDecimals with fewer than 2 digits" do
116
- hash = {:root => {:foo => BigDecimal("1000.0")}}
117
- Braintree::Xml.hash_to_xml(hash).should include("<foo>1000.00</foo>")
118
- end
119
-
120
- it "works for BigDecimals with more than 2 digits" do
121
- hash = {:root => {:foo => BigDecimal("12.345")}}
122
- Braintree::Xml.hash_to_xml(hash).should include("<foo>12.345</foo>")
123
- end
124
- end
125
-
126
- it "works for symbols" do
127
- hash = {:root => {:foo => :bar}}
128
- Braintree::Xml.hash_to_xml(hash).should include("<foo>bar</foo>")
129
- end
102
+ context "Integer" do
103
+ it "works for integers" do
104
+ hash = {:root => {:foo => 1}}
105
+ Braintree::Xml.hash_to_xml(hash).should include("<foo type=\"integer\">1</foo>")
106
+ end
107
+ end
108
+
109
+ context "BigDecimal" do
110
+ it "works for BigDecimals" do
111
+ hash = {:root => {:foo => BigDecimal("123.45")}}
112
+ Braintree::Xml.hash_to_xml(hash).should include("<foo>123.45</foo>")
113
+ end
114
+
115
+ it "works for BigDecimals with fewer than 2 digits" do
116
+ hash = {:root => {:foo => BigDecimal("1000.0")}}
117
+ Braintree::Xml.hash_to_xml(hash).should include("<foo>1000.00</foo>")
118
+ end
119
+
120
+ it "works for BigDecimals with more than 2 digits" do
121
+ hash = {:root => {:foo => BigDecimal("12.345")}}
122
+ Braintree::Xml.hash_to_xml(hash).should include("<foo>12.345</foo>")
123
+ end
124
+ end
125
+
126
+ it "works for symbols" do
127
+ hash = {:root => {:foo => :bar}}
128
+ Braintree::Xml.hash_to_xml(hash).should include("<foo>bar</foo>")
129
+ end
130
130
 
131
131
  it "type casts booleans" do
132
132
  hash = {:root => {:string_true => "true", :bool_true => true, :bool_false => false, :string_false => "false"}}
@@ -154,13 +154,13 @@ describe Braintree::Xml do
154
154
  end
155
155
 
156
156
  it "escapes keys and values" do
157
- hash = { "ke<y" => "val>ue" }
157
+ hash = {"ke<y" => "val>ue"}
158
158
  Braintree::Xml.hash_to_xml(hash).should include("<ke&lt;y>val&gt;ue</ke&lt;y>")
159
159
  end
160
160
 
161
161
  it "escapes nested keys and values" do
162
- hash = { "top<" => { "ke<y" => "val>ue" } }
163
- Braintree::Xml.hash_to_xml(hash).gsub(/\s/, '').should include("<top&lt;><ke&lt;y>val&gt;ue</ke&lt;y></top&lt;>")
162
+ hash = {"top<" => {"ke<y" => "val>ue"}}
163
+ Braintree::Xml.hash_to_xml(hash).gsub(/\s/, "").should include("<top&lt;><ke&lt;y>val&gt;ue</ke&lt;y></top&lt;>")
164
164
  end
165
165
  end
166
166
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Braintree
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-15 00:00:00.000000000 Z
11
+ date: 2021-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -103,6 +103,7 @@ files:
103
103
  - lib/braintree/graphql_client.rb
104
104
  - lib/braintree/http.rb
105
105
  - lib/braintree/local_payment_completed.rb
106
+ - lib/braintree/local_payment_reversed.rb
106
107
  - lib/braintree/merchant.rb
107
108
  - lib/braintree/merchant_account.rb
108
109
  - lib/braintree/merchant_account/address_details.rb
@@ -131,7 +132,6 @@ files:
131
132
  - lib/braintree/revoked_payment_method_metadata.rb
132
133
  - lib/braintree/risk_data.rb
133
134
  - lib/braintree/samsung_pay_card.rb
134
- - lib/braintree/settlement_batch.rb
135
135
  - lib/braintree/settlement_batch_summary.rb
136
136
  - lib/braintree/settlement_batch_summary_gateway.rb
137
137
  - lib/braintree/sha256_digest.rb
File without changes