braintree 4.14.0 → 4.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (247) 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_gateway.rb +28 -11
  22. data/lib/braintree/credit_card_verification_search.rb +1 -1
  23. data/lib/braintree/customer.rb +5 -9
  24. data/lib/braintree/customer_gateway.rb +7 -7
  25. data/lib/braintree/customer_search.rb +1 -1
  26. data/lib/braintree/descriptor.rb +1 -1
  27. data/lib/braintree/digest.rb +1 -1
  28. data/lib/braintree/disbursement.rb +5 -5
  29. data/lib/braintree/discount_gateway.rb +1 -1
  30. data/lib/braintree/dispute/evidence.rb +1 -1
  31. data/lib/braintree/dispute/paypal_message.rb +1 -1
  32. data/lib/braintree/dispute/status_history.rb +1 -1
  33. data/lib/braintree/dispute/transaction.rb +1 -1
  34. data/lib/braintree/dispute/transaction_details.rb +1 -1
  35. data/lib/braintree/dispute.rb +3 -3
  36. data/lib/braintree/dispute_gateway.rb +1 -1
  37. data/lib/braintree/dispute_search.rb +1 -1
  38. data/lib/braintree/document_upload.rb +2 -2
  39. data/lib/braintree/document_upload_gateway.rb +3 -3
  40. data/lib/braintree/enriched_customer_data.rb +2 -2
  41. data/lib/braintree/error_codes.rb +4 -0
  42. data/lib/braintree/error_result.rb +2 -3
  43. data/lib/braintree/errors.rb +3 -3
  44. data/lib/braintree/exceptions.rb +1 -2
  45. data/lib/braintree/exchange_rate.rb +2 -2
  46. data/lib/braintree/exchange_rate_quote.rb +3 -3
  47. data/lib/braintree/exchange_rate_quote_gateway.rb +1 -1
  48. data/lib/braintree/exchange_rate_quote_input.rb +3 -3
  49. data/lib/braintree/exchange_rate_quote_request.rb +3 -3
  50. data/lib/braintree/exchange_rate_quote_response.rb +3 -3
  51. data/lib/braintree/facilitated_details.rb +1 -1
  52. data/lib/braintree/facilitator_details.rb +1 -1
  53. data/lib/braintree/google_pay_card.rb +3 -3
  54. data/lib/braintree/granted_payment_instrument_update.rb +1 -1
  55. data/lib/braintree/graphql_client.rb +1 -1
  56. data/lib/braintree/http.rb +5 -5
  57. data/lib/braintree/local_payment_completed.rb +2 -2
  58. data/lib/braintree/local_payment_expired.rb +2 -2
  59. data/lib/braintree/local_payment_funded.rb +2 -2
  60. data/lib/braintree/local_payment_reversed.rb +2 -2
  61. data/lib/braintree/merchant.rb +3 -3
  62. data/lib/braintree/merchant_account.rb +2 -2
  63. data/lib/braintree/merchant_account_gateway.rb +9 -9
  64. data/lib/braintree/meta_checkout_card.rb +89 -0
  65. data/lib/braintree/meta_checkout_token.rb +88 -0
  66. data/lib/braintree/modification.rb +3 -3
  67. data/lib/braintree/oauth_credentials.rb +3 -3
  68. data/lib/braintree/paginated_collection.rb +2 -2
  69. data/lib/braintree/paginated_result.rb +1 -1
  70. data/lib/braintree/payment_instrument_type.rb +2 -0
  71. data/lib/braintree/payment_method_customer_data_updated_metadata.rb +2 -2
  72. data/lib/braintree/payment_method_gateway.rb +23 -10
  73. data/lib/braintree/payment_method_nonce.rb +4 -4
  74. data/lib/braintree/payment_method_nonce_details.rb +1 -1
  75. data/lib/braintree/payment_method_nonce_details_payer_info.rb +1 -1
  76. data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
  77. data/lib/braintree/paypal_account.rb +1 -2
  78. data/lib/braintree/paypal_account_gateway.rb +5 -5
  79. data/lib/braintree/plan.rb +1 -1
  80. data/lib/braintree/plan_gateway.rb +2 -2
  81. data/lib/braintree/resource_collection.rb +2 -2
  82. data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
  83. data/lib/braintree/risk_data.rb +1 -1
  84. data/lib/braintree/samsung_pay_card.rb +5 -5
  85. data/lib/braintree/sepa_direct_debit_account.rb +2 -2
  86. data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +1 -1
  87. data/lib/braintree/settlement_batch_summary_gateway.rb +1 -1
  88. data/lib/braintree/sha256_digest.rb +1 -1
  89. data/lib/braintree/subscription/status_details.rb +1 -1
  90. data/lib/braintree/subscription.rb +2 -2
  91. data/lib/braintree/subscription_gateway.rb +6 -6
  92. data/lib/braintree/subscription_search.rb +1 -1
  93. data/lib/braintree/successful_result.rb +2 -2
  94. data/lib/braintree/test/credit_card.rb +7 -10
  95. data/lib/braintree/test/merchant_account.rb +1 -1
  96. data/lib/braintree/test/nonce.rb +4 -0
  97. data/lib/braintree/test/transaction_amounts.rb +2 -3
  98. data/lib/braintree/test/venmo_sdk.rb +2 -0
  99. data/lib/braintree/testing_gateway.rb +1 -1
  100. data/lib/braintree/three_d_secure_info.rb +1 -1
  101. data/lib/braintree/transaction/address_details.rb +2 -1
  102. data/lib/braintree/transaction/credit_card_details.rb +4 -1
  103. data/lib/braintree/transaction/customer_details.rb +1 -1
  104. data/lib/braintree/transaction/disbursement_details.rb +1 -1
  105. data/lib/braintree/transaction/local_payment_details.rb +2 -0
  106. data/lib/braintree/transaction/meta_checkout_card_details.rb +52 -0
  107. data/lib/braintree/transaction/meta_checkout_token_details.rb +54 -0
  108. data/lib/braintree/transaction/package_details.rb +16 -0
  109. data/lib/braintree/transaction/samsung_pay_card_details.rb +1 -1
  110. data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +1 -1
  111. data/lib/braintree/transaction/status_details.rb +1 -1
  112. data/lib/braintree/transaction/subscription_details.rb +1 -1
  113. data/lib/braintree/transaction/us_bank_account_details.rb +1 -1
  114. data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
  115. data/lib/braintree/transaction.rb +37 -20
  116. data/lib/braintree/transaction_gateway.rb +44 -15
  117. data/lib/braintree/transaction_line_item.rb +13 -10
  118. data/lib/braintree/transaction_line_item_gateway.rb +1 -1
  119. data/lib/braintree/transaction_review.rb +1 -1
  120. data/lib/braintree/transaction_search.rb +7 -6
  121. data/lib/braintree/unknown_payment_method.rb +1 -1
  122. data/lib/braintree/us_bank_account.rb +2 -2
  123. data/lib/braintree/us_bank_account_verification.rb +23 -15
  124. data/lib/braintree/us_bank_account_verification_search.rb +1 -1
  125. data/lib/braintree/util.rb +3 -3
  126. data/lib/braintree/validation_error.rb +1 -1
  127. data/lib/braintree/validation_error_collection.rb +3 -3
  128. data/lib/braintree/venmo_account.rb +3 -3
  129. data/lib/braintree/venmo_profile_data.rb +6 -4
  130. data/lib/braintree/version.rb +1 -1
  131. data/lib/braintree/visa_checkout_card.rb +7 -7
  132. data/lib/braintree/webhook_notification.rb +3 -2
  133. data/lib/braintree/webhook_notification_gateway.rb +4 -4
  134. data/lib/braintree/webhook_testing.rb +1 -1
  135. data/lib/braintree/webhook_testing_gateway.rb +18 -1
  136. data/lib/braintree/xml/generator.rb +1 -1
  137. data/lib/braintree/xml/libxml.rb +1 -1
  138. data/lib/braintree/xml/parser.rb +3 -3
  139. data/lib/braintree/xml/rexml.rb +2 -2
  140. data/lib/braintree/xml.rb +1 -1
  141. data/lib/braintree.rb +5 -1
  142. data/spec/integration/braintree/add_on_spec.rb +9 -9
  143. data/spec/integration/braintree/address_spec.rb +69 -69
  144. data/spec/integration/braintree/advanced_search_spec.rb +45 -45
  145. data/spec/integration/braintree/apple_pay_spec.rb +8 -8
  146. data/spec/integration/braintree/client_api/client_token_spec.rb +15 -15
  147. data/spec/integration/braintree/client_api/spec_helper.rb +2 -2
  148. data/spec/integration/braintree/credit_card_spec.rb +227 -228
  149. data/spec/integration/braintree/credit_card_verification_search_spec.rb +16 -16
  150. data/spec/integration/braintree/credit_card_verification_spec.rb +98 -53
  151. data/spec/integration/braintree/customer_search_spec.rb +20 -20
  152. data/spec/integration/braintree/customer_spec.rb +317 -317
  153. data/spec/integration/braintree/disbursement_spec.rb +2 -2
  154. data/spec/integration/braintree/discount_spec.rb +9 -9
  155. data/spec/integration/braintree/dispute_search_spec.rb +0 -1
  156. data/spec/integration/braintree/dispute_spec.rb +87 -87
  157. data/spec/integration/braintree/document_upload_spec.rb +17 -17
  158. data/spec/integration/braintree/error_codes_spec.rb +2 -2
  159. data/spec/integration/braintree/http_spec.rb +28 -28
  160. data/spec/integration/braintree/merchant_account_spec.rb +127 -127
  161. data/spec/integration/braintree/merchant_spec.rb +103 -103
  162. data/spec/integration/braintree/oauth_spec.rb +61 -61
  163. data/spec/integration/braintree/package_tracking_spec.rb +111 -0
  164. data/spec/integration/braintree/payment_method_nonce_spec.rb +89 -69
  165. data/spec/integration/braintree/payment_method_spec.rb +391 -391
  166. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +150 -78
  167. data/spec/integration/braintree/paypal_account_spec.rb +38 -38
  168. data/spec/integration/braintree/plan_spec.rb +15 -15
  169. data/spec/integration/braintree/samsung_pay_card_spec.rb +65 -65
  170. data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +51 -51
  171. data/spec/integration/braintree/settlement_batch_summary_spec.rb +11 -11
  172. data/spec/integration/braintree/subscription_spec.rb +364 -364
  173. data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
  174. data/spec/integration/braintree/test_transaction_spec.rb +19 -19
  175. data/spec/integration/braintree/transaction_line_item_spec.rb +12 -6
  176. data/spec/integration/braintree/transaction_search_spec.rb +225 -165
  177. data/spec/integration/braintree/transaction_spec.rb +1606 -1230
  178. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -32
  179. data/spec/integration/braintree/us_bank_account_spec.rb +30 -30
  180. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +18 -18
  181. data/spec/integration/braintree/us_bank_account_verification_spec.rb +33 -33
  182. data/spec/integration/braintree/visa_checkout_card_spec.rb +57 -57
  183. data/spec/spec_helper.rb +9 -8
  184. data/spec/unit/braintree/address_spec.rb +8 -8
  185. data/spec/unit/braintree/base_module_spec.rb +4 -4
  186. data/spec/unit/braintree/client_token_spec.rb +2 -2
  187. data/spec/unit/braintree/configuration_spec.rb +57 -57
  188. data/spec/unit/braintree/credentials_parser_spec.rb +6 -6
  189. data/spec/unit/braintree/credit_card_spec.rb +31 -29
  190. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +33 -28
  191. data/spec/unit/braintree/credit_card_verification_search_spec.rb +9 -9
  192. data/spec/unit/braintree/credit_card_verification_spec.rb +17 -17
  193. data/spec/unit/braintree/customer_spec.rb +41 -40
  194. data/spec/unit/braintree/digest_spec.rb +5 -5
  195. data/spec/unit/braintree/disbursement_spec.rb +11 -11
  196. data/spec/unit/braintree/dispute_search_spec.rb +2 -2
  197. data/spec/unit/braintree/dispute_spec.rb +56 -56
  198. data/spec/unit/braintree/document_upload_spec.rb +8 -8
  199. data/spec/unit/braintree/enriched_customer_data_spec.rb +11 -2
  200. data/spec/unit/braintree/error_result_spec.rb +5 -5
  201. data/spec/unit/braintree/errors_spec.rb +9 -9
  202. data/spec/unit/braintree/http_spec.rb +9 -9
  203. data/spec/unit/braintree/local_payment_completed_spec.rb +11 -11
  204. data/spec/unit/braintree/local_payment_expired_spec.rb +2 -2
  205. data/spec/unit/braintree/local_payment_funded_spec.rb +6 -6
  206. data/spec/unit/braintree/merchant_account_spec.rb +4 -4
  207. data/spec/unit/braintree/meta_checkout_card_details_spec.rb +60 -0
  208. data/spec/unit/braintree/meta_checkout_card_spec.rb +60 -0
  209. data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
  210. data/spec/unit/braintree/meta_checkout_token_spec.rb +63 -0
  211. data/spec/unit/braintree/modification_spec.rb +1 -1
  212. data/spec/unit/braintree/package_tracking_spec.rb +74 -0
  213. data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +6 -6
  214. data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +7 -7
  215. data/spec/unit/braintree/payment_method_nonce_details_spec.rb +14 -14
  216. data/spec/unit/braintree/payment_method_spec.rb +19 -19
  217. data/spec/unit/braintree/paypal_account_spec.rb +4 -4
  218. data/spec/unit/braintree/resource_collection_spec.rb +7 -7
  219. data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +1 -1
  220. data/spec/unit/braintree/sha256_digest_spec.rb +1 -1
  221. data/spec/unit/braintree/signature_service_spec.rb +2 -2
  222. data/spec/unit/braintree/subscription_search_spec.rb +17 -17
  223. data/spec/unit/braintree/subscription_spec.rb +8 -8
  224. data/spec/unit/braintree/successful_result_spec.rb +5 -5
  225. data/spec/unit/braintree/three_d_secure_info_spec.rb +20 -20
  226. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +5 -5
  227. data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
  228. data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
  229. data/spec/unit/braintree/transaction/local_payment_details_spec.rb +30 -0
  230. data/spec/unit/braintree/transaction_gateway_spec.rb +41 -9
  231. data/spec/unit/braintree/transaction_search_spec.rb +2 -2
  232. data/spec/unit/braintree/transaction_spec.rb +101 -93
  233. data/spec/unit/braintree/unknown_payment_method_spec.rb +4 -4
  234. data/spec/unit/braintree/us_bank_account_spec.rb +2 -2
  235. data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +7 -7
  236. data/spec/unit/braintree/us_bank_account_verification_spec.rb +12 -7
  237. data/spec/unit/braintree/util_spec.rb +27 -27
  238. data/spec/unit/braintree/validation_error_collection_spec.rb +34 -34
  239. data/spec/unit/braintree/validation_error_spec.rb +4 -4
  240. data/spec/unit/braintree/venmo_profile_data_spec.rb +16 -5
  241. data/spec/unit/braintree/webhook_notification_spec.rb +206 -191
  242. data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
  243. data/spec/unit/braintree/xml/parser_spec.rb +8 -8
  244. data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
  245. data/spec/unit/braintree/xml_spec.rb +17 -17
  246. data/spec/unit/braintree_spec.rb +2 -2
  247. metadata +14 -2
