braintree 4.14.0 → 4.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (241) hide show
  1. checksums.yaml +4 -4
  2. data/lib/braintree/account_updater_daily_report.rb +3 -3
  3. data/lib/braintree/ach_mandate.rb +1 -1
  4. data/lib/braintree/add_on_gateway.rb +1 -1
  5. data/lib/braintree/address.rb +4 -4
  6. data/lib/braintree/address_gateway.rb +5 -5
  7. data/lib/braintree/advanced_search.rb +10 -10
  8. data/lib/braintree/apple_pay.rb +3 -3
  9. data/lib/braintree/apple_pay_card.rb +3 -3
  10. data/lib/braintree/apple_pay_options.rb +3 -3
  11. data/lib/braintree/authorization_adjustment.rb +3 -3
  12. data/lib/braintree/base_module.rb +1 -1
  13. data/lib/braintree/bin_data.rb +2 -2
  14. data/lib/braintree/client_token_gateway.rb +1 -1
  15. data/lib/braintree/configuration.rb +22 -22
  16. data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
  17. data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
  18. data/lib/braintree/credit_card.rb +22 -9
  19. data/lib/braintree/credit_card_gateway.rb +23 -11
  20. data/lib/braintree/credit_card_verification.rb +3 -3
  21. data/lib/braintree/credit_card_verification_search.rb +1 -1
  22. data/lib/braintree/customer.rb +5 -9
  23. data/lib/braintree/customer_gateway.rb +7 -7
  24. data/lib/braintree/customer_search.rb +1 -1
  25. data/lib/braintree/descriptor.rb +1 -1
  26. data/lib/braintree/digest.rb +1 -1
  27. data/lib/braintree/disbursement.rb +5 -5
  28. data/lib/braintree/discount_gateway.rb +1 -1
  29. data/lib/braintree/dispute/evidence.rb +1 -1
  30. data/lib/braintree/dispute/paypal_message.rb +1 -1
  31. data/lib/braintree/dispute/status_history.rb +1 -1
  32. data/lib/braintree/dispute/transaction.rb +1 -1
  33. data/lib/braintree/dispute/transaction_details.rb +1 -1
  34. data/lib/braintree/dispute.rb +3 -3
  35. data/lib/braintree/dispute_gateway.rb +1 -1
  36. data/lib/braintree/dispute_search.rb +1 -1
  37. data/lib/braintree/document_upload.rb +2 -2
  38. data/lib/braintree/document_upload_gateway.rb +3 -3
  39. data/lib/braintree/enriched_customer_data.rb +2 -2
  40. data/lib/braintree/error_result.rb +2 -3
  41. data/lib/braintree/errors.rb +3 -3
  42. data/lib/braintree/exceptions.rb +1 -2
  43. data/lib/braintree/exchange_rate.rb +2 -2
  44. data/lib/braintree/exchange_rate_quote.rb +3 -3
  45. data/lib/braintree/exchange_rate_quote_gateway.rb +1 -1
  46. data/lib/braintree/exchange_rate_quote_input.rb +3 -3
  47. data/lib/braintree/exchange_rate_quote_request.rb +3 -3
  48. data/lib/braintree/exchange_rate_quote_response.rb +3 -3
  49. data/lib/braintree/facilitated_details.rb +1 -1
  50. data/lib/braintree/facilitator_details.rb +1 -1
  51. data/lib/braintree/google_pay_card.rb +3 -3
  52. data/lib/braintree/granted_payment_instrument_update.rb +1 -1
  53. data/lib/braintree/graphql_client.rb +1 -1
  54. data/lib/braintree/http.rb +1 -1
  55. data/lib/braintree/local_payment_completed.rb +2 -2
  56. data/lib/braintree/local_payment_expired.rb +2 -2
  57. data/lib/braintree/local_payment_funded.rb +2 -2
  58. data/lib/braintree/local_payment_reversed.rb +2 -2
  59. data/lib/braintree/merchant.rb +3 -3
  60. data/lib/braintree/merchant_account.rb +2 -2
  61. data/lib/braintree/merchant_account_gateway.rb +9 -9
  62. data/lib/braintree/meta_checkout_card.rb +89 -0
  63. data/lib/braintree/meta_checkout_token.rb +88 -0
  64. data/lib/braintree/modification.rb +3 -3
  65. data/lib/braintree/oauth_credentials.rb +3 -3
  66. data/lib/braintree/paginated_collection.rb +2 -2
  67. data/lib/braintree/paginated_result.rb +1 -1
  68. data/lib/braintree/payment_instrument_type.rb +2 -0
  69. data/lib/braintree/payment_method_customer_data_updated_metadata.rb +2 -2
  70. data/lib/braintree/payment_method_gateway.rb +23 -10
  71. data/lib/braintree/payment_method_nonce.rb +4 -4
  72. data/lib/braintree/payment_method_nonce_details.rb +1 -1
  73. data/lib/braintree/payment_method_nonce_details_payer_info.rb +1 -1
  74. data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
  75. data/lib/braintree/paypal_account.rb +1 -2
  76. data/lib/braintree/paypal_account_gateway.rb +5 -5
  77. data/lib/braintree/plan.rb +1 -1
  78. data/lib/braintree/plan_gateway.rb +2 -2
  79. data/lib/braintree/resource_collection.rb +2 -2
  80. data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
  81. data/lib/braintree/risk_data.rb +1 -1
  82. data/lib/braintree/samsung_pay_card.rb +5 -5
  83. data/lib/braintree/sepa_direct_debit_account.rb +2 -2
  84. data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +1 -1
  85. data/lib/braintree/settlement_batch_summary_gateway.rb +1 -1
  86. data/lib/braintree/sha256_digest.rb +1 -1
  87. data/lib/braintree/subscription/status_details.rb +1 -1
  88. data/lib/braintree/subscription.rb +2 -2
  89. data/lib/braintree/subscription_gateway.rb +6 -6
  90. data/lib/braintree/subscription_search.rb +1 -1
  91. data/lib/braintree/successful_result.rb +2 -2
  92. data/lib/braintree/test/credit_card.rb +7 -10
  93. data/lib/braintree/test/merchant_account.rb +1 -1
  94. data/lib/braintree/test/nonce.rb +4 -0
  95. data/lib/braintree/test/transaction_amounts.rb +2 -3
  96. data/lib/braintree/test/venmo_sdk.rb +2 -0
  97. data/lib/braintree/testing_gateway.rb +1 -1
  98. data/lib/braintree/three_d_secure_info.rb +1 -1
  99. data/lib/braintree/transaction/address_details.rb +1 -1
  100. data/lib/braintree/transaction/credit_card_details.rb +4 -1
  101. data/lib/braintree/transaction/customer_details.rb +1 -1
  102. data/lib/braintree/transaction/disbursement_details.rb +1 -1
  103. data/lib/braintree/transaction/local_payment_details.rb +2 -0
  104. data/lib/braintree/transaction/meta_checkout_card_details.rb +52 -0
  105. data/lib/braintree/transaction/meta_checkout_token_details.rb +54 -0
  106. data/lib/braintree/transaction/samsung_pay_card_details.rb +1 -1
  107. data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +1 -1
  108. data/lib/braintree/transaction/status_details.rb +1 -1
  109. data/lib/braintree/transaction/subscription_details.rb +1 -1
  110. data/lib/braintree/transaction/us_bank_account_details.rb +1 -1
  111. data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
  112. data/lib/braintree/transaction.rb +27 -20
  113. data/lib/braintree/transaction_gateway.rb +23 -12
  114. data/lib/braintree/transaction_line_item.rb +2 -2
  115. data/lib/braintree/transaction_line_item_gateway.rb +1 -1
  116. data/lib/braintree/transaction_review.rb +1 -1
  117. data/lib/braintree/transaction_search.rb +7 -6
  118. data/lib/braintree/unknown_payment_method.rb +1 -1
  119. data/lib/braintree/us_bank_account.rb +2 -2
  120. data/lib/braintree/us_bank_account_verification.rb +23 -15
  121. data/lib/braintree/us_bank_account_verification_search.rb +1 -1
  122. data/lib/braintree/util.rb +3 -3
  123. data/lib/braintree/validation_error.rb +1 -1
  124. data/lib/braintree/validation_error_collection.rb +3 -3
  125. data/lib/braintree/venmo_account.rb +3 -3
  126. data/lib/braintree/venmo_profile_data.rb +6 -4
  127. data/lib/braintree/version.rb +1 -1
  128. data/lib/braintree/visa_checkout_card.rb +7 -7
  129. data/lib/braintree/webhook_notification.rb +3 -2
  130. data/lib/braintree/webhook_notification_gateway.rb +3 -3
  131. data/lib/braintree/webhook_testing.rb +1 -1
  132. data/lib/braintree/webhook_testing_gateway.rb +18 -1
  133. data/lib/braintree/xml/generator.rb +1 -1
  134. data/lib/braintree/xml/libxml.rb +1 -1
  135. data/lib/braintree/xml/parser.rb +2 -2
  136. data/lib/braintree/xml/rexml.rb +2 -2
  137. data/lib/braintree/xml.rb +1 -1
  138. data/lib/braintree.rb +4 -1
  139. data/spec/integration/braintree/add_on_spec.rb +9 -9
  140. data/spec/integration/braintree/address_spec.rb +69 -69
  141. data/spec/integration/braintree/advanced_search_spec.rb +45 -45
  142. data/spec/integration/braintree/apple_pay_spec.rb +8 -8
  143. data/spec/integration/braintree/client_api/client_token_spec.rb +15 -15
  144. data/spec/integration/braintree/credit_card_spec.rb +223 -223
  145. data/spec/integration/braintree/credit_card_verification_search_spec.rb +16 -16
  146. data/spec/integration/braintree/credit_card_verification_spec.rb +52 -52
  147. data/spec/integration/braintree/customer_search_spec.rb +20 -20
  148. data/spec/integration/braintree/customer_spec.rb +313 -313
  149. data/spec/integration/braintree/disbursement_spec.rb +2 -2
  150. data/spec/integration/braintree/discount_spec.rb +9 -9
  151. data/spec/integration/braintree/dispute_search_spec.rb +0 -1
  152. data/spec/integration/braintree/dispute_spec.rb +87 -87
  153. data/spec/integration/braintree/document_upload_spec.rb +17 -17
  154. data/spec/integration/braintree/error_codes_spec.rb +2 -2
  155. data/spec/integration/braintree/http_spec.rb +28 -28
  156. data/spec/integration/braintree/merchant_account_spec.rb +127 -127
  157. data/spec/integration/braintree/merchant_spec.rb +103 -103
  158. data/spec/integration/braintree/oauth_spec.rb +61 -61
  159. data/spec/integration/braintree/payment_method_nonce_spec.rb +89 -69
  160. data/spec/integration/braintree/payment_method_spec.rb +389 -389
  161. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +150 -78
  162. data/spec/integration/braintree/paypal_account_spec.rb +38 -38
  163. data/spec/integration/braintree/plan_spec.rb +15 -15
  164. data/spec/integration/braintree/samsung_pay_card_spec.rb +65 -65
  165. data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +51 -51
  166. data/spec/integration/braintree/settlement_batch_summary_spec.rb +11 -11
  167. data/spec/integration/braintree/subscription_spec.rb +364 -364
  168. data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
  169. data/spec/integration/braintree/test_transaction_spec.rb +19 -19
  170. data/spec/integration/braintree/transaction_line_item_spec.rb +6 -6
  171. data/spec/integration/braintree/transaction_search_spec.rb +225 -165
  172. data/spec/integration/braintree/transaction_spec.rb +1502 -1210
  173. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -32
  174. data/spec/integration/braintree/us_bank_account_spec.rb +30 -30
  175. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +18 -18
  176. data/spec/integration/braintree/us_bank_account_verification_spec.rb +33 -33
  177. data/spec/integration/braintree/visa_checkout_card_spec.rb +57 -57
  178. data/spec/spec_helper.rb +9 -8
  179. data/spec/unit/braintree/address_spec.rb +8 -8
  180. data/spec/unit/braintree/base_module_spec.rb +4 -4
  181. data/spec/unit/braintree/client_token_spec.rb +2 -2
  182. data/spec/unit/braintree/configuration_spec.rb +57 -57
  183. data/spec/unit/braintree/credentials_parser_spec.rb +6 -6
  184. data/spec/unit/braintree/credit_card_spec.rb +31 -29
  185. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +28 -28
  186. data/spec/unit/braintree/credit_card_verification_search_spec.rb +9 -9
  187. data/spec/unit/braintree/credit_card_verification_spec.rb +17 -17
  188. data/spec/unit/braintree/customer_spec.rb +41 -40
  189. data/spec/unit/braintree/digest_spec.rb +5 -5
  190. data/spec/unit/braintree/disbursement_spec.rb +11 -11
  191. data/spec/unit/braintree/dispute_search_spec.rb +2 -2
  192. data/spec/unit/braintree/dispute_spec.rb +56 -56
  193. data/spec/unit/braintree/document_upload_spec.rb +8 -8
  194. data/spec/unit/braintree/enriched_customer_data_spec.rb +11 -2
  195. data/spec/unit/braintree/error_result_spec.rb +5 -5
  196. data/spec/unit/braintree/errors_spec.rb +9 -9
  197. data/spec/unit/braintree/http_spec.rb +9 -9
  198. data/spec/unit/braintree/local_payment_completed_spec.rb +11 -11
  199. data/spec/unit/braintree/local_payment_expired_spec.rb +2 -2
  200. data/spec/unit/braintree/local_payment_funded_spec.rb +6 -6
  201. data/spec/unit/braintree/merchant_account_spec.rb +4 -4
  202. data/spec/unit/braintree/meta_checkout_card_details_spec.rb +60 -0
  203. data/spec/unit/braintree/meta_checkout_card_spec.rb +60 -0
  204. data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
  205. data/spec/unit/braintree/meta_checkout_token_spec.rb +63 -0
  206. data/spec/unit/braintree/modification_spec.rb +1 -1
  207. data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +6 -6
  208. data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +7 -7
  209. data/spec/unit/braintree/payment_method_nonce_details_spec.rb +14 -14
  210. data/spec/unit/braintree/payment_method_spec.rb +19 -19
  211. data/spec/unit/braintree/paypal_account_spec.rb +4 -4
  212. data/spec/unit/braintree/resource_collection_spec.rb +7 -7
  213. data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +1 -1
  214. data/spec/unit/braintree/sha256_digest_spec.rb +1 -1
  215. data/spec/unit/braintree/signature_service_spec.rb +2 -2
  216. data/spec/unit/braintree/subscription_search_spec.rb +17 -17
  217. data/spec/unit/braintree/subscription_spec.rb +8 -8
  218. data/spec/unit/braintree/successful_result_spec.rb +5 -5
  219. data/spec/unit/braintree/three_d_secure_info_spec.rb +20 -20
  220. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +5 -5
  221. data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
  222. data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
  223. data/spec/unit/braintree/transaction/local_payment_details_spec.rb +30 -0
  224. data/spec/unit/braintree/transaction_gateway_spec.rb +39 -7
  225. data/spec/unit/braintree/transaction_search_spec.rb +2 -2
  226. data/spec/unit/braintree/transaction_spec.rb +101 -93
  227. data/spec/unit/braintree/unknown_payment_method_spec.rb +4 -4
  228. data/spec/unit/braintree/us_bank_account_spec.rb +2 -2
  229. data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +7 -7
  230. data/spec/unit/braintree/us_bank_account_verification_spec.rb +12 -7
  231. data/spec/unit/braintree/util_spec.rb +27 -27
  232. data/spec/unit/braintree/validation_error_collection_spec.rb +34 -34
  233. data/spec/unit/braintree/validation_error_spec.rb +4 -4
  234. data/spec/unit/braintree/venmo_profile_data_spec.rb +16 -5
  235. data/spec/unit/braintree/webhook_notification_spec.rb +206 -191
  236. data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
  237. data/spec/unit/braintree/xml/parser_spec.rb +8 -8
  238. data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
  239. data/spec/unit/braintree/xml_spec.rb +17 -17
  240. data/spec/unit/braintree_spec.rb +2 -2
  241. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b00fbf3fe7587ce0788471b730caa3db11f9b574a0077d83e03a9c0aef54e01
