spec/integration/braintree/transaction_spec.rb in braintree-2.98.0 vs spec/integration/braintree/transaction_spec.rb in braintree-2.99.0
- old
+ new
@@ -3998,11 +3998,11 @@
)
result.success?.should == false
result.errors.for(:transaction).for(:external_vault).on(:status)[0].code.should == Braintree::ErrorCodes::Transaction::ExternalVault::StatusIsInvalid
end
- context "Visa" do
+ context "Visa/Mastercard/Discover" do
it "accepts status" do
result = Braintree::Transaction.create(
:type => "sale",
:credit_card => {
:number => Braintree::Test::CreditCardNumbers::Visa,
@@ -4019,11 +4019,11 @@
it "accepts previous_network_transaction_id" do
result = Braintree::Transaction.create(
:type => "sale",
:credit_card => {
- :number => Braintree::Test::CreditCardNumbers::Visa,
+ :number => Braintree::Test::CreditCardNumbers::MasterCard,
:expiration_date => "05/2009"
},
:external_vault => {
:status => Braintree::Transaction::ExternalVault::Status::Vaulted,
:previous_network_transaction_id => "123456789012345",
@@ -4036,11 +4036,11 @@
it "rejects non-vaulted status with previous_network_transaction_id" do
result = Braintree::Transaction.create(
:type => "sale",
:credit_card => {
- :number => Braintree::Test::CreditCardNumbers::Visa,
+ :number => Braintree::Test::CreditCardNumbers::Discover,
:expiration_date => "05/2009"
},
:external_vault => {
:status => Braintree::Transaction::ExternalVault::Status::WillVault,
:previous_network_transaction_id => "123456789012345",
@@ -4048,35 +4048,18 @@
:amount => "10.00",
)
result.success?.should == false
result.errors.for(:transaction).for(:external_vault).on(:status)[0].code.should == Braintree::ErrorCodes::Transaction::ExternalVault::StatusWithPreviousNetworkTransactionIdIsInvalid
end
-
- it "rejects invalid previous_network_transaction_id" do
- result = Braintree::Transaction.create(
- :type => "sale",
- :credit_card => {
- :number => Braintree::Test::CreditCardNumbers::Visa,
- :expiration_date => "05/2009"
- },
- :external_vault => {
- :status => Braintree::Transaction::ExternalVault::Status::Vaulted,
- :previous_network_transaction_id => "not_and_valid_id",
- },
- :amount => "10.00",
- )
- result.success?.should == false
- result.errors.for(:transaction).for(:external_vault).on(:previous_network_transaction_id)[0].code.should == Braintree::ErrorCodes::Transaction::ExternalVault::PreviousNetworkTransactionIdIsInvalid
- end
end
- context "Non-Visa" do
+ context "Non-(Visa/Mastercard/Discover) card types" do
it "accepts status" do
result = Braintree::Transaction.create(
:type => "sale",
:credit_card => {
- :number => Braintree::Test::CreditCardNumbers::MasterCard,
+ :number => Braintree::Test::CreditCardNumbers::AmExes[0],
:expiration_date => "05/2009"
},
:external_vault => {
:status => Braintree::Transaction::ExternalVault::Status::WillVault,
},
@@ -4088,11 +4071,11 @@
it "accepts blank previous_network_transaction_id" do
result = Braintree::Transaction.create(
:type => "sale",
:credit_card => {
- :number => Braintree::Test::CreditCardNumbers::MasterCard,
+ :number => Braintree::Test::CreditCardNumbers::AmExes[0],
:expiration_date => "05/2009"
},
:external_vault => {
:status => Braintree::Transaction::ExternalVault::Status::Vaulted,
:previous_network_transaction_id => "",
@@ -4105,10 +4088,10 @@
it "rejects previous_network_transaction_id" do
result = Braintree::Transaction.create(
:type => "sale",
:credit_card => {
- :number => Braintree::Test::CreditCardNumbers::Discover,
+ :number => Braintree::Test::CreditCardNumbers::AmExes[0],
:expiration_date => "05/2009"
},
:external_vault => {
:status => Braintree::Transaction::ExternalVault::Status::Vaulted,
:previous_network_transaction_id => "123456789012345",