spec/integration/braintree/transaction_spec.rb in braintree-2.89.0 vs spec/integration/braintree/transaction_spec.rb in braintree-2.90.0
- old
+ new
@@ -122,22 +122,24 @@
end
describe "self.create" do
describe "risk data" do
it "returns decision, device_data_captured and id" do
- result = Braintree::Transaction.create(
- :type => "sale",
- :amount => 1_00,
- :credit_card => {
- :number => Braintree::Test::CreditCardNumbers::CardTypeIndicators::Prepaid,
- :expiration_date => "05/2009"
- }
- )
- result.transaction.risk_data.should be_a(Braintree::RiskData)
- result.transaction.risk_data.should respond_to(:id)
- result.transaction.risk_data.should respond_to(:decision)
- result.transaction.risk_data.should respond_to(:device_data_captured)
+ with_advanced_fraud_integration_merchant do
+ result = Braintree::Transaction.create(
+ :type => "sale",
+ :amount => 1_00,
+ :credit_card => {
+ :number => Braintree::Test::CreditCardNumbers::CardTypeIndicators::Prepaid,
+ :expiration_date => "05/2009"
+ }
+ )
+ result.transaction.risk_data.should be_a(Braintree::RiskData)
+ result.transaction.risk_data.should respond_to(:id)
+ result.transaction.risk_data.should respond_to(:decision)
+ result.transaction.risk_data.should respond_to(:device_data_captured)
+ end
end
end
describe "card type indicators" do
it "sets the prepaid field if the card is prepaid" do
@@ -4085,22 +4087,24 @@
result.params.should == {:transaction => {:type => 'sale', :amount => nil, :credit_card => {:expiration_date => "05/2009"}}}
result.errors.for(:transaction).on(:amount)[0].code.should == Braintree::ErrorCodes::Transaction::AmountIsRequired
end
it "skips advanced fraud checking if transaction[options][skip_advanced_fraud_checking] is set to true" do
- result = Braintree::Transaction.sale(
- :amount => Braintree::Test::TransactionAmounts::Authorize,
- :credit_card => {
- :number => Braintree::Test::CreditCardNumbers::Visa,
- :expiration_date => "05/2009"
- },
- :options => {
- :skip_advanced_fraud_checking => true
- }
- )
- result.success?.should == true
- result.transaction.risk_data.id.should be_nil
+ with_advanced_fraud_integration_merchant do
+ result = Braintree::Transaction.sale(
+ :amount => Braintree::Test::TransactionAmounts::Authorize,
+ :credit_card => {
+ :number => Braintree::Test::CreditCardNumbers::Visa,
+ :expiration_date => "05/2009"
+ },
+ :options => {
+ :skip_advanced_fraud_checking => true
+ }
+ )
+ result.success?.should == true
+ result.transaction.risk_data.should be_nil
+ end
end
it "works with Apple Pay params" do
params = {
:amount => "3.12",
@@ -5712,9 +5716,11 @@
authorization_adjustment = found_transaction.authorization_adjustments.first
authorization_adjustment.amount.should == "-20.00"
authorization_adjustment.success.should == true
authorization_adjustment.timestamp.should be_a Time
+ authorization_adjustment.processor_response_code.should == "1000"
+ authorization_adjustment.processor_response_text.should == "Approved"
end
end
describe "vault_credit_card" do
it "returns the Braintree::CreditCard if the transaction credit card is stored in the vault" do