4
- data.tar.gz: 3dd4395b7ca564f1ac454a290451c9716953b9297ad3b9101d7d6e07f3cc1972
3
+ metadata.gz: fbacdc492fa27aed57086131c1feab00ed435923034cae5dd7b5c6d4c3184a1a
4
+ data.tar.gz: a3c9be778fb88ef5a0ea6c23182f74654b511dca659e34529fade077712418ef
5
5
  SHA512:
6
- metadata.gz: 665d8cef94dfe888f82c1b50c65bad773f5c6b4600937118b37cdc68f92b47150c148d6c0c45130e8e867f7507f13929975f3357ac769c8b9e982f1d7988cab6
7
- data.tar.gz: 3555eb3944bf02f23912d17c323250d7112722f09bd825b7e6a5571fa44470d52800a7e92d4d738e6ab8f69c6a2fb98adddf626139b4ec78d39679beea0fee86
6
+ metadata.gz: 3b6e24f668d3bd022069f5e85ed55afe9fbdce43205af6dd44a101f6aef3f78d2b2099d5b8d5c8297cbf3076dee72da16e61d7b758cb162278190e99d9f95d91
7
+ data.tar.gz: 3ee3af6a1854de4b02db4670b3d32232b2ce7d26ae478bfa792dcc4ccfe638f52259e80e818704d630c8a0b453a1f566062865045f370f5f83a377e0c7083d16
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class AccountUpdaterDailyReport # :nodoc:
2
+ class AccountUpdaterDailyReport
3
3
  include BaseModule
