braintree 4.15.0 → 4.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) 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 +9 -9
  19. data/lib/braintree/credit_card_gateway.rb +8 -8
  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_result.rb +2 -3
  42. data/lib/braintree/errors.rb +3 -3
  43. data/lib/braintree/exceptions.rb +1 -2
  44. data/lib/braintree/exchange_rate.rb +2 -2
  45. data/lib/braintree/exchange_rate_quote.rb +3 -3
  46. data/lib/braintree/exchange_rate_quote_gateway.rb +1 -1
  47. data/lib/braintree/exchange_rate_quote_input.rb +3 -3
  48. data/lib/braintree/exchange_rate_quote_request.rb +3 -3
  49. data/lib/braintree/exchange_rate_quote_response.rb +3 -3
  50. data/lib/braintree/facilitated_details.rb +1 -1
  51. data/lib/braintree/facilitator_details.rb +1 -1
  52. data/lib/braintree/google_pay_card.rb +3 -3
  53. data/lib/braintree/granted_payment_instrument_update.rb +1 -1
  54. data/lib/braintree/graphql_client.rb +1 -1
  55. data/lib/braintree/http.rb +5 -5
  56. data/lib/braintree/local_payment_completed.rb +2 -2
  57. data/lib/braintree/local_payment_expired.rb +2 -2
  58. data/lib/braintree/local_payment_funded.rb +2 -2
  59. data/lib/braintree/local_payment_reversed.rb +2 -2
  60. data/lib/braintree/merchant.rb +3 -3
  61. data/lib/braintree/merchant_account.rb +2 -2
  62. data/lib/braintree/merchant_account_gateway.rb +9 -9
  63. data/lib/braintree/meta_checkout_card.rb +89 -0
  64. data/lib/braintree/meta_checkout_token.rb +88 -0
  65. data/lib/braintree/modification.rb +3 -3
  66. data/lib/braintree/oauth_credentials.rb +3 -3
  67. data/lib/braintree/paginated_collection.rb +2 -2
  68. data/lib/braintree/paginated_result.rb +1 -1
  69. data/lib/braintree/payment_instrument_type.rb +2 -0
  70. data/lib/braintree/payment_method_customer_data_updated_metadata.rb +2 -2
  71. data/lib/braintree/payment_method_gateway.rb +8 -7
  72. data/lib/braintree/payment_method_nonce.rb +4 -4
  73. data/lib/braintree/payment_method_nonce_details.rb +1 -1
  74. data/lib/braintree/payment_method_nonce_details_payer_info.rb +1 -1
  75. data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
  76. data/lib/braintree/paypal_account.rb +1 -2
  77. data/lib/braintree/paypal_account_gateway.rb +5 -5
  78. data/lib/braintree/plan.rb +1 -1
  79. data/lib/braintree/plan_gateway.rb +2 -2
  80. data/lib/braintree/resource_collection.rb +2 -2
  81. data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
  82. data/lib/braintree/risk_data.rb +1 -1
  83. data/lib/braintree/samsung_pay_card.rb +5 -5
  84. data/lib/braintree/sepa_direct_debit_account.rb +2 -2
  85. data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +1 -1
  86. data/lib/braintree/settlement_batch_summary_gateway.rb +1 -1
  87. data/lib/braintree/sha256_digest.rb +1 -1
  88. data/lib/braintree/subscription/status_details.rb +1 -1
  89. data/lib/braintree/subscription.rb +2 -2
  90. data/lib/braintree/subscription_gateway.rb +6 -6
  91. data/lib/braintree/subscription_search.rb +1 -1
  92. data/lib/braintree/successful_result.rb +2 -2
  93. data/lib/braintree/test/credit_card.rb +7 -10
  94. data/lib/braintree/test/merchant_account.rb +1 -1
  95. data/lib/braintree/test/nonce.rb +3 -0
  96. data/lib/braintree/test/transaction_amounts.rb +2 -3
  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 +2 -1
  100. data/lib/braintree/transaction/credit_card_details.rb +1 -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/meta_checkout_card_details.rb +52 -0
  104. data/lib/braintree/transaction/meta_checkout_token_details.rb +54 -0
  105. data/lib/braintree/transaction/samsung_pay_card_details.rb +1 -1
  106. data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +1 -1
  107. data/lib/braintree/transaction/status_details.rb +1 -1
  108. data/lib/braintree/transaction/subscription_details.rb +1 -1
  109. data/lib/braintree/transaction/us_bank_account_details.rb +1 -1
  110. data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
  111. data/lib/braintree/transaction.rb +22 -16
  112. data/lib/braintree/transaction_gateway.rb +9 -10
  113. data/lib/braintree/transaction_line_item.rb +2 -2
  114. data/lib/braintree/transaction_line_item_gateway.rb +1 -1
  115. data/lib/braintree/transaction_review.rb +1 -1
  116. data/lib/braintree/transaction_search.rb +1 -1
  117. data/lib/braintree/unknown_payment_method.rb +1 -1
  118. data/lib/braintree/us_bank_account.rb +2 -2
  119. data/lib/braintree/us_bank_account_verification.rb +23 -15
  120. data/lib/braintree/us_bank_account_verification_search.rb +1 -1
  121. data/lib/braintree/util.rb +3 -3
  122. data/lib/braintree/validation_error.rb +1 -1
  123. data/lib/braintree/validation_error_collection.rb +3 -3
  124. data/lib/braintree/venmo_account.rb +3 -3
  125. data/lib/braintree/venmo_profile_data.rb +6 -4
  126. data/lib/braintree/version.rb +1 -1
  127. data/lib/braintree/visa_checkout_card.rb +7 -7
  128. data/lib/braintree/webhook_notification.rb +2 -2
  129. data/lib/braintree/webhook_notification_gateway.rb +4 -4
  130. data/lib/braintree/webhook_testing.rb +1 -1
  131. data/lib/braintree/webhook_testing_gateway.rb +1 -1
  132. data/lib/braintree/xml/generator.rb +1 -1
  133. data/lib/braintree/xml/libxml.rb +1 -1
  134. data/lib/braintree/xml/parser.rb +3 -3
  135. data/lib/braintree/xml/rexml.rb +2 -2
  136. data/lib/braintree/xml.rb +1 -1
  137. data/lib/braintree.rb +4 -1
  138. data/spec/integration/braintree/client_api/spec_helper.rb +2 -2
  139. data/spec/integration/braintree/credit_card_verification_spec.rb +45 -0
  140. data/spec/integration/braintree/dispute_search_spec.rb +0 -1
  141. data/spec/integration/braintree/payment_method_nonce_spec.rb +20 -0
  142. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +72 -0
  143. data/spec/integration/braintree/transaction_search_spec.rb +27 -0
  144. data/spec/integration/braintree/transaction_spec.rb +192 -66
  145. data/spec/unit/braintree/base_module_spec.rb +1 -1
  146. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +13 -8
  147. data/spec/unit/braintree/enriched_customer_data_spec.rb +9 -0
  148. data/spec/unit/braintree/http_spec.rb +1 -1
  149. data/spec/unit/braintree/meta_checkout_card_details_spec.rb +60 -0
  150. data/spec/unit/braintree/meta_checkout_card_spec.rb +60 -0
  151. data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
  152. data/spec/unit/braintree/meta_checkout_token_spec.rb +63 -0
  153. data/spec/unit/braintree/transaction_gateway_spec.rb +30 -1
  154. data/spec/unit/braintree/us_bank_account_verification_spec.rb +5 -0
  155. data/spec/unit/braintree/venmo_profile_data_spec.rb +11 -0
  156. metadata +10 -2