@@ -28,7 +28,7 @@ module Braintree
28
28
  @config.http.delete("#{@config.base_merchant_path}/payment_methods/paypal_account/#{token}")
29
29
  end
30
30
 
31
- def _do_create(path, params) # :nodoc:
31
+ def _do_create(path, params)
32
32
  response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
33
33
  if response[:paypal_account]
34
34
  SuccessfulResult.new(:paypal_account => PayPalAccount._new(@gateway, response[:paypal_account]))
@@ -39,7 +39,7 @@ module Braintree
39
39
  end
40
40
  end
41
41
 
42
- def _do_update(http_verb, path, params) # :nodoc:
42
+ def _do_update(http_verb, path, params)
43
43
  response = @config.http.send(http_verb, "#{@config.base_merchant_path}#{path}", params)
44
44
  if response[:paypal_account]
45
45
  SuccessfulResult.new(:paypal_account => PayPalAccount._new(@gateway, response[:paypal_account]))
@@ -50,7 +50,7 @@ module Braintree
50
50
  end
51
51
  end
52
52
 
53
- def self._create_signature # :nodoc:
53
+ def self._create_signature
54
54
  options = [:fail_on_duplicate_payment_method, :make_default]
55
55
  [
56
56
  :email, :token, :billing_agreement_id, :customer_id,
@@ -58,14 +58,14 @@ module Braintree
58
58
  ]
