braintree 2.91.0 → 2.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/braintree.rb +1 -0
- data/lib/braintree/authorization_adjustment.rb +1 -0
- data/lib/braintree/credit_card_verification.rb +1 -0
- data/lib/braintree/processor_response_types.rb +7 -0
- data/lib/braintree/successful_result.rb +2 -0
- data/lib/braintree/test/transaction_amounts.rb +1 -0
- data/lib/braintree/transaction.rb +2 -0
- data/lib/braintree/version.rb +1 -1
- data/spec/integration/braintree/client_api/client_token_spec.rb +0 -17
- data/spec/integration/braintree/credit_card_verification_spec.rb +10 -4
- data/spec/integration/braintree/payment_method_spec.rb +0 -12
- data/spec/integration/braintree/transaction_spec.rb +54 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ee8dac5bb756fb408c50fa5acef0ad21bf4d10127ade82df57828bd7123484f
|
4
|
+
data.tar.gz: adb2042d479a2418d62e8da23b6aeaa77490e46dea06daefbff0f4c19209c59c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a1b0f3e1a7600a0a699baa9a398585704960e6fa78958be8ec9e8a95fa191d234b73c91294b15cb8f99ce699e2aaec9af2c5c9c5f28778895be039782fc96a2
|
7
|
+
data.tar.gz: 67f11e2d63c8ce0e0ca9bdd25a8b160ee0453c371495b9e9b4d83220c7c990963f496de28b08200852e8bfb76d9afad73a138136aeba0a22d303594a138008cb
|
data/lib/braintree.rb
CHANGED
@@ -95,6 +95,7 @@ require "braintree/paypal_account"
|
|
95
95
|
require "braintree/paypal_account_gateway"
|
96
96
|
require "braintree/plan"
|
97
97
|
require "braintree/plan_gateway"
|
98
|
+
require "braintree/processor_response_types"
|
98
99
|
require "braintree/risk_data"
|
99
100
|
require "braintree/facilitated_details"
|
100
101
|
require "braintree/facilitator_details"
|
@@ -22,12 +22,14 @@ module Braintree
|
|
22
22
|
attr_reader :supported_networks
|
23
23
|
attr_reader :transaction
|
24
24
|
attr_reader :us_bank_account_verification
|
25
|
+
attr_reader :credit_card_verification
|
25
26
|
|
26
27
|
def initialize(attributes = {}) # :nodoc:
|
27
28
|
@attrs = attributes.keys
|
28
29
|
attributes.each do |key, value|
|
29
30
|
instance_variable_set("@#{key}", value)
|
30
31
|
end
|
32
|
+
@credit_card_verification = @verification
|
31
33
|
end
|
32
34
|
|
33
35
|
def inspect # :nodoc:
|
@@ -83,6 +83,7 @@ module Braintree
|
|
83
83
|
attr_reader :android_pay_details
|
84
84
|
attr_reader :apple_pay_details
|
85
85
|
attr_reader :authorization_adjustments
|
86
|
+
attr_reader :authorization_expires_at
|
86
87
|
attr_reader :authorized_transaction_id
|
87
88
|
attr_reader :avs_error_response_code
|
88
89
|
attr_reader :avs_postal_code_response_code
|
@@ -118,6 +119,7 @@ module Braintree
|
|
118
119
|
attr_reader :processor_authorization_code # Authorization code from the processor.
|
119
120
|
attr_reader :processor_response_code # Response code from the processor.
|
120
121
|
attr_reader :processor_response_text # Response text from the processor.
|
122
|
+
attr_reader :processor_response_type # Response type from the processor.
|
121
123
|
attr_reader :processor_settlement_response_code # Settlement response code from the processor.
|
122
124
|
attr_reader :processor_settlement_response_text # Settlement response text from the processor.
|
123
125
|
attr_reader :purchase_order_number
|
data/lib/braintree/version.rb
CHANGED
@@ -186,22 +186,5 @@ describe Braintree::ClientToken do
|
|
186
186
|
end
|
187
187
|
end
|
188
188
|
end
|
189
|
-
|
190
|
-
context "SEPA" do
|
191
|
-
it "raises error for passing in sepa related params" do
|
192
|
-
with_altpay_merchant do
|
193
|
-
result = Braintree::Customer.create
|
194
|
-
customer_id = result.customer.id
|
195
|
-
|
196
|
-
expect do
|
197
|
-
Braintree::ClientToken.generate(
|
198
|
-
:customer_id => customer_id,
|
199
|
-
:sepa_mandate_acceptance_location => "Hamburg, Germany",
|
200
|
-
:sepa_mandate_type => Braintree::EuropeBankAccount::MandateType::Business
|
201
|
-
)
|
202
|
-
end.to raise_error(ArgumentError, "invalid keys: sepa_mandate_acceptance_location, sepa_mandate_type")
|
203
|
-
end
|
204
|
-
end
|
205
|
-
end
|
206
189
|
end
|
207
190
|
end
|
@@ -17,6 +17,11 @@ describe Braintree::CreditCardVerification, "search" do
|
|
17
17
|
result = Braintree::CreditCardVerification.create(verification_params)
|
18
18
|
|
19
19
|
result.should be_success
|
20
|
+
result.credit_card_verification.id.should =~ /^\w{6,}$/
|
21
|
+
result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::Verified
|
22
|
+
result.credit_card_verification.processor_response_code.should == "1000"
|
23
|
+
result.credit_card_verification.processor_response_text.should == "Approved"
|
24
|
+
result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::Approved
|
20
25
|
end
|
21
26
|
|
22
27
|
it "returns processor response code and text as well as the additional processor response if declined" do
|
@@ -33,10 +38,11 @@ describe Braintree::CreditCardVerification, "search" do
|
|
33
38
|
result = Braintree::CreditCardVerification.create(verification_params)
|
34
39
|
|
35
40
|
result.success?.should == false
|
36
|
-
result.
|
37
|
-
result.
|
38
|
-
result.
|
39
|
-
result.
|
41
|
+
result.credit_card_verification.id.should =~ /^\w{6,}$/
|
42
|
+
result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::ProcessorDeclined
|
43
|
+
result.credit_card_verification.processor_response_code.should == "2000"
|
44
|
+
result.credit_card_verification.processor_response_text.should == "Do Not Honor"
|
45
|
+
result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::SoftDeclined
|
40
46
|
end
|
41
47
|
|
42
48
|
it "returns validation errors" do
|
@@ -204,18 +204,6 @@ describe Braintree::PaymentMethod do
|
|
204
204
|
venmo_account.customer_id.should == customer.id
|
205
205
|
end
|
206
206
|
|
207
|
-
it "raise server error when we attempt to create europe bank account payment method" do
|
208
|
-
customer = Braintree::Customer.create.customer
|
209
|
-
token = SecureRandom.hex(16)
|
210
|
-
expect do
|
211
|
-
Braintree::PaymentMethod.create(
|
212
|
-
:payment_method_nonce => Braintree::Test::Nonce::Europe,
|
213
|
-
:customer_id => customer.id,
|
214
|
-
:token => token
|
215
|
-
)
|
216
|
-
end.to raise_error(Braintree::ServerError)
|
217
|
-
end
|
218
|
-
|
219
207
|
it "allows passing the make_default option alongside the nonce" do
|
220
208
|
customer = Braintree::Customer.create!
|
221
209
|
result = Braintree::CreditCard.create(
|
@@ -287,6 +287,9 @@ describe Braintree::Transaction do
|
|
287
287
|
result.transaction.type.should == "sale"
|
288
288
|
result.transaction.amount.should == BigDecimal.new(Braintree::Test::TransactionAmounts::Authorize)
|
289
289
|
result.transaction.processor_authorization_code.should_not be_nil
|
290
|
+
result.transaction.processor_response_code.should == "1000"
|
291
|
+
result.transaction.processor_response_text.should == "Approved"
|
292
|
+
result.transaction.processor_response_type.should == Braintree::ProcessorResponseTypes::Approved
|
290
293
|
result.transaction.voice_referral_number.should be_nil
|
291
294
|
result.transaction.credit_card_details.bin.should == Braintree::Test::CreditCardNumbers::Visa[0, 6]
|
292
295
|
result.transaction.credit_card_details.last_4.should == Braintree::Test::CreditCardNumbers::Visa[-4..-1]
|
@@ -384,7 +387,7 @@ describe Braintree::Transaction do
|
|
384
387
|
result.success?.should == true
|
385
388
|
end
|
386
389
|
|
387
|
-
it "returns processor response code and text as well as the additional processor response if declined" do
|
390
|
+
it "returns processor response code and text as well as the additional processor response if soft declined" do
|
388
391
|
result = Braintree::Transaction.create(
|
389
392
|
:type => "sale",
|
390
393
|
:amount => Braintree::Test::TransactionAmounts::Decline,
|
@@ -399,9 +402,29 @@ describe Braintree::Transaction do
|
|
399
402
|
result.transaction.status.should == Braintree::Transaction::Status::ProcessorDeclined
|
400
403
|
result.transaction.processor_response_code.should == "2000"
|
401
404
|
result.transaction.processor_response_text.should == "Do Not Honor"
|
405
|
+
result.transaction.processor_response_type.should == Braintree::ProcessorResponseTypes::SoftDeclined
|
402
406
|
result.transaction.additional_processor_response.should == "2000 : Do Not Honor"
|
403
407
|
end
|
404
408
|
|
409
|
+
it "returns processor response code and text as well as the additional processor response if hard declined" do
|
410
|
+
result = Braintree::Transaction.create(
|
411
|
+
:type => "sale",
|
412
|
+
:amount => Braintree::Test::TransactionAmounts::HardDecline,
|
413
|
+
:credit_card => {
|
414
|
+
:number => Braintree::Test::CreditCardNumbers::Visa,
|
415
|
+
:expiration_date => "05/2009"
|
416
|
+
}
|
417
|
+
)
|
418
|
+
result.success?.should == false
|
419
|
+
result.transaction.id.should =~ /^\w{6,}$/
|
420
|
+
result.transaction.type.should == "sale"
|
421
|
+
result.transaction.status.should == Braintree::Transaction::Status::ProcessorDeclined
|
422
|
+
result.transaction.processor_response_code.should == "2015"
|
423
|
+
result.transaction.processor_response_text.should == "Transaction Not Allowed"
|
424
|
+
result.transaction.processor_response_type.should == Braintree::ProcessorResponseTypes::HardDeclined
|
425
|
+
result.transaction.additional_processor_response.should == "2015 : Transaction Not Allowed"
|
426
|
+
end
|
427
|
+
|
405
428
|
it "accepts all four country codes" do
|
406
429
|
result = Braintree::Transaction.sale(
|
407
430
|
:amount => "100",
|
@@ -4011,6 +4034,7 @@ describe Braintree::Transaction do
|
|
4011
4034
|
transaction.order_id.should == "123"
|
4012
4035
|
transaction.channel.should == "MyShoppingCartProvider"
|
4013
4036
|
transaction.processor_response_code.should == "1000"
|
4037
|
+
transaction.authorization_expires_at.between?(Time.now, Time.now + (60 * 60 * 24 * 60)).should == true
|
4014
4038
|
transaction.created_at.between?(Time.now - 60, Time.now).should == true
|
4015
4039
|
transaction.updated_at.between?(Time.now - 60, Time.now).should == true
|
4016
4040
|
transaction.credit_card_details.bin.should == "510510"
|
@@ -5400,6 +5424,7 @@ describe Braintree::Transaction do
|
|
5400
5424
|
transaction.order_id.should == "123"
|
5401
5425
|
transaction.channel.should == "MyShoppingCartProvider"
|
5402
5426
|
transaction.processor_response_code.should == "1000"
|
5427
|
+
transaction.authorization_expires_at.between?(Time.now, Time.now + (60 * 60 * 24 * 60)).should == true
|
5403
5428
|
transaction.created_at.between?(Time.now - 60, Time.now).should == true
|
5404
5429
|
transaction.updated_at.between?(Time.now - 60, Time.now).should == true
|
5405
5430
|
transaction.credit_card_details.bin.should == "510510"
|
@@ -5922,6 +5947,34 @@ describe Braintree::Transaction do
|
|
5922
5947
|
authorization_adjustment.processor_response_code.should == "1000"
|
5923
5948
|
authorization_adjustment.processor_response_text.should == "Approved"
|
5924
5949
|
end
|
5950
|
+
|
5951
|
+
it "includes authorization adjustments soft declined on found transactions" do
|
5952
|
+
found_transaction = Braintree::Transaction.find("authadjustmenttransactionsoftdeclined")
|
5953
|
+
|
5954
|
+
found_transaction.authorization_adjustments.count.should == 1
|
5955
|
+
|
5956
|
+
authorization_adjustment = found_transaction.authorization_adjustments.first
|
5957
|
+
authorization_adjustment.amount.should == "-20.00"
|
5958
|
+
authorization_adjustment.success.should == false
|
5959
|
+
authorization_adjustment.timestamp.should be_a Time
|
5960
|
+
authorization_adjustment.processor_response_code.should == "3000"
|
5961
|
+
authorization_adjustment.processor_response_text.should == "Processor Network Unavailable - Try Again"
|
5962
|
+
authorization_adjustment.processor_response_type.should == Braintree::ProcessorResponseTypes::SoftDeclined
|
5963
|
+
end
|
5964
|
+
|
5965
|
+
it "includes authorization adjustments hard declined on found transactions" do
|
5966
|
+
found_transaction = Braintree::Transaction.find("authadjustmenttransactionharddeclined")
|
5967
|
+
|
5968
|
+
found_transaction.authorization_adjustments.count.should == 1
|
5969
|
+
|
5970
|
+
authorization_adjustment = found_transaction.authorization_adjustments.first
|
5971
|
+
authorization_adjustment.amount.should == "-20.00"
|
5972
|
+
authorization_adjustment.success.should == false
|
5973
|
+
authorization_adjustment.timestamp.should be_a Time
|
5974
|
+
authorization_adjustment.processor_response_code.should == "2015"
|
5975
|
+
authorization_adjustment.processor_response_text.should == "Transaction Not Allowed"
|
5976
|
+
authorization_adjustment.processor_response_type.should == Braintree::ProcessorResponseTypes::HardDeclined
|
5977
|
+
end
|
5925
5978
|
end
|
5926
5979
|
|
5927
5980
|
describe "vault_credit_card" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: braintree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.92.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Braintree
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/braintree/paypal_account_gateway.rb
|
118
118
|
- lib/braintree/plan.rb
|
119
119
|
- lib/braintree/plan_gateway.rb
|
120
|
+
- lib/braintree/processor_response_types.rb
|
120
121
|
- lib/braintree/resource_collection.rb
|
121
122
|
- lib/braintree/risk_data.rb
|
122
123
|
- lib/braintree/samsung_pay_card.rb
|