@@ -47,22 +47,39 @@ module Braintree
47
47
  def self._create_signature
48
48
  [
49
49
  {:credit_card => [
50
- :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year,
51
- :number, {:billing_address => AddressGateway._shared_signature}
50
+ {:billing_address => AddressGateway._shared_signature},
51
+ :cardholder_name,
52
+ :cvv,
53
+ :expiration_date,
54
+ :expiration_month,
55
+ :expiration_year,
56
+ :number,
57
+ ]},
58
+ {:external_vault => [
59
+ :previous_network_transaction_id,
60
+ :status,
52
61
  ]},
53
62
  :intended_transaction_source,
54
- {:options => [:amount, :merchant_account_id, :account_type]},
63
+ {:options => [
64
+ :account_type,
65
+ :amount,
66
+ :merchant_account_id,
67
+ ]},
55
68
  :payment_method_nonce,
69
+ {:risk_data => [
70
+ :customer_browser,
71
+ :customer_ip,
72
+ ]},
56
73
  :three_d_secure_authentication_id,
57
74
  {:three_d_secure_pass_thru => [
58
- :eci_flag,
59
- :cavv,
60
- :xid,
61
- :three_d_secure_version,
62
- :authentication_response,
63
- :directory_response,
64
- :cavv_algorithm,
65
- :ds_transaction_id,
75
+ :authentication_response,
76
+ :cavv,
77
+ :cavv_algorithm,
78
+ :directory_response,
79
+ :ds_transaction_id,
80
+ :eci_flag,
81
+ :three_d_secure_version,
82
+ :xid,
66
83
  ]},
67
84
  ]
