braintree 4.15.0 → 4.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) 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_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 +8 -7
  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 +3 -0
  97. data/lib/braintree/test/transaction_amounts.rb +2 -3
  98. data/lib/braintree/testing_gateway.rb +1 -1
  99. data/lib/braintree/three_d_secure_info.rb +1 -1
  100. data/lib/braintree/transaction/address_details.rb +2 -1
  101. data/lib/braintree/transaction/credit_card_details.rb +1 -1
  102. data/lib/braintree/transaction/customer_details.rb +1 -1
  103. data/lib/braintree/transaction/disbursement_details.rb +1 -1
  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/package_details.rb +16 -0
  107. data/lib/braintree/transaction/samsung_pay_card_details.rb +1 -1
  108. data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +1 -1
  109. data/lib/braintree/transaction/status_details.rb +1 -1
  110. data/lib/braintree/transaction/subscription_details.rb +1 -1
  111. data/lib/braintree/transaction/us_bank_account_details.rb +1 -1
  112. data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
  113. data/lib/braintree/transaction.rb +32 -16
  114. data/lib/braintree/transaction_gateway.rb +30 -13
  115. data/lib/braintree/transaction_line_item.rb +13 -10
  116. data/lib/braintree/transaction_line_item_gateway.rb +1 -1
  117. data/lib/braintree/transaction_review.rb +1 -1
  118. data/lib/braintree/transaction_search.rb +1 -1
  119. data/lib/braintree/unknown_payment_method.rb +1 -1
  120. data/lib/braintree/us_bank_account.rb +2 -2
  121. data/lib/braintree/us_bank_account_verification.rb +23 -15
  122. data/lib/braintree/us_bank_account_verification_search.rb +1 -1
  123. data/lib/braintree/util.rb +3 -3
  124. data/lib/braintree/validation_error.rb +1 -1
  125. data/lib/braintree/validation_error_collection.rb +3 -3
  126. data/lib/braintree/venmo_account.rb +3 -3
  127. data/lib/braintree/venmo_profile_data.rb +6 -4
  128. data/lib/braintree/version.rb +1 -1
  129. data/lib/braintree/visa_checkout_card.rb +7 -7
  130. data/lib/braintree/webhook_notification.rb +2 -2
  131. data/lib/braintree/webhook_notification_gateway.rb +4 -4
  132. data/lib/braintree/webhook_testing.rb +1 -1
  133. data/lib/braintree/webhook_testing_gateway.rb +1 -1
  134. data/lib/braintree/xml/generator.rb +1 -1
  135. data/lib/braintree/xml/libxml.rb +1 -1
  136. data/lib/braintree/xml/parser.rb +3 -3
  137. data/lib/braintree/xml/rexml.rb +2 -2
  138. data/lib/braintree/xml.rb +1 -1
  139. data/lib/braintree.rb +5 -1
  140. data/spec/integration/braintree/client_api/spec_helper.rb +2 -2
  141. data/spec/integration/braintree/credit_card_spec.rb +4 -5
  142. data/spec/integration/braintree/credit_card_verification_spec.rb +46 -1
  143. data/spec/integration/braintree/customer_spec.rb +4 -4
  144. data/spec/integration/braintree/dispute_search_spec.rb +0 -1
  145. data/spec/integration/braintree/package_tracking_spec.rb +111 -0
  146. data/spec/integration/braintree/payment_method_nonce_spec.rb +20 -0
  147. data/spec/integration/braintree/payment_method_spec.rb +2 -2
  148. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +72 -0
  149. data/spec/integration/braintree/transaction_line_item_spec.rb +6 -0
  150. data/spec/integration/braintree/transaction_search_spec.rb +27 -0
  151. data/spec/integration/braintree/transaction_spec.rb +299 -89
  152. data/spec/unit/braintree/base_module_spec.rb +1 -1
  153. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +13 -8
  154. data/spec/unit/braintree/enriched_customer_data_spec.rb +9 -0
  155. data/spec/unit/braintree/http_spec.rb +1 -1
  156. data/spec/unit/braintree/meta_checkout_card_details_spec.rb +60 -0
  157. data/spec/unit/braintree/meta_checkout_card_spec.rb +60 -0
  158. data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
  159. data/spec/unit/braintree/meta_checkout_token_spec.rb +63 -0
  160. data/spec/unit/braintree/package_tracking_spec.rb +74 -0
  161. data/spec/unit/braintree/transaction_gateway_spec.rb +32 -3
  162. data/spec/unit/braintree/us_bank_account_verification_spec.rb +5 -0
  163. data/spec/unit/braintree/venmo_profile_data_spec.rb +11 -0
  164. metadata +13 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71fab9e9404ac3f2c30216aca3642baecbd01c942a25c16c70b6748563f32435