4
4
 
5
5
  attr_reader :report_date
@@ -7,12 +7,12 @@ module Braintree
7
7
 
8
8
  class << self
9
9
  protected :new
10
- def _new(*args) # :nodoc:
10
+ def _new(*args)
11
11
  self.new(*args)
12
12
  end
13
13
  end
14
14
 
15
- def initialize(attributes) # :nodoc:
15
+ def initialize(attributes)
16
16
  set_instance_variables_from_hash(attributes)
17
17
  @report_date = Date.parse(report_date)
18
18
  end
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class AchMandate
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
5
  attr_reader :accepted_at
6
6
  attr_reader :text
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class AddOnGateway # :nodoc
2
+ class AddOnGateway
3
3
  def initialize(gateway)
4
4
  @gateway = gateway
5
5
  @config = gateway.config
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Address
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
5
  attr_reader :company
6
6
  attr_reader :country_code_alpha2
@@ -44,12 +44,12 @@ module Braintree
44
44
  Configuration.gateway.address.update!(*args)
45
45
  end
46
46
 
47
- def initialize(gateway, attributes) # :nodoc:
47
+ def initialize(gateway, attributes)
48
48
  @gateway = gateway
49
49
  set_instance_variables_from_hash(attributes)
50
50
  end
51
51
 