68
85
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class CreditCardVerificationSearch < AdvancedSearch # :nodoc:
2
+ class CreditCardVerificationSearch < AdvancedSearch
3
3
  text_fields(
4
4
  :billing_address_details_postal_code,
5
5
  :credit_card_cardholder_name,
@@ -67,7 +67,6 @@ module Braintree
67
67
  Configuration.gateway.customer.search(&block)
68
68
  end
69
69
 
70
- # Returns a ResourceCollection of transactions for the customer with the given +customer_id+.
71
70
  def self.transactions(*args)
72
71
  Configuration.gateway.customer.transactions(*args)
73
72
  end
@@ -80,7 +79,7 @@ module Braintree
80
79
  Configuration.gateway.customer.update!(*args)
81
80
  end
82
81
 
83
- def initialize(gateway, attributes) # :nodoc:
82
+ def initialize(gateway, attributes)
84
83
  @gateway = gateway
85
84
  set_instance_variables_from_hash(attributes)
86
85
  @credit_cards = (@credit_cards || []).map { |pm| CreditCard._new gateway, pm }
@@ -105,7 +104,6 @@ module Braintree
105
104
  return_object_or_raise(:transaction) { credit(transaction_attributes) }
106
105
  end
107
106
 
108
- # Returns the customer's default payment method.
109
107
  def default_payment_method
110
108
  payment_methods.find { |payment_instrument| payment_instrument.default? }
111
109
  end
@@ -114,7 +112,6 @@ module Braintree
114
112
  @gateway.customer.delete(id)
115
113
  end
116
114
 
117
- # Returns the customer's payment methods
118
115
  def payment_methods
119
116
  @credit_cards +
120
117
  @paypal_accounts +
@@ -127,7 +124,7 @@ module Braintree
127
124
  @sepa_direct_debit_accounts
128
125
  end
129
126
 
130
- def inspect # :nodoc:
127
+ def inspect
131
128
  first = [:id]
132
129
  last = [:addresses, :credit_cards, :paypal_accounts, :tax_identifiers]
133
130
  order = first + (self.class._attributes - first - last) + last
@@ -137,7 +134,6 @@ module Braintree
137
134
  "#<#{self.class} #{nice_attributes.join(', ')}>"
138
135
  end
139
136
 
140
- # Returns a ResourceCollection of transactions for the customer.
141
137
  def transactions(options = {})
142
138
  @gateway.customer.transactions(id, options)
143
139
  end
@@ -146,18 +142,18 @@ module Braintree
146
142
  protected :new
147
143
  end
148
144
 
149
- def self._new(*args) # :nodoc:
145
+ def self._new(*args)
150
146
  self.new(*args)
151
147
  end
152
148
 
153
- def self._attributes # :nodoc:
149
+ def self._attributes
154
150
  [
155
151
  :addresses, :company, :credit_cards, :email, :fax, :first_name, :id, :last_name, :phone, :website,
156
152
  :created_at, :updated_at, :tax_identifiers
157
153
  ]
158
154
  end
159
155
 
160
- def self._now_timestamp # :nodoc:
156
+ def self._now_timestamp
161
157
  Time.now.to_i
162
158
  end
163
159
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class CustomerGateway # :nodoc:
2
+ class CustomerGateway
3
3
  include BaseModule
4
4
 
5
5
  def initialize(gateway)
@@ -60,7 +60,7 @@ module Braintree
60
60
  return_object_or_raise(:customer) { update(*args) }
61
61
  end
62
62
 
63
- def self._create_signature # :nodoc:
63
+ def self._create_signature
64
64
  credit_card_signature = CreditCardGateway._create_signature - [:customer_id]
65
65
  paypal_account_signature = PayPalAccountGateway._create_nested_signature
66
66
  paypal_options_shipping_signature = AddressGateway._shared_signature
@@ -86,7 +86,7 @@ module Braintree
86
86
  ]