4
- data.tar.gz: b8900d8aa7aac3716db035478510532bb82edd40ba599626d7cbe770fa939849
3
+ metadata.gz: b8d5039746bfcbc33e3899cb43cf5a014084278543b5c83ea0b09146a0c0b63b
4
+ data.tar.gz: 688a569cbff984a1d6a0571095a7f990efda7ce717ee9393c93263f8b9007f80
5
5
  SHA512:
6
- metadata.gz: 9470b1e652814a7ae2fda1250b2c9f670069f1ef98a601ce2a382a4e3430017eaeaeaf7dabe4bc1b456c755d1b0fb258b06fc0593432d2b35c2ce9fc02671d5a
7
- data.tar.gz: e376876f7c6ae2c5a1ce588c847d3494e828b29c4f2aee273d5e2c97348577db364b4bcc48ba0588074d87644a39f771b45c7eb56e7865be1cec730a76e72162
6
+ metadata.gz: df005acb10a67bdcf42ab131f49b93f595ad9431004922502b255c54d4222960e54a344a018abd0175c3b340d8474215a1f49b0a210b590fbe78fe020bf7daf1
7
+ data.tar.gz: 783676045da0d1240f5b9cd808149f04fd9a7005c99015ff5ec07ff0a0ffcf4093e1e0ab896334f2e7e0f953829a62b8532130a3057bef5c344d506c58064d67
@@ -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
@@ -25,6 +25,7 @@ module Braintree
25
25
 
26
26
  module DebitNetwork
27
27
  Accel = "ACCEL"
28
+ Maestro = "MAESTRO"
28
29
  Nyce = "NYCE"
29
30
  Pulse = "PULSE"
30
31
  Star = "STAR"
@@ -124,7 +125,7 @@ module Braintree
124
125
  Configuration.gateway.credit_card.update!(*args)
125
126
  end
126
127
 
127
- def initialize(gateway, attributes) # :nodoc:
128
+ def initialize(gateway, attributes)
128
129
  @gateway = gateway
129
130
  set_instance_variables_from_hash(attributes)
130
131
  @billing_address = attributes[:billing_address] ? Address._new(@gateway, attributes[:billing_address]) : nil
@@ -133,11 +134,10 @@ module Braintree
133
134
  end
134
135
 
135
136
  def _most_recent_verification(attributes)
136
- verification = (attributes[:verifications] || []).sort_by { |verification| verification[:created_at] }.reverse.first
137
- 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
138
139
  end
139
140
 
140
- # Returns true if this credit card is the customer's default payment method.
141
141
  def default?
142
142
  @default
143
143
  end
@@ -147,12 +147,11 @@ module Braintree
147
147
  "#{expiration_month}/#{expiration_year}"
148
148
  end
149
149
 
150
- # Returns true if the credit card is expired.
151
150
  def expired?
152
151
  @expired
153
152
  end
154
153
 
155
- def inspect # :nodoc:
154
+ def inspect
156
155
  first = [:token]
157
156
  order = first + (self.class._attributes - first)
158
157
  nice_attributes = order.map do |attr|
@@ -169,6 +168,7 @@ module Braintree
169
168
  @nonce ||= PaymentMethodNonce.create(token)
170
169
  end
171
170
 
171
+ # NEXT_MAJOR_VERSION can this be removed? Venmo SDK integration is no more
172
172
  # Returns true if the card is associated with Venmo SDK
173
173
  # NEXT_MAJOR_VERSION Remove this method
174
174
  # The old venmo SDK class has been deprecated
