spec/integration/braintree/transaction_spec.rb in braintree-2.63.0 vs spec/integration/braintree/transaction_spec.rb in braintree-2.64.0

- old
+ new

@@ -316,10 +316,27 @@ ) result.success?.should == true end + it "accepts additional security parameters: risk data with customer_browser and customer_ip" do + result = Braintree::Transaction.create( + :type => "sale", + :amount => Braintree::Test::TransactionAmounts::Authorize, + :credit_card => { + :number => Braintree::Test::CreditCardNumbers::Visa, + :expiration_date => "05/2009" + }, + :risk_data => { + :customer_browser => "IE6", + :customer_ip => "192.168.0.1" + } + ) + + result.success?.should == true + end + it "accepts billing_address_id in place of billing_address" do result = Braintree::Customer.create() address_result = Braintree::Address.create( :customer_id => result.customer.id, :country_code_alpha2 => "US" @@ -1011,19 +1028,49 @@ end context "recurring" do it "marks a transaction as recurring" do result = Braintree::Transaction.create( - :type => "sale", - :amount => Braintree::Test::TransactionAmounts::Authorize, - :credit_card => { - :number => Braintree::Test::CreditCardNumbers::Visa, - :expiration_date => "12/12", - }, - :recurring => true - ) - result.success?.should == true - result.transaction.recurring.should == true + :type => "sale", + :amount => Braintree::Test::TransactionAmounts::Authorize, + :credit_card => { + :number => Braintree::Test::CreditCardNumbers::Visa, + :expiration_date => "12/12", + }, + :recurring => true + ) + result.success?.should == true + result.transaction.recurring.should == true + end + end + + context "transaction_source" do + it "marks a transactions as recurring" do + result = Braintree::Transaction.create( + :type => "sale", + :amount => Braintree::Test::TransactionAmounts::Authorize, + :credit_card => { + :number => Braintree::Test::CreditCardNumbers::Visa, + :expiration_date => "12/12", + }, + :transaction_source => "recurring" + ) + result.success?.should == true + result.transaction.recurring.should == true + end + + it "marks a transactions as moto" do + result = Braintree::Transaction.create( + :type => "sale", + :amount => Braintree::Test::TransactionAmounts::Authorize, + :credit_card => { + :number => Braintree::Test::CreditCardNumbers::Visa, + :expiration_date => "12/12", + }, + :transaction_source => "moto" + ) + result.success?.should == true + result.transaction.recurring.should == false end end context "store_in_vault_on_success" do context "passed as true" do