87
87
  end
88
88
 
89
- def _do_create(path, params=nil) # :nodoc:
89
+ def _do_create(path, params=nil)
90
90
  response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
91
91
  if response[:customer]
92
92
  SuccessfulResult.new(:customer => Customer._new(@gateway, response[:customer]))
@@ -97,7 +97,7 @@ module Braintree
97
97
  end
98
98
  end
99
99
 
100
- def _do_update(http_verb, path, params) # :nodoc:
100
+ def _do_update(http_verb, path, params)
101
101
  response = @config.http.send(http_verb, "#{@config.base_merchant_path}#{path}", params)
102
102
  if response[:customer]
103
103
  SuccessfulResult.new(:customer => Customer._new(@gateway, response[:customer]))
@@ -108,14 +108,14 @@ module Braintree
108
108
  end
109
109
  end
110
110
 
111
- def _fetch_customers(search, ids) # :nodoc:
111
+ def _fetch_customers(search, ids)
112
112
  search.ids.in ids
113
113
  response = @config.http.post("#{@config.base_merchant_path}/customers/advanced_search", {:search => search.to_hash})
114
114
  attributes = response[:customers]
115
115
  Util.extract_attribute_as_array(attributes, :customer).map { |attrs| Customer._new(@gateway, attrs) }
116
116
  end
117
117
 
118
- def _fetch_transactions(customer_id, ids) # :nodoc:
118
+ def _fetch_transactions(customer_id, ids)
119
119
  response = @config.http.post("#{@config.base_merchant_path}/customers/#{customer_id}/transactions", :search => {:ids => ids})
120
120
  attributes = response[:credit_card_transactions]
121
121
  Util.extract_attribute_as_array(attributes, :transaction).map do |transaction_attributes|
@@ -123,7 +123,7 @@ module Braintree
123
123
  end
124
124
  end
125
125
 
126
- def self._update_signature # :nodoc:
126
+ def self._update_signature
127
127
  credit_card_signature = CreditCardGateway._update_signature - [:customer_id]
128
128
  credit_card_options = credit_card_signature.find { |item| item.respond_to?(:keys) && item.keys == [:options] }