@@ -185,7 +185,7 @@ module Braintree
185
185
  protected :new
186
186
  end
187
187
 
188
- def self._attributes # :nodoc:
188
+ def self._attributes
189
189
  [
190
190
  :billing_address, :bin, :card_type, :cardholder_name, :created_at, :customer_id, :expiration_month,
191
191
  :expiration_year, :last_4, :token, :updated_at, :prepaid, :payroll, :product_id, :commercial, :debit, :durbin_regulated,
@@ -193,7 +193,7 @@ module Braintree
193
193
  ]
194
194
  end
195
195
 
196
- def self._new(*args) # :nodoc:
196
+ def self._new(*args)
197
197
  self.new(*args)
198
198
  end
199
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)
@@ -77,15 +77,15 @@ module Braintree
77
77
  return_object_or_raise(:credit_card) { update(*args) }
78
78
  end
79
79
 
80
- def self._create_signature # :nodoc:
80
+ def self._create_signature
81
81
  _signature(:create)
82
82
  end
83
83
 
84
- def self._update_signature # :nodoc:
84
+ def self._update_signature
85
85
  _signature(:update)
86
86
  end
87
87
 
88
- def self._signature(type) # :nodoc:
88
+ def self._signature(type)
89
89
  billing_address_params = AddressGateway._shared_signature
90
90
  # NEXT_MAJOR_VERSION Remove venmo_sdk_session
91
91
  # The old venmo SDK class has been deprecated
@@ -136,7 +136,7 @@ module Braintree
136
136
  return signature
137
137
  end
138
138
 
139
- def _do_create(path, params=nil) # :nodoc:
139
+ def _do_create(path, params=nil)
140
140
  response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
141
141
  if response[:credit_card]
142
142
  SuccessfulResult.new(:credit_card => CreditCard._new(@gateway, response[:credit_card]))
@@ -147,7 +147,7 @@ module Braintree
147
147
  end
148
148
  end
149
149
 
150
- def _do_update(http_verb, path, params) # :nodoc:
150
+ def _do_update(http_verb, path, params)
151
151
  response = @config.http.send(http_verb, "#{@config.base_merchant_path}#{path}", params)
152
152
  if response[:credit_card]
153
153
  SuccessfulResult.new(:credit_card => CreditCard._new(@gateway, response[:credit_card]))
@@ -158,13 +158,13 @@ module Braintree
158
158
  end
159
159
  end
160
160
 
161
- def _fetch_expired(ids) # :nodoc:
161
+ def _fetch_expired(ids)
162
162
  response = @config.http.post("#{@config.base_merchant_path}/payment_methods/all/expired", :search => {:ids => ids})
163
163
  attributes = response[:payment_methods]
164
164
  Util.extract_attribute_as_array(attributes, :credit_card).map { |attrs| CreditCard._new(@gateway, attrs) }
165
165
  end
166
166
 
167
- def _fetch_expiring_between(formatted_start_date, formatted_end_date, ids) # :nodoc:
167
+ def _fetch_expiring_between(formatted_start_date, formatted_end_date, ids)
168
168
  response = @config.http.post(
169
169
  "#{@config.base_merchant_path}/payment_methods/all/expiring?start=#{formatted_start_date}&end=#{formatted_end_date}",
170
170
  :search => {:ids => ids},
@@ -48,7 +48,7 @@ module Braintree
48
48
  attr_reader :three_d_secure_info
49
49
  attr_reader :status
50
50
 
51
- def initialize(attributes) # :nodoc:
51
+ def initialize(attributes)
52
52
  set_instance_variables_from_hash(attributes)
53
53
 
54
54
  @amount = Util.to_big_decimal(amount)
@@ -57,7 +57,7 @@ module Braintree
57
57
  @three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
58
58
  end
59
59
 
60
- def inspect # :nodoc:
60
+ def inspect
61
61
  attr_order = [
62
62
  :status,
63
63
  :processor_response_code,
@@ -91,7 +91,7 @@ module Braintree
91
91
  protected :new
92
92
  end
93
93
 
94
- def self._new(*args) # :nodoc:
94
+ def self._new(*args)
95
95
  self.new(*args)
96
96
  end
97
97