braintree 3.2.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/braintree.gemspec +3 -3
- data/lib/braintree.rb +6 -1
- data/lib/braintree/account_updater_daily_report.rb +1 -1
- data/lib/braintree/address.rb +2 -1
- data/lib/braintree/apple_pay.rb +1 -1
- data/lib/braintree/apple_pay_card.rb +1 -1
- data/lib/braintree/apple_pay_options.rb +1 -1
- data/lib/braintree/authorization_adjustment.rb +1 -1
- data/lib/braintree/client_token.rb +1 -1
- data/lib/braintree/configuration.rb +11 -11
- data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
- data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
- data/lib/braintree/credit_card.rb +2 -2
- data/lib/braintree/credit_card_gateway.rb +14 -4
- data/lib/braintree/credit_card_verification.rb +5 -5
- data/lib/braintree/credit_card_verification_search.rb +1 -1
- data/lib/braintree/customer.rb +6 -4
- data/lib/braintree/customer_gateway.rb +2 -0
- data/lib/braintree/customer_search.rb +1 -1
- data/lib/braintree/disbursement.rb +1 -1
- data/lib/braintree/dispute.rb +15 -1
- data/lib/braintree/dispute/paypal_message.rb +15 -0
- data/lib/braintree/dispute_gateway.rb +2 -2
- data/lib/braintree/dispute_search.rb +3 -2
- data/lib/braintree/document_upload.rb +1 -1
- data/lib/braintree/error_codes.rb +10 -6
- data/lib/braintree/google_pay_card.rb +1 -1
- data/lib/braintree/granted_payment_instrument_update.rb +1 -1
- data/lib/braintree/graphql_client.rb +7 -7
- data/lib/braintree/http.rb +3 -3
- data/lib/braintree/local_payment_completed.rb +1 -1
- data/lib/braintree/local_payment_reversed.rb +19 -0
- data/lib/braintree/merchant.rb +1 -1
- data/lib/braintree/merchant_account.rb +1 -1
- data/lib/braintree/merchant_account_gateway.rb +1 -1
- data/lib/braintree/merchant_gateway.rb +1 -1
- data/lib/braintree/modification.rb +1 -1
- data/lib/braintree/oauth_credentials.rb +1 -1
- data/lib/braintree/oauth_gateway.rb +5 -5
- data/lib/braintree/payment_instrument_type.rb +10 -10
- data/lib/braintree/payment_method_gateway.rb +10 -7
- data/lib/braintree/payment_method_nonce.rb +7 -4
- data/lib/braintree/payment_method_nonce_details.rb +37 -0
- data/lib/braintree/payment_method_nonce_details_payer_info.rb +32 -0
- data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
- data/lib/braintree/plan.rb +1 -1
- data/lib/braintree/processor_response_types.rb +3 -3
- data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
- data/lib/braintree/risk_data.rb +3 -1
- data/lib/braintree/samsung_pay_card.rb +1 -1
- data/lib/braintree/settlement_batch_summary.rb +2 -2
- data/lib/braintree/subscription.rb +6 -6
- data/lib/braintree/three_d_secure_info.rb +22 -12
- data/lib/braintree/transaction.rb +32 -24
- data/lib/braintree/transaction_gateway.rb +24 -5
- data/lib/braintree/transaction_line_item.rb +1 -1
- data/lib/braintree/transaction_search.rb +3 -1
- data/lib/braintree/unknown_payment_method.rb +1 -1
- data/lib/braintree/us_bank_account.rb +3 -3
- data/lib/braintree/us_bank_account_verification.rb +1 -1
- data/lib/braintree/us_bank_account_verification_gateway.rb +1 -1
- data/lib/braintree/util.rb +4 -4
- data/lib/braintree/venmo_account.rb +1 -1
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/visa_checkout_card.rb +2 -2
- data/lib/braintree/webhook_notification.rb +30 -20
- data/lib/braintree/webhook_notification_gateway.rb +5 -5
- data/lib/braintree/webhook_testing_gateway.rb +30 -0
- data/lib/braintree/xml/generator.rb +5 -4
- data/lib/braintree/xml/libxml.rb +0 -1
- data/lib/braintree/xml/parser.rb +22 -12
- data/lib/braintree/xml/rexml.rb +70 -0
- data/spec/integration/braintree/add_on_spec.rb +1 -1
- data/spec/integration/braintree/address_spec.rb +28 -24
- data/spec/integration/braintree/advanced_search_spec.rb +45 -45
- data/spec/integration/braintree/apple_pay_spec.rb +3 -3
- data/spec/integration/braintree/braintree_gateway_spec.rb +2 -1
- data/spec/integration/braintree/client_api/client_token_spec.rb +14 -14
- data/spec/integration/braintree/client_api/spec_helper.rb +5 -5
- data/spec/integration/braintree/credit_card_spec.rb +213 -122
- data/spec/integration/braintree/credit_card_verification_search_spec.rb +2 -2
- data/spec/integration/braintree/credit_card_verification_spec.rb +1 -1
- data/spec/integration/braintree/customer_search_spec.rb +8 -8
- data/spec/integration/braintree/customer_spec.rb +282 -165
- data/spec/integration/braintree/dispute_search_spec.rb +28 -3
- data/spec/integration/braintree/dispute_spec.rb +6 -6
- data/spec/integration/braintree/error_codes_spec.rb +1 -1
- data/spec/integration/braintree/http_spec.rb +2 -2
- data/spec/integration/braintree/merchant_account_spec.rb +25 -26
- data/spec/integration/braintree/merchant_spec.rb +14 -14
- data/spec/integration/braintree/oauth_spec.rb +11 -11
- data/spec/integration/braintree/payment_method_nonce_spec.rb +28 -35
- data/spec/integration/braintree/payment_method_spec.rb +269 -165
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +9 -9
- data/spec/integration/braintree/paypal_account_spec.rb +28 -28
- data/spec/integration/braintree/samsung_pay_card_spec.rb +9 -9
- data/spec/integration/braintree/settlement_batch_summary_spec.rb +8 -8
- data/spec/integration/braintree/subscription_spec.rb +133 -133
- data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
- data/spec/integration/braintree/test_transaction_spec.rb +10 -10
- data/spec/integration/braintree/transaction_search_spec.rb +93 -67
- data/spec/integration/braintree/transaction_spec.rb +574 -360
- data/spec/integration/braintree/transaction_us_bank_account_spec.rb +20 -20
- data/spec/integration/braintree/us_bank_account_spec.rb +6 -6
- data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +7 -7
- data/spec/integration/braintree/us_bank_account_verification_spec.rb +8 -8
- data/spec/integration/braintree/visa_checkout_card_spec.rb +5 -5
- data/spec/integration/spec_helper.rb +9 -3
- data/spec/oauth_test_helper.rb +1 -1
- data/spec/script/httpsd.rb +6 -6
- data/spec/spec_helper.rb +6 -3
- data/spec/unit/braintree/address_spec.rb +1 -1
- data/spec/unit/braintree/apple_pay_card_spec.rb +1 -1
- data/spec/unit/braintree/client_token_spec.rb +2 -2
- data/spec/unit/braintree/configuration_spec.rb +42 -42
- data/spec/unit/braintree/credit_card_spec.rb +13 -13
- data/spec/unit/braintree/credit_card_verification_search_spec.rb +1 -1
- data/spec/unit/braintree/credit_card_verification_spec.rb +8 -4
- data/spec/unit/braintree/customer_spec.rb +20 -10
- data/spec/unit/braintree/disbursement_spec.rb +7 -7
- data/spec/unit/braintree/dispute_search_spec.rb +1 -0
- data/spec/unit/braintree/dispute_spec.rb +34 -9
- data/spec/unit/braintree/error_result_spec.rb +5 -5
- data/spec/unit/braintree/errors_spec.rb +8 -8
- data/spec/unit/braintree/http_spec.rb +5 -5
- data/spec/unit/braintree/merchant_account_spec.rb +1 -1
- data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +31 -0
- data/spec/unit/braintree/payment_method_nonce_details_spec.rb +43 -0
- data/spec/unit/braintree/payment_method_nonce_spec.rb +40 -0
- data/spec/unit/braintree/payment_method_spec.rb +1 -1
- data/spec/unit/braintree/paypal_account_spec.rb +2 -2
- data/spec/unit/braintree/resource_collection_spec.rb +9 -9
- data/spec/unit/braintree/risk_data_spec.rb +9 -5
- data/spec/unit/braintree/subscription_search_spec.rb +1 -1
- data/spec/unit/braintree/successful_result_spec.rb +1 -1
- data/spec/unit/braintree/three_d_secure_info_spec.rb +32 -14
- data/spec/unit/braintree/transaction/credit_card_details_spec.rb +3 -3
- data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
- data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +1 -1
- data/spec/unit/braintree/transaction_search_spec.rb +12 -12
- data/spec/unit/braintree/transaction_spec.rb +25 -17
- data/spec/unit/braintree/util_spec.rb +18 -18
- data/spec/unit/braintree/validation_error_collection_spec.rb +36 -36
- data/spec/unit/braintree/webhook_notification_spec.rb +88 -56
- data/spec/unit/braintree/xml/rexml_spec.rb +51 -0
- data/spec/unit/braintree/xml_spec.rb +31 -31
- metadata +16 -8
- data/lib/braintree/settlement_batch.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b9382c924f47002feeb68618490bcaa17da29666dff9917252a54141b30a6f7
|
4
|
+
data.tar.gz: 2744c9e6e6835a1213a89e35ce170efd74cf8bdab1b6b8d7f3c1a61bcc359b35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d478c728fccb782500075966a9967918b2728b60925cf9e294da7447991c91a5898dfb1bdd46040f91f7a0c51f17fe8a795205adbbc1de97e6741c2cb18727e7
|
7
|
+
data.tar.gz: fa5d2f84f33dd66a5049b99f4ea201cfb9787ce3686e6ef56921e9b3d3b25f080eac81b34ad042daa2445bc6090a33b3714d171a221d811a5858a8cd89bbf8d6
|
data/braintree.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
$:.push File.expand_path("../lib", __FILE__)
|
2
|
-
require
|
2
|
+
require "braintree/version"
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "braintree"
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.homepage = "https://www.braintreepayments.com/"
|
13
13
|
s.files = Dir.glob ["README.rdoc", "LICENSE", "lib/**/*.{rb,crt}", "spec/**/*", "*.gemspec"]
|
14
14
|
s.add_dependency "builder", ">= 3.2.4"
|
15
|
-
s.add_dependency "
|
16
|
-
s.required_ruby_version = ">=2.
|
15
|
+
s.add_dependency "rexml", ">= 3.1.9" # Use rexml version associated with minimum supported Ruby version
|
16
|
+
s.required_ruby_version = ">=2.6.0"
|
17
17
|
s.metadata = {
|
18
18
|
"bug_tracker_uri" => "https://github.com/braintree/braintree_ruby/issues",
|
19
19
|
"changelog_uri" => "https://github.com/braintree/braintree_ruby/blob/master/CHANGELOG.md",
|
data/lib/braintree.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "base64"
|
2
2
|
require "bigdecimal"
|
3
3
|
require "cgi"
|
4
4
|
require "date"
|
@@ -59,6 +59,7 @@ require "braintree/discount_gateway"
|
|
59
59
|
require "braintree/dispute"
|
60
60
|
require "braintree/dispute_gateway"
|
61
61
|
require "braintree/dispute/evidence"
|
62
|
+
require "braintree/dispute/paypal_message"
|
62
63
|
require "braintree/dispute/status_history"
|
63
64
|
require "braintree/dispute/transaction"
|
64
65
|
require "braintree/dispute/transaction_details"
|
@@ -71,6 +72,7 @@ require "braintree/gateway"
|
|
71
72
|
require "braintree/graphql_client"
|
72
73
|
require "braintree/google_pay_card"
|
73
74
|
require "braintree/local_payment_completed"
|
75
|
+
require "braintree/local_payment_reversed"
|
74
76
|
require "braintree/transaction/local_payment_details"
|
75
77
|
require "braintree/merchant"
|
76
78
|
require "braintree/merchant_gateway"
|
@@ -86,6 +88,8 @@ require "braintree/payment_instrument_type"
|
|
86
88
|
require "braintree/payment_method"
|
87
89
|
require "braintree/payment_method_gateway"
|
88
90
|
require "braintree/payment_method_nonce"
|
91
|
+
require "braintree/payment_method_nonce_details"
|
92
|
+
require "braintree/payment_method_nonce_details_payer_info"
|
89
93
|
require "braintree/payment_method_nonce_gateway"
|
90
94
|
require "braintree/payment_method_parser"
|
91
95
|
require "braintree/paypal_account"
|
@@ -159,4 +163,5 @@ require "braintree/webhook_testing_gateway"
|
|
159
163
|
require "braintree/xml"
|
160
164
|
require "braintree/xml/generator"
|
161
165
|
require "braintree/xml/libxml"
|
166
|
+
require "braintree/xml/rexml"
|
162
167
|
require "braintree/xml/parser"
|
data/lib/braintree/address.rb
CHANGED
@@ -14,6 +14,7 @@ module Braintree
|
|
14
14
|
attr_reader :id
|
15
15
|
attr_reader :last_name
|
16
16
|
attr_reader :locality
|
17
|
+
attr_reader :phone_number
|
17
18
|
attr_reader :postal_code
|
18
19
|
attr_reader :region
|
19
20
|
attr_reader :street_address
|
@@ -58,7 +59,7 @@ module Braintree
|
|
58
59
|
end
|
59
60
|
|
60
61
|
def self._new(*args) # :nodoc:
|
61
|
-
self.new
|
62
|
+
self.new(*args)
|
62
63
|
end
|
63
64
|
end
|
64
65
|
end
|
data/lib/braintree/apple_pay.rb
CHANGED
@@ -40,12 +40,12 @@ module Braintree
|
|
40
40
|
]
|
41
41
|
|
42
42
|
class << self
|
43
|
-
attr_writer
|
44
|
-
attr_reader
|
43
|
+
attr_writer(*WRITABLE_ATTRIBUTES)
|
44
|
+
attr_reader(*NON_REQUIRED_READABLE_ATTRIBUTES)
|
45
45
|
end
|
46
|
-
attr_reader
|
47
|
-
attr_reader
|
48
|
-
attr_writer
|
46
|
+
attr_reader(*READABLE_ATTRIBUTES)
|
47
|
+
attr_reader(*NON_REQUIRED_READABLE_ATTRIBUTES)
|
48
|
+
attr_writer(*WRITABLE_ATTRIBUTES)
|
49
49
|
|
50
50
|
def self.expectant_reader(*attributes) # :nodoc:
|
51
51
|
attributes.each do |attribute|
|
@@ -56,7 +56,7 @@ module Braintree
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
59
|
-
expectant_reader
|
59
|
+
expectant_reader(*READABLE_ATTRIBUTES)
|
60
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)
|
@@ -86,7 +86,7 @@ module Braintree
|
|
86
86
|
:proxy_port => proxy_port,
|
87
87
|
:proxy_user => proxy_user,
|
88
88
|
:proxy_pass => proxy_pass,
|
89
|
-
:ssl_version => ssl_version
|
89
|
+
:ssl_version => ssl_version,
|
90
90
|
)
|
91
91
|
end
|
92
92
|
|
@@ -205,7 +205,7 @@ module Braintree
|
|
205
205
|
def port # :nodoc:
|
206
206
|
case @environment
|
207
207
|
when :development, :integration
|
208
|
-
ENV[
|
208
|
+
ENV["GATEWAY_PORT"] || 3000
|
209
209
|
when :production, :qa, :sandbox
|
210
210
|
443
|
211
211
|
end
|
@@ -214,7 +214,7 @@ module Braintree
|
|
214
214
|
def graphql_port # :nodoc:
|
215
215
|
case @environment
|
216
216
|
when :development, :integration
|
217
|
-
ENV[
|
217
|
+
ENV["GRAPHQL_PORT"] || 8080
|
218
218
|
when :production, :qa, :sandbox
|
219
219
|
443
|
220
220
|
end
|
@@ -235,7 +235,7 @@ module Braintree
|
|
235
235
|
def server # :nodoc:
|
236
236
|
case @environment
|
237
237
|
when :development, :integration
|
238
|
-
ENV[
|
238
|
+
ENV["GATEWAY_HOST"] || "localhost"
|
239
239
|
when :production
|
240
240
|
"#{endpoint}.braintreegateway.com"
|
241
241
|
when :qa
|
@@ -248,7 +248,7 @@ module Braintree
|
|
248
248
|
def graphql_server # :nodoc:
|
249
249
|
case @environment
|
250
250
|
when :development, :integration
|
251
|
-
ENV[
|
251
|
+
ENV["GRAPHQL_HOST"] || "graphql.bt.local"
|
252
252
|
when :production
|
253
253
|
"payments.braintree-api.com"
|
254
254
|
when :qa
|
@@ -123,7 +123,7 @@ module Braintree
|
|
123
123
|
end
|
124
124
|
|
125
125
|
def _most_recent_verification(attributes)
|
126
|
-
verification = (attributes[:verifications] || []).sort_by{ |verification| verification[:created_at] }.reverse.first
|
126
|
+
verification = (attributes[:verifications] || []).sort_by { |verification| verification[:created_at] }.reverse.first
|
127
127
|
CreditCardVerification._new(verification) if verification
|
128
128
|
end
|
129
129
|
|
@@ -181,7 +181,7 @@ module Braintree
|
|
181
181
|
end
|
182
182
|
|
183
183
|
def self._new(*args) # :nodoc:
|
184
|
-
self.new
|
184
|
+
self.new(*args)
|
185
185
|
end
|
186
186
|
end
|
187
187
|
end
|
@@ -38,8 +38,8 @@ module Braintree
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def expiring_between(start_date, end_date, options = {})
|
41
|
-
formatted_start_date = start_date.strftime(
|
42
|
-
formatted_end_date = end_date.strftime(
|
41
|
+
formatted_start_date = start_date.strftime("%m%Y")
|
42
|
+
formatted_end_date = end_date.strftime("%m%Y")
|
43
43
|
response = @config.http.post("#{@config.base_merchant_path}/payment_methods/all/expiring_ids?start=#{formatted_start_date}&end=#{formatted_end_date}")
|
44
44
|
ResourceCollection.new(response) { |ids| _fetch_expiring_between(formatted_start_date, formatted_end_date, ids) }
|
45
45
|
end
|
@@ -79,7 +79,17 @@ module Braintree
|
|
79
79
|
|
80
80
|
def self._signature(type) # :nodoc:
|
81
81
|
billing_address_params = AddressGateway._shared_signature
|
82
|
-
options = [
|
82
|
+
options = [
|
83
|
+
:fail_on_duplicate_payment_method,
|
84
|
+
:make_default,
|
85
|
+
:skip_advanced_fraud_checking,
|
86
|
+
:venmo_sdk_session,
|
87
|
+
:verification_account_type,
|
88
|
+
:verification_amount,
|
89
|
+
:verification_currency_iso_code,
|
90
|
+
:verification_merchant_account_id,
|
91
|
+
:verify_card
|
92
|
+
]
|
83
93
|
signature = [
|
84
94
|
:billing_address_id, :cardholder_name, :cvv, :expiration_date, :expiration_month,
|
85
95
|
:expiration_year, :number, :token, :venmo_sdk_payment_method_code, :device_data,
|
@@ -145,7 +155,7 @@ module Braintree
|
|
145
155
|
def _fetch_expiring_between(formatted_start_date, formatted_end_date, ids) # :nodoc:
|
146
156
|
response = @config.http.post(
|
147
157
|
"#{@config.base_merchant_path}/payment_methods/all/expiring?start=#{formatted_start_date}&end=#{formatted_end_date}",
|
148
|
-
:search => {:ids => ids}
|
158
|
+
:search => {:ids => ids},
|
149
159
|
)
|
150
160
|
attributes = response[:payment_methods]
|
151
161
|
Util.extract_attribute_as_array(attributes, :credit_card).map { |attrs| CreditCard._new(@gateway, attrs) }
|
@@ -17,10 +17,10 @@ module Braintree
|
|
17
17
|
end
|
18
18
|
|
19
19
|
module Status
|
20
|
-
Failed =
|
21
|
-
GatewayRejected =
|
22
|
-
ProcessorDeclined =
|
23
|
-
Verified =
|
20
|
+
Failed = "failed"
|
21
|
+
GatewayRejected = "gateway_rejected"
|
22
|
+
ProcessorDeclined = "processor_declined"
|
23
|
+
Verified = "verified"
|
24
24
|
|
25
25
|
All = [Failed, GatewayRejected, ProcessorDeclined, Verified]
|
26
26
|
end
|
@@ -92,7 +92,7 @@ module Braintree
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def self._new(*args) # :nodoc:
|
95
|
-
self.new
|
95
|
+
self.new(*args)
|
96
96
|
end
|
97
97
|
|
98
98
|
def self.find(*args)
|
data/lib/braintree/customer.rb
CHANGED
@@ -19,6 +19,7 @@ module Braintree
|
|
19
19
|
attr_reader :paypal_accounts
|
20
20
|
attr_reader :phone
|
21
21
|
attr_reader :samsung_pay_cards
|
22
|
+
attr_reader :tax_identifiers
|
22
23
|
attr_reader :updated_at
|
23
24
|
attr_reader :us_bank_accounts
|
24
25
|
attr_reader :venmo_accounts
|
@@ -42,7 +43,7 @@ module Braintree
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def self.credit!(customer_id, transaction_attributes)
|
45
|
-
return_object_or_raise(:transaction){ credit(customer_id, transaction_attributes) }
|
46
|
+
return_object_or_raise(:transaction) { credit(customer_id, transaction_attributes) }
|
46
47
|
end
|
47
48
|
|
48
49
|
def self.delete(*args)
|
@@ -90,6 +91,7 @@ module Braintree
|
|
90
91
|
@visa_checkout_cards = (@visa_checkout_cards|| []).map { |pm| VisaCheckoutCard._new gateway, pm }
|
91
92
|
@samsung_pay_cards = (@samsung_pay_cards|| []).map { |pm| SamsungPayCard._new gateway, pm }
|
92
93
|
@addresses = (@addresses || []).map { |addr| Address._new gateway, addr }
|
94
|
+
@tax_identifiers = (@tax_identifiers || []).map { |addr| TaxIdentifier._new gateway, addr }
|
93
95
|
@custom_fields = attributes[:custom_fields].is_a?(Hash) ? attributes[:custom_fields] : {}
|
94
96
|
end
|
95
97
|
|
@@ -124,7 +126,7 @@ module Braintree
|
|
124
126
|
|
125
127
|
def inspect # :nodoc:
|
126
128
|
first = [:id]
|
127
|
-
last = [:addresses, :credit_cards, :paypal_accounts]
|
129
|
+
last = [:addresses, :credit_cards, :paypal_accounts, :tax_identifiers]
|
128
130
|
order = first + (self.class._attributes - first - last) + last
|
129
131
|
nice_attributes = order.map do |attr|
|
130
132
|
"#{attr}: #{send(attr).inspect}"
|
@@ -142,13 +144,13 @@ module Braintree
|
|
142
144
|
end
|
143
145
|
|
144
146
|
def self._new(*args) # :nodoc:
|
145
|
-
self.new
|
147
|
+
self.new(*args)
|
146
148
|
end
|
147
149
|
|
148
150
|
def self._attributes # :nodoc:
|
149
151
|
[
|
150
152
|
:addresses, :company, :credit_cards, :email, :fax, :first_name, :id, :last_name, :phone, :website,
|
151
|
-
:created_at, :updated_at
|
153
|
+
:created_at, :updated_at, :tax_identifiers
|
152
154
|
]
|
153
155
|
end
|
154
156
|
|
@@ -80,6 +80,7 @@ module Braintree
|
|
80
80
|
{:risk_data => [:customer_browser, :customer_ip]},
|
81
81
|
{:credit_card => credit_card_signature},
|
82
82
|
{:paypal_account => paypal_account_signature},
|
83
|
+
{:tax_identifiers => [:country_code, :identifier]},
|
83
84
|
{:options => options},
|
84
85
|
{:custom_fields => :_any_key_}
|
85
86
|
]
|
@@ -141,6 +142,7 @@ module Braintree
|
|
141
142
|
:company, :email, :fax, :first_name, :id, :last_name, :phone, :website,
|
142
143
|
:device_data, :payment_method_nonce, :default_payment_method_token,
|
143
144
|
{:credit_card => credit_card_signature},
|
145
|
+
{:tax_identifiers => [:country_code, :identifier]},
|
144
146
|
{:options => options},
|
145
147
|
{:custom_fields => :_any_key_}
|
146
148
|
]
|
data/lib/braintree/dispute.rb
CHANGED
@@ -7,6 +7,7 @@ module Braintree
|
|
7
7
|
attr_reader :amount_disputed
|
8
8
|
attr_reader :amount_won
|
9
9
|
attr_reader :case_number
|
10
|
+
attr_reader :chargeback_protection_level
|
10
11
|
attr_reader :created_at
|
11
12
|
attr_reader :currency_iso_code
|
12
13
|
attr_reader :date_opened
|
@@ -17,6 +18,7 @@ module Braintree
|
|
17
18
|
attr_reader :kind
|
18
19
|
attr_reader :merchant_account_id
|
19
20
|
attr_reader :original_dispute_id
|
21
|
+
attr_reader :paypal_messages
|
20
22
|
attr_reader :processor_comments
|
21
23
|
attr_reader :reason
|
22
24
|
attr_reader :reason_code
|
@@ -65,10 +67,18 @@ module Braintree
|
|
65
67
|
All = constants.map { |c| const_get(c) }
|
66
68
|
end
|
67
69
|
|
70
|
+
module ChargebackProtectionLevel
|
71
|
+
Effortless = "effortless"
|
72
|
+
Standard = "standard"
|
73
|
+
NotProtected = "not_protected"
|
74
|
+
|
75
|
+
All = constants.map { |c| const_get(c) }
|
76
|
+
end
|
77
|
+
|
68
78
|
class << self
|
69
79
|
protected :new
|
70
80
|
def _new(*args) # :nodoc:
|
71
|
-
self.new
|
81
|
+
self.new(*args)
|
72
82
|
end
|
73
83
|
end
|
74
84
|
|
@@ -114,6 +124,10 @@ module Braintree
|
|
114
124
|
Braintree::Dispute::Evidence.new(record)
|
115
125
|
end unless evidence.nil?
|
116
126
|
|
127
|
+
@paypal_messages = paypal_messages.map do |record|
|
128
|
+
Braintree::Dispute::PayPalMessage.new(record)
|
129
|
+
end unless paypal_messages.nil?
|
130
|
+
|
117
131
|
@transaction_details = TransactionDetails.new(transaction)
|
118
132
|
@transaction = Transaction.new(transaction)
|
119
133
|
|