52
- def ==(other) # :nodoc:
52
+ def ==(other)
53
53
  return false unless other.is_a?(Address)
54
54
  id == other.id && customer_id == other.customer_id
55
55
  end
@@ -58,7 +58,7 @@ module Braintree
58
58
  protected :new
59
59
  end
60
60
 
61
- def self._new(*args) # :nodoc:
61
+ def self._new(*args)
62
62
  self.new(*args)
63
63
  end
64
64
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class AddressGateway # :nodoc
2
+ class AddressGateway
3
3
  include BaseModule
4
4
 
5
5
  def initialize(gateway)
@@ -62,7 +62,7 @@ module Braintree
62
62
  return_object_or_raise(:address) { update(*args) }
63
63
  end
64
64
 
65
- def _determine_customer_id(customer_or_customer_id) # :nodoc:
65
+ def _determine_customer_id(customer_or_customer_id)
66
66
  customer_id = customer_or_customer_id.is_a?(Customer) ? customer_or_customer_id.id : customer_or_customer_id
67
67
  unless customer_id =~ /\A[\w_-]+\z/
68
68
  raise ArgumentError, "customer_id contains invalid characters"
@@ -70,17 +70,17 @@ module Braintree
70
70
  customer_id
71
71
  end
72
72
 
73
- def self._create_signature # :nodoc:
73
+ def self._create_signature
74
74
  _shared_signature + [:customer_id]
75
75
  end
76
76
 
77
- def self._shared_signature # :nodoc:
77
+ def self._shared_signature
78
78
  [:company, :country_code_alpha2, :country_code_alpha3, :country_code_numeric,
79
79
  :country_name, :extended_address, :first_name, :last_name, :locality, :phone_number,
80
80
  :postal_code, :region, :street_address]
81
81
  end
82
82
 