59
59
  end
60
60
 
61
- def self._create_nested_signature # :nodoc:
61
+ def self._create_nested_signature
62
62
  [
63
63
  :email, :token, :billing_agreement_id,
64
64
  {:options => [:make_default]}
65
65
  ]
66
66
  end
67
67
 
68
- def self._update_signature # :nodoc:
68
+ def self._update_signature
69
69
  options = [:fail_on_duplicate_payment_method, :make_default]
70
70
  [:email, :token, :billing_agreement_id, {:options => options}]
71
71
  end
@@ -23,7 +23,7 @@ module Braintree
23
23
  Configuration.gateway.plan.all
24
24
  end
25
25
 
26
- def initialize(gateway, attributes) # :nodoc:
26
+ def initialize(gateway, attributes)
27
27
  @gateway = gateway
28
28
  set_instance_variables_from_hash(attributes)
29
29
  add_ons.map! { |attrs| AddOn._new(attrs) }
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class PlanGateway # :nodoc:
2
+ class PlanGateway
3
3
  include BaseModule
4
4
 
5
5
  def initialize(gateway)
@@ -102,7 +102,7 @@ module Braintree
102
102
  ]
103
103
  end
104
104
 
105
- def _do_create(path, params) # :nodoc:
105
+ def _do_create(path, params)
106
106
  response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