129
129
  credit_card_options[:options] << :update_existing_token
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class CustomerSearch < AdvancedSearch # :nodoc:
2
+ class CustomerSearch < AdvancedSearch
3
3
  text_fields(
4
4
  :address_country_name,
5
5
  :address_extended_address,
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class Descriptor # :nodoc:
2
+ class Descriptor
3
3
  include BaseModule
4
4
 
5
5
  attr_reader :name
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- module Digest # :nodoc:
2
+ module Digest
3
3
  def self.hexdigest(private_key, string)
4
4
  _hmac_sha1(private_key, string)
5
5
  end
@@ -20,7 +20,7 @@ module Braintree
20
20
 
21
21
  alias_method :success?, :success
22
22
 
23
- def initialize(gateway, attributes) # :nodoc:
23
+ def initialize(gateway, attributes)
24
24
  @gateway = gateway
25
25
  set_instance_variables_from_hash(attributes)
26
26
  @amount = Util.to_big_decimal(amount)
@@ -34,10 +34,10 @@ module Braintree
34
34
  end
35
35
  end
36
36
 
37
- def inspect # :nodoc:
37
+ def inspect
38
38
  nice_attributes = self.class._inspect_attributes.map { |attr| "#{attr}: #{send(attr).inspect}" }
39
39
  nice_attributes << "amount: #{self.amount.to_s("F").inspect}"
40
- nice_attributes << "disbursement_date: #{self.disbursement_date.to_s}"
40
+ nice_attributes << "disbursement_date: #{self.disbursement_date}"
41
41
  "#<#{self.class} #{nice_attributes.join(', ')}>"
42
42
  end
43
43
 
@@ -51,12 +51,12 @@ module Braintree
51
51
 
52
52
  class << self
53
53
  protected :new
54
- def _new(*args) # :nodoc:
54
+ def _new(*args)
55
55
  self.new(*args)
56
56
  end
57
57
  end
58
58
 
59
- def self._inspect_attributes # :nodoc:
59
+ def self._inspect_attributes
60
60
  [:id, :exception_message, :follow_up_action, :merchant_account, :transaction_ids, :retry, :success]
61
61
  end
62
62
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class DiscountGateway # :nodoc
2
+ class DiscountGateway
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 Dispute
3
- class Evidence # :nodoc:
3
+ class Evidence
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :category,
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Dispute
3
- class PayPalMessage # :nodoc:
3
+ class PayPalMessage
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :message,
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Dispute
3
- class StatusHistory # :nodoc:
3
+ class StatusHistory
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :disbursement_date
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Dispute
3
- class Transaction # :nodoc:
3
+ class Transaction
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :amount
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Dispute
3
- class TransactionDetails # :nodoc:
3
+ class TransactionDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :amount
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class Dispute # :nodoc:
2
+ class Dispute
3
3
  include BaseModule
4
4
  include Braintree::Util::IdEquality
5
5
 
@@ -97,7 +97,7 @@ module Braintree
97
97
 
98
98
  class << self
99
99
  protected :new
100
- def _new(*args) # :nodoc:
100
+ def _new(*args)
101
101
  self.new(*args)
102
102
  end
103
103
  end
@@ -130,7 +130,7 @@ module Braintree
130
130
  Configuration.gateway.dispute.search(&block)
131
131
  end
132
132
 
133
- def initialize(attributes) # :nodoc:
133
+ def initialize(attributes)
134
134
  set_instance_variables_from_hash(attributes)
135
135
  @date_opened = Date.parse(date_opened) unless date_opened.nil?
136
136
  @date_won = Date.parse(date_won) unless date_won.nil?
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class DisputeGateway # :nodoc:
2
+ class DisputeGateway
3
3
  def initialize(gateway)
4
4
  @gateway = gateway
5
5
  @config = gateway.config
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class DisputeSearch < AdvancedSearch # :nodoc:
2
+ class DisputeSearch < AdvancedSearch
3
3
  text_fields(
4
4
  :case_number,
5
5
  :customer_id,
@@ -23,13 +23,13 @@ module Braintree
23
23
  Configuration.gateway.document_upload.create!(*args)
24
24
  end
25
25
 
26
- def initialize(attributes) # :nodoc:
26
+ def initialize(attributes)
27
27
  set_instance_variables_from_hash(attributes)
28
28
  end
29
29
 
30
30
  class << self
31
31
  protected :new
32
- def _new(*args) # :nodoc:
32
+ def _new(*args)
33
33
  self.new(*args)
34
34
  end
35
35
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class DocumentUploadGateway # :nodoc:
2
+ class DocumentUploadGateway
3
3
  include BaseModule
4
4
 
5
5
  def initialize(gateway)
@@ -17,14 +17,14 @@ module Braintree
17
17
  return_object_or_raise(:document_upload) { create(*args) }
18
18
  end
19
19
 
20
- def self._create_signature # :nodoc:
20
+ def self._create_signature
21
21
  [
22
22
  :kind,
23
23
  :file
24
24
  ]
25
25
  end
26
26
 
27
- def _do_create(path, params, file) # :nodoc:
27
+ def _do_create(path, params, file)
28
28
  response = @config.http.post("#{@config.base_merchant_path}#{path}", params, file)
29
29
  if response[:document_upload]
30
30
  SuccessfulResult.new(:document_upload => DocumentUpload._new(response[:document_upload]))
@@ -5,7 +5,7 @@ module Braintree
5
5
  attr_reader :fields_updated
6
6
  attr_reader :profile_data
7
7
 
8
- def initialize(attributes) # :nodoc:
8
+ def initialize(attributes)
9
9
  set_instance_variables_from_hash(attributes)
10
10
  @profile_data = VenmoProfileData._new(attributes[:profile_data])
11
11
  end
@@ -14,7 +14,7 @@ module Braintree
14
14
  protected :new
15
15
  end
16
16
 
17
- def self._new(*args) # :nodoc:
17
+ def self._new(*args)
18
18
  self.new(*args)
19
19
  end
20
20
  end
@@ -10,7 +10,7 @@ module Braintree
10
10
  attr_reader :transaction
11
11
  attr_reader :verification
12
12
 
13
- def initialize(gateway, data) # :nodoc:
13
+ def initialize(gateway, data)
14
14
  @gateway = gateway
15
15
  @params = data[:params]
16
16
  @credit_card_verification = CreditCardVerification._new(data[:verification]) if data[:verification]
@@ -22,7 +22,7 @@ module Braintree
22
22
  @errors = Errors.new(data[:errors])
23
23
  end
24
24
 
25
- def inspect # :nodoc:
25
+ def inspect
26
26
  if @credit_card_verification
27
27
  verification_inspect = " credit_card_verification: #{@credit_card_verification.inspect}"
28
28
  end
@@ -32,7 +32,6 @@ module Braintree
32
32
  "#<#{self.class} params:{...} errors:<#{@errors._inner_inspect}>#{verification_inspect}#{transaction_inspect}>"
33
33
  end
34
34
 
35
- # Always returns false.
36
35
  def success?
37
36
  false
38
37
  end
@@ -2,7 +2,7 @@ module Braintree
2
2
  class Errors
3
3
  include Enumerable
4
4
 
5
- def initialize(data = {}) # :nodoc:
5
+ def initialize(data = {})
6
6
  @errors = ValidationErrorCollection.new(data.merge(:errors => []))
7
7
  end
8
8
 
@@ -14,7 +14,7 @@ module Braintree
14
14
  @errors.for(scope)
15
15
  end
16
16
 
17
- def inspect # :nodoc:
17
+ def inspect
18
18
  "#<#{self.class} #{_inner_inspect}>"
19
19
  end
20
20
 
@@ -25,7 +25,7 @@ module Braintree
25
25
  @errors.deep_size
26
26
  end
27
27
 
28
- def _inner_inspect # :nodoc:
28
+ def _inner_inspect
29
29
  @errors._inner_inspect
30
30
  end
31
31
  end
@@ -1,5 +1,4 @@
1
- module Braintree # :nodoc:
2
- # Super class for all Braintree exceptions.
1
+ module Braintree
3
2
  class BraintreeError < ::StandardError; end
4
3
 
5
4
  class AuthenticationError < BraintreeError; end
@@ -1,8 +1,8 @@
1
1
  module Braintree
2
2
  class ExchangeRate
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
 
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class ExchangeRateQuote
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
5
  attr_reader :attrs
6
6
  attr_reader :base_amount
@@ -11,12 +11,12 @@ module Braintree
11
11
  attr_reader :refreshes_at
12
12
  attr_reader :trade_rate
13
13
 
14
- def initialize(attributes) # :nodoc:
14
+ def initialize(attributes)
15
15
  @attrs = attributes.keys
16
16
  set_instance_variables_from_hash(attributes)
17
17
  end
18
18
 
19
- def inspect # :nodoc:
19
+ def inspect
20
20
  inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" }
21
21
  "#<#{self.class} #{inspected_attributes.join(" ")}>"
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class ExchangeRateQuoteGateway # :nodoc
2
+ class ExchangeRateQuoteGateway
3
3
  def initialize(gateway)
4
4
  @gateway = gateway
5
5
  end
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class ExchangeRateQuoteInput
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
5
  attr_reader :attrs
6
6
  attr_reader :base_currency
@@ -8,12 +8,12 @@ module Braintree
8
8
  attr_reader :markup
9
9
  attr_reader :quote_currency
10
10
 
11
- def initialize(attributes) # :nodoc:
11
+ def initialize(attributes)
12
12
  @attrs = attributes.keys
13
13
  set_instance_variables_from_hash(attributes)
14
14
  end
15
15
 
16
- def inspect # :nodoc:
16
+ def inspect
17
17
  inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" }
18
18
  "#<#{self.class} #{inspected_attributes.join(" ")}>"
19
19
  end
@@ -1,16 +1,16 @@
1
1
  module Braintree
2
2
  class ExchangeRateQuoteRequest
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
5
  attr_reader :quotes
6
6
 
7
- def initialize(attributes) # :nodoc:
7
+ def initialize(attributes)
8
8
  @attrs = attributes.keys
9
9
  set_instance_variables_from_hash(attributes)
10
10
  @quotes = (@quotes || []).map { |quote_hash| ExchangeRateQuoteInput.new(quote_hash) }
11
11
  end
12
12
 
13
- def inspect # :nodoc:
13
+ def inspect
14
14
  inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" }
15
15
  "#<#{self.class} #{inspected_attributes.join(" ")}>"
16
16
  end
@@ -1,16 +1,16 @@
1
1
  module Braintree
2
2
  class ExchangeRateQuoteResponse
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
5
  attr_reader :quotes
6
6
 
7
- def initialize(attributes) # :nodoc:
7
+ def initialize(attributes)
8
8
  @attrs = attributes.keys
9
9
  set_instance_variables_from_hash(attributes)
10
10
  @quotes = (@quotes || []).map { |quote_hash| ExchangeRateQuote.new(quote_hash) }
11
11
  end
12
12
 
13
- def inspect # :nodoc:
13
+ def inspect
14
14
  inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" }
15
15
  "#<#{self.class} #{inspected_attributes.join(" ")}>"
16
16
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class FacilitatedDetails # :nodoc:
2
+ class FacilitatedDetails
3
3
  include BaseModule
4
4
 
5
5
  attr_reader :merchant_id
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class FacilitatorDetails # :nodoc:
2
+ class FacilitatorDetails
3
3
  include BaseModule
4
4
 
5
5
  attr_reader :oauth_application_client_id
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class GooglePayCard
3
- include BaseModule # :nodoc:
3
+ include BaseModule
4
4
 
5
5
  attr_reader :bin
6
6
  attr_reader :commercial
@@ -28,7 +28,7 @@ module Braintree
28
28
  attr_reader :virtual_card_last_4
29
29
  attr_reader :virtual_card_type
30
30
 
31
- def initialize(gateway, attributes) # :nodoc:
31
+ def initialize(gateway, attributes)
32
32
  @gateway = gateway
33
33
  set_instance_variables_from_hash(attributes)
34
34
  @subscriptions = (@subscriptions || []).map { |subscription_hash| Subscription._new(@gateway, subscription_hash) }
@@ -54,7 +54,7 @@ module Braintree
54
54
  protected :new
55
55
  end
56
56
 
57
- def self._new(*args) # :nodoc:
57
+ def self._new(*args)
58
58
  self.new(*args)
59
59
  end
60
60
  end
@@ -15,7 +15,7 @@ module Braintree
15
15
 
16
16
  class << self
17
17
  protected :new
18
- def _new(*args) # :nodoc:
18
+ def _new(*args)
19
19
  self.new(*args)
20
20
  end
21
21
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class GraphQLClient < Http # :nodoc:
2
+ class GraphQLClient < Http
3
3
 
4
4
  def initialize(config)
5
5
  @config = config
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class Http # :nodoc:
2
+ class Http
3
3
 
4
4
  LINE_FEED = "\r\n"
5
5
 
@@ -7,8 +7,8 @@ module Braintree
7
7
  @config = config
8
8
  end
9
9
 
10
- def delete(_path, query_params = {})
11
- path = _path + _build_query_string(query_params)
10
+ def delete(path, query_params = {})
11
+ full_path = path + _build_query_string(query_params)
12
12
  response = _http_do Net::HTTP::Delete, path
13
13
  if response.code.to_i == 200 || response.code.to_i == 204
14
14
  true
@@ -19,8 +19,8 @@ module Braintree
19
19
  end
20
20
  end
21
21
 
22
- def get(_path, query_params = {})
23
- path = _path + _build_query_string(query_params)
22
+ def get(path, query_params = {})
23
+ full_path = path + _build_query_string(query_params)
24
24
  response = _http_do Net::HTTP::Get, path
25
25
  if response.code.to_i == 200 || response.code.to_i == 422
26
26
  Xml.hash_from_xml(_body(response))