83
- def self._update_signature # :nodoc:
83
+ def self._update_signature
84
84
  _create_signature
85
85
  end
86
86
  end
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
- class AdvancedSearch # :nodoc:
3
- class SearchNode # :nodoc:
2
+ class AdvancedSearch
3
+ class SearchNode
4
4
  def self.operators(*operator_names)
5
5
  operator_names.each do |operator|
6
6
  define_method(operator) do |value|
@@ -14,29 +14,29 @@ module Braintree
14
14
  end
15
15
  end
16
16
 
17
- class IsNode < SearchNode # :nodoc:
17
+ class IsNode < SearchNode
18
18
  operators :is
19
19
  end
20
20
 
21
- class EqualityNode < IsNode # :nodoc:
21
+ class EqualityNode < IsNode
22
22
  operators :is_not
23
23
  end
24
24
 
25
- class PartialMatchNode < EqualityNode # :nodoc:
25
+ class PartialMatchNode < EqualityNode
26
26
  operators :ends_with, :starts_with
27
27
  end
28
28
 
29
- class TextNode < PartialMatchNode # :nodoc:
29
+ class TextNode < PartialMatchNode
30
30
  operators :contains
31
31
  end
32
32
 
33
- class KeyValueNode < SearchNode # :nodoc:
33
+ class KeyValueNode < SearchNode
34
34
  def is(value)
35
35
  @parent.add_criteria(@node_name, value)
36
36
  end
37
37
  end
38
38
 
39
- class MultipleValueNode < SearchNode # :nodoc:
39
+ class MultipleValueNode < SearchNode
40
40
  def in(*values)
41
41
  values.flatten!
42
42
 
@@ -62,7 +62,7 @@ module Braintree
62
62
  end
63
63
  end
64
64
 
65
- class EndsWithNode < SearchNode # :nodoc:
65
+ class EndsWithNode < SearchNode
66
66
  operators :ends_with
67
67
  end
68
68
 
@@ -76,7 +76,7 @@ module Braintree
76
76
  end
77
77
  end
78
78
 
79
- class RangeNode < SearchNode # :nodoc:
79
+ class RangeNode < SearchNode
80
80
  operators :is
81
81
 
82
82
  def between(min, max)
@@ -1,8 +1,8 @@
1
1
  module Braintree
2
2
  class ApplePay
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
- def initialize(gateway, attributes) # :nodoc:
5
+ def initialize(gateway, attributes)
6
6
  set_instance_variables_from_hash(attributes)
7
7
  end
8
8
 
@@ -10,7 +10,7 @@ module Braintree
10
10
  protected :new
11
11
  end
12
12
 
13
- def self._new(*args) # :nodoc:
13
+ def self._new(*args)
14
14
  self.new(*args)
15
15
  end
16
16
 
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class ApplePayCard
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
5
  module CardType
6
6
  AmEx = "Apple Pay - American Express"
@@ -39,7 +39,7 @@ module Braintree
39
39
  attr_reader :token
40
40
  attr_reader :updated_at
41
41
 
42
- def initialize(gateway, attributes) # :nodoc:
42
+ def initialize(gateway, attributes)
43
43
  @gateway = gateway
44
44
  set_instance_variables_from_hash(attributes)
45
45
  @billing_address = attributes[:billing_address] ? Address._new(@gateway, attributes[:billing_address]) : nil
@@ -58,7 +58,7 @@ module Braintree
58
58
  protected :new
59
59
  end
60
60
 
61
- def self._new(*args) # :nodoc:
61
+ def self._new(*args)
62
62
  self.new(*args)
63
63
  end
64
64
  end
@@ -1,10 +1,10 @@
1
1
  module Braintree
2
2
  class ApplePayOptions
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
5
  attr_reader :domains
6
6
 
7
- def initialize(attributes) # :nodoc:
7
+ def initialize(attributes)
8
8
  set_instance_variables_from_hash(attributes)
9
9
  end
10
10
 
@@ -12,7 +12,7 @@ module Braintree
12
12
  protected :new
13
13
  end
14
14
 
15
- def self._new(*args) # :nodoc:
15
+ def self._new(*args)
16
16
  self.new(*args)
17
17
  end
18
18
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class AuthorizationAdjustment # :nodoc:
2
+ class AuthorizationAdjustment
3
3
  include BaseModule
4
4
 
5
5
  attr_reader :amount
@@ -11,12 +11,12 @@ module Braintree
11
11
 
12
12
  class << self
13
13
  protected :new
14
- def _new(*args) # :nodoc:
14
+ def _new(*args)
15
15
  self.new(*args)
16
16
  end
17
17
  end
18
18
 
19
- def initialize(attributes) # :nodoc:
19
+ def initialize(attributes)
20
20
  set_instance_variables_from_hash(attributes)
21
21
  end
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- module BaseModule # :nodoc: all
2
+ module BaseModule
3
3
  module Methods
4
4
  def return_object_or_raise(object_to_return)
5
5
  result = yield
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class BinData # :nodoc:
2
+ class BinData
3
3
  include BaseModule
4
4
 
5
5
  attr_reader :commercial
@@ -23,7 +23,7 @@ module Braintree
23
23
  "#<#{self.class} #{formatted_attributes.join(", ")}>"
24
24
  end
25
25
 