107
107
  if response[:plan]
108
108
  SuccessfulResult.new(:plan => Plan._new(@gateway, response[:plan]))
@@ -1,10 +1,10 @@
1
1
  module Braintree
2
- class ResourceCollection # :nodoc:
2
+ class ResourceCollection
3
3
  include Enumerable
4
4
 
5
5
  attr_reader :ids
6
6
 
7
- def initialize(response, &block) # :nodoc:
7
+ def initialize(response, &block)
8
8
  @ids = Util.extract_attribute_as_array(response[:search_results], :ids)
9
9
  @page_size = response[:search_results][:page_size]
10
10
  @paging_block = block
@@ -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,5 +1,5 @@
1
1
  module Braintree
2
- class RiskData # :nodoc:
2
+ class RiskData
3
3
  include BaseModule
4
4
 
5
5
  attr_reader :customer_device_id
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class SamsungPayCard
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
  include Braintree::Util::TokenEquality
5
5
 
6
6
  attr_reader :billing_address
@@ -29,7 +29,7 @@ module Braintree
29
29
  attr_reader :unique_number_identifier
30
30
  attr_reader :updated_at
31
31
 
32
- def initialize(gateway, attributes) # :nodoc:
32
+ def initialize(gateway, attributes)
33
33
  @gateway = gateway
34
34
  set_instance_variables_from_hash(attributes)
35
35
  @billing_address = attributes[:billing_address] ? Address._new(@gateway, attributes[:billing_address]) : nil
@@ -49,7 +49,7 @@ module Braintree
49
49
  @expired
50
50
  end
51
51
 
52
- def inspect # :nodoc:
52
+ def inspect
53
53
  first = [:token]
54
54
  order = first + (self.class._attributes - first)
55
55
  nice_attributes = order.map do |attr|
@@ -66,7 +66,7 @@ module Braintree
66
66
  protected :new
67
67
  end
68
68
 
69
- def self._attributes # :nodoc:
69
+ def self._attributes
70
70
  [
71
71
  :billing_address, :bin, :cardholder_name, :card_type, :created_at, :customer_id,
72
72
  :customer_location, :expiration_month, :expiration_year,
@@ -76,7 +76,7 @@ module Braintree
76
76
  ]
77
77
  end
78
78
 
79
- def self._new(*args) # :nodoc:
79
+ def self._new(*args)
80
80
  self.new(*args)
81
81
  end
82
82
  end
@@ -17,7 +17,7 @@ module Braintree
17
17
  attr_reader :updated_at
18
18
  attr_reader :view_mandate_url
19
19
 
20
- def initialize(gateway, attributes) # :nodoc:
20
+ def initialize(gateway, attributes)
21
21
  @gateway = gateway
22
22
  @subscriptions = (@subscriptions || []).map { |subscription_hash| Subscription._new(@gateway, subscription_hash) }
23
23
  set_instance_variables_from_hash(attributes)
@@ -31,7 +31,7 @@ module Braintree
31
31
  protected :new
32
32
  end
33
33
 
34
- def self._new(*args) # :nodoc:
34
+ def self._new(*args)
35
35
  self.new(*args)
36
36
  end
37
37
 
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class SepaDirectDebitAccountNonceDetails# :nodoc:
2
+ class SepaDirectDebitAccountNonceDetails
3
3
  include BaseModule
4
4
 
5
5
  attr_reader :bank_reference_token
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class SettlementBatchSummaryGateway # :nodoc
2
+ class SettlementBatchSummaryGateway
3
3
  include BaseModule
4
4
 
5
5
  def initialize(gateway)
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- module SHA256Digest # :nodoc:
2
+ module SHA256Digest
3
3
  def self.hexdigest(private_key, string)
4
4
  _hmac(private_key, string)
5
5
  end
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Subscription
3
- class StatusDetails # :nodoc:
3
+ class StatusDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :balance
@@ -91,7 +91,7 @@ module Braintree
91
91
  Configuration.gateway.subscription.update!(*args)
92
92
  end
93
93
 
94
- def initialize(gateway, attributes) # :nodoc:
94
+ def initialize(gateway, attributes)
95
95
  @gateway = gateway
96
96
  set_instance_variables_from_hash(attributes)
97
97
  @balance = Util.to_big_decimal(balance)
@@ -114,7 +114,7 @@ module Braintree
114
114
 
115
115
  class << self
116
116
  protected :new
117
- def _new(*args) # :nodoc:
117
+ def _new(*args)
118
118
  self.new(*args)
119
119
  end
120
120
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class SubscriptionGateway # :nodoc:
2
+ class SubscriptionGateway
3
3
  include BaseModule
4
4
 
5
5
  def initialize(gateway)
@@ -70,7 +70,7 @@ module Braintree
70
70
  return_object_or_raise(:subscription) { update(*args) }
71
71
  end
72
72
 
73
- def self._create_signature # :nodoc:
73
+ def self._create_signature
74
74
  [
75
75
  :billing_day_of_month,
76
76
  :first_billing_date,
@@ -94,7 +94,7 @@ module Braintree
94
94
  ] + _add_on_discount_signature