26
- def self._attributes # :nodoc:
26
+ def self._attributes
27
27
  [
28
28
  :commercial, :country_of_issuance, :debit, :durbin_regulated, :healthcare,
29
29
  :issuing_bank, :payroll, :prepaid, :product_id
@@ -25,7 +25,7 @@ module Braintree
25
25
  end
26
26
  end
27
27
 
28
- def self._generate_signature # :nodoc:
28
+ def self._generate_signature
29
29
  [
30
30
  :address_id, :customer_id, :proxy_merchant_id, :merchant_account_id,
31
31
  :version,
@@ -1,8 +1,9 @@
1
1
  module Braintree
2
2
  class Configuration
3
- API_VERSION = "6" # :nodoc:
4
- DEFAULT_ENDPOINT = "api" # :nodoc:
5
- GRAPHQL_API_VERSION = "2018-09-10" # :nodoc:
3
+ API_VERSION = "6"
4
+ DEFAULT_ENDPOINT = "api"
5
+ # NEXT_MAJOR_VERSION update to the latest version of GraphQL API
6
+ GRAPHQL_API_VERSION = "2018-09-10"
6
7
 
7
8
  READABLE_ATTRIBUTES = [
8
9
  :merchant_id,
@@ -47,18 +48,17 @@ module Braintree
47
48
  attr_reader(*NON_REQUIRED_READABLE_ATTRIBUTES)
48
49
  attr_writer(*WRITABLE_ATTRIBUTES)
49
50
 
50
- def self.expectant_reader(*attributes) # :nodoc:
51
+ def self.expectant_reader(*attributes)
51
52
  attributes.each do |attribute|
52
53
  (class << self; self; end).send(:define_method, attribute) do
53
54
  attribute_value = instance_variable_get("@#{attribute}")
54
- raise ConfigurationError.new("Braintree::Configuration.#{attribute.to_s} needs to be set") if attribute_value.nil? || attribute_value.to_s.empty?
55
+ raise ConfigurationError.new("Braintree::Configuration.#{attribute} needs to be set") if attribute_value.nil? || attribute_value.to_s.empty?
55
56
  attribute_value
56
57
  end
57
58
  end
58
59
  end
59
60
  expectant_reader(*READABLE_ATTRIBUTES)
60
61
 
61
- # Sets the Braintree environment to use. Valid values are <tt>:sandbox</tt> and <tt>:production</tt>
62
62
  def self.environment=(env)
63
63
  env = env.to_sym
64
64
  unless [:development, :qa, :sandbox, :production].include?(env)
@@ -67,11 +67,11 @@ module Braintree
67
67
  @environment = env
68
68
  end
69
69
 
70
- def self.gateway # :nodoc:
70
+ def self.gateway
71
71
  Braintree::Gateway.new(instantiate)
72
72
  end
73
73
 
74
- def self.instantiate # :nodoc:
74
+ def self.instantiate
75
75
  config = new(
76
76
  :custom_user_agent => @custom_user_agent,
77
77
  :endpoint => @endpoint,
@@ -158,15 +158,15 @@ module Braintree
158
158
  end
159
159
  end
160
160
 
161
- def api_version # :nodoc:
161
+ def api_version
162
162
  API_VERSION
163
163
  end
164
164
 
165
- def graphql_api_version # :nodoc:
165
+ def graphql_api_version
166
166
  GRAPHQL_API_VERSION
167
167
  end
168
168
 
169
- def base_merchant_path # :nodoc:
169
+ def base_merchant_path
170
170
  "/merchants/#{merchant_id}"
171
171
  end
172
172
 
@@ -178,11 +178,11 @@ module Braintree
178
178
  "#{protocol}://#{graphql_server}:#{graphql_port}/graphql"
179
179
  end
180
180
 
181
- def base_merchant_url # :nodoc:
181
+ def base_merchant_url
182
182
  "#{base_url}#{base_merchant_path}"
183
183
  end
184
184
 
185
- def ca_file # :nodoc:
185
+ def ca_file
186
186
  File.expand_path(File.join(File.dirname(__FILE__), "..", "ssl", "api_braintreegateway_com.ca.crt"))
187
187
  end
188
188
 
@@ -190,7 +190,7 @@ module Braintree
190
190
  @endpoint || DEFAULT_ENDPOINT
191
191
  end
192
192
 
193
- def http # :nodoc:
193
+ def http
194
194
  Http.new(self)
195
195
  end
196
196
 
@@ -202,7 +202,7 @@ module Braintree
202
202
  @logger ||= self.class._default_logger
203
203
  end
204
204
 
205
- def port # :nodoc:
205
+ def port
206
206
  case @environment
207
207
  when :development, :integration
208
208
  ENV["GATEWAY_PORT"] || 3000
@@ -211,7 +211,7 @@ module Braintree
211
211
  end
212
212
  end
213
213
 
214
- def graphql_port # :nodoc:
214
+ def graphql_port
215
215
  case @environment
216
216
  when :development, :integration
217
217
  ENV["GRAPHQL_PORT"] || 8080
@@ -220,7 +220,7 @@ module Braintree
220
220
  end
221
221
  end
222
222
 
223
- def protocol # :nodoc:
223
+ def protocol
224
224
  ssl? ? "https" : "http"
225
225
  end
226
226
 
@@ -232,7 +232,7 @@ module Braintree
232
232
  @http_read_timeout
233
233
  end
234
234
 
235
- def server # :nodoc:
235
+ def server
236
236
  case @environment
237
237
  when :development, :integration
238
238
  ENV["GATEWAY_HOST"] || "localhost"
@@ -245,7 +245,7 @@ module Braintree
245
245
  end
246
246
  end
247
247
 
248
- def graphql_server # :nodoc:
248
+ def graphql_server
249
249
  case @environment
250
250
  when :development, :integration
251
251
  ENV["GRAPHQL_HOST"] || "graphql.bt.local"
@@ -271,7 +271,7 @@ module Braintree
271
271
  end
272
272
  end
273
273
 
274
- def ssl? # :nodoc:
274
+ def ssl?
275
275
  case @environment
276
276
  when :development, :integration
277
277
  false
@@ -280,12 +280,12 @@ module Braintree
280
280
  end
281
281
  end
282
282
 
283
- def user_agent # :nodoc:
283
+ def user_agent
284
284
  base_user_agent = "Braintree Ruby Gem #{Braintree::Version::String}"
285
285
  @custom_user_agent ? "#{base_user_agent} (#{@custom_user_agent})" : base_user_agent
286
286
  end
287
287
 
288
- def self._default_logger # :nodoc:
288
+ def self._default_logger
289
289
  logger = Logger.new(STDOUT)
290
290
  logger.level = Logger::INFO
291
291
  logger
@@ -14,7 +14,7 @@ module Braintree
14
14
 
15
15
  class << self
16
16
  protected :new
17
- def _new(*args) # :nodoc:
17
+ def _new(*args)
18
18
  self.new(*args)
19
19
  end
20
20
  end
@@ -14,7 +14,7 @@ module Braintree
14
14
 
15
15
  class << self
16
16
  protected :new
17
- def _new(*args) # :nodoc:
17
+ def _new(*args)
18
18
  self.new(*args)
19
19
  end
20
20
  end
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class CreditCard
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
  include Braintree::Util::TokenEquality
5
5
 
6
6
  module CardType
@@ -23,6 +23,17 @@ module Braintree
23
23
  All = constants.map { |c| const_get(c) }
24
24
  end
25
25
 
26
+ module DebitNetwork
27
+ Accel = "ACCEL"
28
+ Maestro = "MAESTRO"
29
+ Nyce = "NYCE"
30
+ Pulse = "PULSE"
31
+ Star = "STAR"
32
+ Star_Access = "STAR_ACCESS"
33
+
34
+ All = constants.map { |c| const_get(c) }
35
+ end
36
+
26
37
  module CustomerLocation
27
38
  International = "international"
28
39
  US = "us"
@@ -114,7 +125,7 @@ module Braintree
114
125
  Configuration.gateway.credit_card.update!(*args)
115
126
  end
116
127
 
117
- def initialize(gateway, attributes) # :nodoc:
128
+ def initialize(gateway, attributes)
118
129
  @gateway = gateway
119
130
  set_instance_variables_from_hash(attributes)
120
131
  @billing_address = attributes[:billing_address] ? Address._new(@gateway, attributes[:billing_address]) : nil
@@ -123,11 +134,10 @@ module Braintree
123
134
  end
124
135
 
125
136
  def _most_recent_verification(attributes)
126
- verification = (attributes[:verifications] || []).sort_by { |verification| verification[:created_at] }.reverse.first
127
- CreditCardVerification._new(verification) if verification
137
+ sorted_verifications = (attributes[:verifications] || []).sort_by { |verification| verification[:created_at] }.reverse.first
138
+ CreditCardVerification._new(sorted_verifications) if sorted_verifications
128
139
  end
129
140
 
130
- # Returns true if this credit card is the customer's default payment method.
131
141
  def default?
132
142
  @default
133
143
  end
@@ -137,12 +147,11 @@ module Braintree
137
147
  "#{expiration_month}/#{expiration_year}"
138
148
  end
139
149
 
140
- # Returns true if the credit card is expired.
141
150
  def expired?
142
151
  @expired
143
152
  end
144
153
 
145
- def inspect # :nodoc:
154
+ def inspect
146
155
  first = [:token]
147
156
  order = first + (self.class._attributes - first)
148
157
  nice_attributes = order.map do |attr|
@@ -159,8 +168,12 @@ module Braintree
159
168
  @nonce ||= PaymentMethodNonce.create(token)
160
169
  end
161
170
 
171
+ # NEXT_MAJOR_VERSION can this be removed? Venmo SDK integration is no more
162
172
  # Returns true if the card is associated with Venmo SDK
173
+ # NEXT_MAJOR_VERSION Remove this method
174
+ # The old venmo SDK class has been deprecated
163
175
  def venmo_sdk?
176
+ warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
164
177
  @venmo_sdk
165
178
  end
166
179
 
@@ -172,7 +185,7 @@ module Braintree
172
185
  protected :new
173
186
  end
174
187
 
175
- def self._attributes # :nodoc:
188
+ def self._attributes
176
189
  [
177
190
  :billing_address, :bin, :card_type, :cardholder_name, :created_at, :customer_id, :expiration_month,
178
191
  :expiration_year, :last_4, :token, :updated_at, :prepaid, :payroll, :product_id, :commercial, :debit, :durbin_regulated,
@@ -180,7 +193,7 @@ module Braintree
180
193
  ]
181
194
  end
182
195
 
183
- def self._new(*args) # :nodoc:
196
+ def self._new(*args)
184
197
  self.new(*args)
185
198
  end
186
199
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class CreditCardGateway # :nodoc:
2
+ class CreditCardGateway
3
3
  include BaseModule
4
4
 
5
5
  def initialize(gateway)
@@ -12,6 +12,10 @@ module Braintree
12
12
  if attributes.has_key?(:expiration_date) && (attributes.has_key?(:expiration_month) || attributes.has_key?(:expiration_year))
13
13
  raise ArgumentError.new("create with both expiration_month and expiration_year or only expiration_date")
14
14
  end
15
+ # NEXT_MAJOR_VERSION remove this check
16
+ if attributes.has_key?(:venmo_sdk_payment_method_code) || attributes.has_key?(:venmo_sdk_session)
17
+ warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
18
+ end
15
19
  Util.verify_keys(CreditCardGateway._create_signature, attributes)
16
20
  _do_create("/payment_methods", :credit_card => attributes)
17
21
  end
@@ -61,6 +65,10 @@ module Braintree
61
65
  end
62
66
 
63
67
  def update(token, attributes)
68
+ # NEXT_MAJOR_VERSION remove this check
69
+ if attributes.has_key?(:venmo_sdk_payment_method_code) || attributes.has_key?(:venmo_sdk_session)
70
+ warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
71
+ end
64
72
  Util.verify_keys(CreditCardGateway._update_signature, attributes)
65
73
  _do_update(:put, "/payment_methods/credit_card/#{token}", :credit_card => attributes)
66
74
  end
@@ -69,31 +77,35 @@ module Braintree
69
77
  return_object_or_raise(:credit_card) { update(*args) }
70
78
  end
71
79
 
72
- def self._create_signature # :nodoc:
80
+ def self._create_signature
73
81
  _signature(:create)
74
82
  end
75
83
 
76
- def self._update_signature # :nodoc:
84
+ def self._update_signature
77
85
  _signature(:update)
78
86
  end
79
87
 
80
- def self._signature(type) # :nodoc:
88
+ def self._signature(type)
81
89
  billing_address_params = AddressGateway._shared_signature
90
+ # NEXT_MAJOR_VERSION Remove venmo_sdk_session
91
+ # The old venmo SDK class has been deprecated
82
92
  options = [
83
93
  :fail_on_duplicate_payment_method,
84
94
  :make_default,
85
95
  :skip_advanced_fraud_checking,
86
- :venmo_sdk_session,
96
+ :venmo_sdk_session, # Deprecated
87
97
  :verification_account_type,
88
98
  :verification_amount,
89
99
  :verification_currency_iso_code,
90
100
  :verification_merchant_account_id,
91
101
  :verify_card
92
102
  ]
103
+ # NEXT_MAJOR_VERSION Remove venmo_sdk_payment_method_code
104
+ # The old venmo SDK class has been deprecated
93
105
  signature = [
94
106
  :billing_address_id, :cardholder_name, :cvv, :expiration_date, :expiration_month,
95
- :expiration_year, :number, :token, :venmo_sdk_payment_method_code, :device_data,
96
- :payment_method_nonce,
107
+ :expiration_year, :number, :token, :venmo_sdk_payment_method_code, # Deprecated
108
+ :device_data, :payment_method_nonce,
97
109
  {:external_vault => [:network_transaction_id]},
98
110
  {:options => options},
99
111
  {:billing_address => billing_address_params}
@@ -124,7 +136,7 @@ module Braintree
124
136
  return signature
125
137
  end
126
138
 
127
- def _do_create(path, params=nil) # :nodoc:
139
+ def _do_create(path, params=nil)
128
140
  response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
129
141
  if response[:credit_card]
130
142
  SuccessfulResult.new(:credit_card => CreditCard._new(@gateway, response[:credit_card]))
@@ -135,7 +147,7 @@ module Braintree
135
147
  end
136
148
  end
137
149
 
138
- def _do_update(http_verb, path, params) # :nodoc:
150
+ def _do_update(http_verb, path, params)
139
151
  response = @config.http.send(http_verb, "#{@config.base_merchant_path}#{path}", params)
140
152
  if response[:credit_card]
141
153
  SuccessfulResult.new(:credit_card => CreditCard._new(@gateway, response[:credit_card]))
@@ -146,13 +158,13 @@ module Braintree
146
158
  end
147
159
  end
148
160
 
149
- def _fetch_expired(ids) # :nodoc:
161
+ def _fetch_expired(ids)
150
162
  response = @config.http.post("#{@config.base_merchant_path}/payment_methods/all/expired", :search => {:ids => ids})
151
163
  attributes = response[:payment_methods]
152
164
  Util.extract_attribute_as_array(attributes, :credit_card).map { |attrs| CreditCard._new(@gateway, attrs) }
153
165
  end
154
166
 
155
- def _fetch_expiring_between(formatted_start_date, formatted_end_date, ids) # :nodoc:
167
+ def _fetch_expiring_between(formatted_start_date, formatted_end_date, ids)
156
168
  response = @config.http.post(
157
169
  "#{@config.base_merchant_path}/payment_methods/all/expiring?start=#{formatted_start_date}&end=#{formatted_end_date}",
158
170
  :search => {:ids => ids},