95
95
  end
96
96
 
97
- def self._update_signature # :nodoc:
97
+ def self._update_signature
98
98
  [
99
99
  :id,
100
100
  :merchant_account_id,
@@ -114,7 +114,7 @@ module Braintree
114
114
  ] + _add_on_discount_signature
115
115
  end
116
116
 
117
- def self._add_on_discount_signature # :nodoc:
117
+ def self._add_on_discount_signature
118
118
  [
119
119
  {
120
120
  :add_ons => [
@@ -133,7 +133,7 @@ module Braintree
133
133
  ]
134
134
  end
135
135
 
136
- def _do_create(path, params) # :nodoc:
136
+ def _do_create(path, params)
137
137
  response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
138
138
  if response[:subscription]
139
139
  SuccessfulResult.new(:subscription => Subscription._new(@gateway, response[:subscription]))
@@ -144,7 +144,7 @@ module Braintree
144
144
  end
145
145
  end
146
146
 
147
- def _fetch_subscriptions(search, ids) # :nodoc:
147
+ def _fetch_subscriptions(search, ids)
148
148
  search.ids.in ids
149
149
  response = @config.http.post("#{@config.base_merchant_path}/subscriptions/advanced_search", {:search => search.to_hash})
150
150
  attributes = response[:subscriptions]
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class SubscriptionSearch < AdvancedSearch # :nodoc:
2
+ class SubscriptionSearch < AdvancedSearch
3
3
  multiple_value_field :in_trial_period
4
4
  multiple_value_field :ids
5
5
  text_fields :id, :transaction_id
@@ -25,7 +25,7 @@ module Braintree
25
25
  attr_reader :transaction
26
26
  attr_reader :us_bank_account_verification
27
27
 
28
- def initialize(attributes = {}) # :nodoc:
28
+ def initialize(attributes = {})
29
29
  @attrs = attributes.keys
30
30
  attributes.each do |key, value|
31
31
  instance_variable_set("@#{key}", value)
@@ -33,7 +33,7 @@ module Braintree
33
33
  @credit_card_verification = @verification
34
34
  end
35
35
 
36
- def inspect # :nodoc:
36
+ def inspect
37
37
  inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" }
38
38
  "#<#{self.class} #{inspected_attributes.join(" ")}>"
39
39
  end
@@ -1,8 +1,5 @@
1
1
  module Braintree
2
- module Test # :nodoc:
3
- # The constants contained in the Braintree::Test::CreditCardNumbers module provide
4
- # credit card numbers that should be used when working in the sandbox environment. The sandbox
5
- # will not accept any credit card numbers other than the ones listed below.
2
+ module Test
6
3
  module CreditCardNumbers
7
4
  module CardTypeIndicators
8
5
  Prepaid = "4111111111111210"
@@ -18,16 +15,16 @@ module Braintree
18
15
  end
19
16
 
20
17
  AmExes = %w[378282246310005 371449635398431 378734493671000]
21
- CarteBlanches = %w[30569309025904] # :nodoc:
22
- DinersClubs = %w[38520000023237] # :nodoc:
18
+ CarteBlanches = %w[30569309025904]
19
+ DinersClubs = %w[38520000023237]
23
20
 
24
21
  Discover = "6011111111111117"
25
22
  Discovers = %w[6011111111111117 6011000990139424]
26
- JCBs = %w[3530111333300000 3566002020360505] # :nodoc:
23
+ JCBs = %w[3530111333300000 3566002020360505]
27
24
 
28
- Maestro = "6304000000000000" # :nodoc:
25
+ Maestro = "6304000000000000"
29
26
  MasterCard = "5555555555554444"
30
- MasterCardInternational = "5105105105105100" # :nodoc:
27
+ MasterCardInternational = "5105105105105100"
31
28
 
32
29
  MasterCards = %w[5105105105105100 5555555555554444]
33
30
 
@@ -37,7 +34,7 @@ module Braintree
37
34
 
38
35
  Visa = "4012888888881881"
39
36
  VisaCountryOfIssuanceIE = "4023490000000008"
40
- VisaInternational = "4009348888881881" # :nodoc:
37
+ VisaInternational = "4009348888881881"
41
38
  VisaPrepaid = "4500600000000061"
42
39
 
43
40
  Fraud = "4000111111111511"
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- module Test # :nodoc:
2
+ module Test
3
3
  module MerchantAccount
4
4
  Approve = "approve_me"
5
5
 
@@ -18,6 +18,8 @@ module Braintree
18
18
  GooglePayVisa = "fake-android-pay-visa-nonce"
19
19
  GooglePayMasterCard = "fake-android-pay-mastercard-nonce"
20
20
  GooglePayAmEx = "fake-android-pay-amex-nonce"
21
+ MetaCheckoutCard = "fake-meta-checkout-card-nonce"
22
+ MetaCheckoutToken = "fake-meta-checkout-token-nonce"
21
23
  VenmoAccount = "fake-venmo-account-nonce"
22
24
  VenmoAccountTokenIssuanceError = "fake-token-issuance-error-venmo-account-nonce"
23
25
  ThreeDSecureVisaFullAuthentication = "fake-three-d-secure-visa-full-authentication-nonce"
@@ -53,6 +55,7 @@ module Braintree
53
55
  TransactableCountryOfIssuanceUSA = "fake-valid-country-of-issuance-usa-nonce"
54
56
  TransactableCountryOfIssuanceCAD = "fake-valid-country-of-issuance-cad-nonce"
55
57
  TransactableIssuingBankNetworkOnly = "fake-valid-issuing-bank-network-only-nonce"
58
+ TransactablePinlessDebitVisa = "fake-pinless-debit-visa-nonce"
56
59
  ProcessorDeclinedVisa = "fake-processor-declined-visa-nonce"
57
60
  ProcessorDeclinedMasterCard = "fake-processor-declined-mastercard-nonce"
58
61
  ProcessorDeclinedAmEx = "fake-processor-declined-amex-nonce"
@@ -71,6 +74,7 @@ module Braintree
71
74
  SamsungPayMasterCard = "tokensam_fake_mastercard"
72
75
  SamsungPayVisa = "tokensam_fake_visa"
73
76
  SepaDirectDebit = "fake-sepa-direct-debit-nonce"
77
+ UsBankAccount = "fake-us-bank-account-nonce"
74
78
  end
75
79
  end
76
80
  end
@@ -1,7 +1,6 @@
1
1
  module Braintree
2
- module Test # :nodoc:
3
- # The constants in this module can be used to create transactions with
4
- # the desired status in the sandbox environment.
2
+ module Test
3
+ # NEXT_MAJOR_VERSION are these even being used anymore? Can we remove this class??
5
4
  module TransactionAmounts
6
5
  Authorize = "1000.00"
7
6
  Decline = "2000.00"
@@ -1,3 +1,5 @@
1
+ # NEXT_MAJOR_VERSION Remove this class
2
+ # The old venmo SDK class has been deprecated
1
3
  module Braintree
2
4
  module Test
3
5
  module VenmoSDK
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class TestingGateway # :nodoc:
2
+ class TestingGateway
3
3
 
4
4
  def initialize(gateway)
5
5
  @gateway = gateway
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class ThreeDSecureInfo # :nodoc:
2
+ class ThreeDSecureInfo
3
3
  include BaseModule
4
4
 
5
5
  attr_reader :acs_transaction_id
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class AddressDetails # :nodoc:
3
+ class AddressDetails
4
4
  include BaseModule
5
5
 
6
6
  module ShippingMethod
@@ -10,6 +10,7 @@ module Braintree
10
10
  Ground = "ground"
11
11
  Electronic = "electronic"
12
12
  ShipToStore = "ship_to_store"
13
+ PickupInStore = "pickup_in_store"
13
14
  end
14
15
 
15
16
  attr_reader :company
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class CreditCardDetails # :nodoc:
3
+ class CreditCardDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :account_type
@@ -64,7 +64,10 @@ module Braintree
64
64
  "#{bin}******#{last_4}"
65
65
  end
66
66
 
67
+ # NEXT_MAJOR_VERSION Remove this method
68
+ # The old venmo SDK class has been deprecated
67
69
  def venmo_sdk?
70
+ warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
68
71
  @venmo_sdk
69
72
  end
70
73
 
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class CustomerDetails # :nodoc:
3
+ class CustomerDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :company
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class DisbursementDetails # :nodoc:
3
+ class DisbursementDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :disbursement_date
@@ -8,6 +8,8 @@ module Braintree
8
8
  attr_reader :debug_id
9
9
  attr_reader :description
10
10
  attr_reader :funding_source
11
+ attr_reader :implicitly_vaulted_payment_method_global_id
12
+ attr_reader :implicitly_vaulted_payment_method_token
11
13
  attr_reader :payer_id
12
14
  attr_reader :payment_id
13
15
  attr_reader :refund_from_transaction_fee_amount
@@ -0,0 +1,52 @@
1
+ module Braintree
2
+ class Transaction
3
+ class MetaCheckoutCardDetails # :nodoc:
4
+ include BaseModule
5
+
6
+ attr_reader :bin
7
+ attr_reader :card_type
8
+ attr_reader :cardholder_name
9
+ attr_reader :commercial
10
+ attr_reader :container_id
11
+ attr_reader :country_of_issuance
12
+ attr_reader :created_at
13
+ attr_reader :customer_location
14
+ attr_reader :debit
15
+ attr_reader :durbin_regulated
16
+ attr_reader :expiration_month
17
+ attr_reader :expiration_year
18
+ attr_reader :healthcare
19
+ attr_reader :image_url
20
+ attr_reader :is_network_tokenized
21
+ attr_reader :issuing_bank
22
+ attr_reader :last_4
23
+ attr_reader :payroll
24
+ attr_reader :prepaid
25
+ attr_reader :product_id
26
+ attr_reader :token
27
+ attr_reader :unique_number_identifier
28
+ attr_reader :updated_at
29
+
30
+ def initialize(attributes)
31
+ set_instance_variables_from_hash attributes unless attributes.nil?
32
+ end
33
+
34
+ def expiration_date
35
+ "#{expiration_month}/#{expiration_year}"
36
+ end
37
+
38
+ def inspect
39
+ attr_order = [:token, :bin, :last_4, :card_type, :expiration_date, :cardholder_name, :customer_location, :prepaid,
40
+ :healthcare, :durbin_regulated, :debit, :commercial, :payroll, :product_id, :country_of_issuance, :issuing_bank, :image_url, :container_id]
41
+ formatted_attrs = attr_order.map do |attr|
42
+ "#{attr}: #{send(attr).inspect}"
43
+ end
44
+ "#<#{formatted_attrs.join(", ")}>"
45
+ end
46
+
47
+ def masked_number
48
+ "#{bin}******#{last_4}"
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,54 @@
1
+ module Braintree
2
+ class Transaction
3
+ class MetaCheckoutTokenDetails # :nodoc:
4
+ include BaseModule
5
+
6
+ attr_reader :bin
7
+ attr_reader :container_id
8
+ attr_reader :card_type
9
+ attr_reader :cardholder_name
10
+ attr_reader :commercial
11
+ attr_reader :country_of_issuance
12
+ attr_reader :created_at
13
+ attr_reader :cryptogram
14
+ attr_reader :customer_location
15
+ attr_reader :debit
16
+ attr_reader :durbin_regulated
17
+ attr_reader :ecommerce_indicator
18
+ attr_reader :expiration_month
19
+ attr_reader :expiration_year
20
+ attr_reader :healthcare
21
+ attr_reader :image_url
22
+ attr_reader :issuing_bank
23
+ attr_reader :is_network_tokenized
24
+ attr_reader :last_4
25
+ attr_reader :payroll
26
+ attr_reader :prepaid
27
+ attr_reader :product_id
28
+ attr_reader :token
29
+ attr_reader :unique_number_identifier
30
+ attr_reader :updated_at
31
+
32
+ def initialize(attributes)
33
+ set_instance_variables_from_hash attributes unless attributes.nil?
34
+ end
35
+
36
+ def expiration_date
37
+ "#{expiration_month}/#{expiration_year}"
38
+ end
39
+
40
+ def inspect
41
+ attr_order = [:container_id, :cryptogram, :ecommerce_indicator, :token, :bin, :last_4, :card_type, :expiration_date, :cardholder_name, :customer_location, :prepaid,
42
+ :healthcare, :durbin_regulated, :debit, :commercial, :payroll, :product_id, :country_of_issuance, :issuing_bank, :is_network_tokenized, :image_url]
43
+ formatted_attrs = attr_order.map do |attr|
44
+ "#{attr}: #{send(attr).inspect}"
45
+ end
46
+ "#<#{formatted_attrs.join(", ")}>"
47
+ end
48
+
49
+ def masked_number
50
+ "#{bin}******#{last_4}"
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,16 @@
1
+ module Braintree
2
+ class Transaction
3
+ class PackageDetails
4
+ include BaseModule
5
+
6
+ attr_reader :carrier
7
+ attr_reader :id
8
+ attr_reader :paypal_tracking_id
9
+ attr_reader :tracking_number
10
+
11
+ def initialize(attributes)
12
+ set_instance_variables_from_hash attributes unless attributes.nil?
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class SamsungPayCardDetails # :nodoc:
3
+ class SamsungPayCardDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :bin
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class SepaDirectDebitAccountDetails # :nodoc:
3
+ class SepaDirectDebitAccountDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :bank_reference_token
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class StatusDetails # :nodoc:
3
+ class StatusDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :amount
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class SubscriptionDetails # :nodoc:
3
+ class SubscriptionDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :billing_period_end_date
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class UsBankAccountDetails # :nodoc:
3
+ class UsBankAccountDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :account_holder_name
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class VisaCheckoutCardDetails # :nodoc:
3
+ class VisaCheckoutCardDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :bin