spec/integration/braintree/transaction_spec.rb in braintree-4.18.0 vs spec/integration/braintree/transaction_spec.rb in braintree-4.19.0
- old
+ new
@@ -2096,11 +2096,10 @@
expect(result.transaction.paypal_details).not_to be_nil
expect(result.transaction.paypal_details.debug_id).not_to be_nil
end
it "can create a transaction with a params nonce with PayPal account params" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -2172,11 +2171,10 @@
meta_checkout_token_details.masked_number.should == "401288******1881"
meta_checkout_token_details.prepaid.should == "No"
end
it "can create a transaction with a fake apple pay nonce" do
- customer = Braintree::Customer.create!
result = Braintree::Transaction.create(
:type => "sale",
:amount => Braintree::Test::TransactionAmounts::Authorize,
:payment_method_nonce => Braintree::Test::Nonce::ApplePayVisa,
)
@@ -2201,11 +2199,10 @@
expect(apple_pay_details.payroll).not_to be_nil
expect(apple_pay_details.product_id).not_to be_nil
end
it "can create a vaulted transaction with a fake apple pay nonce" do
- customer = Braintree::Customer.create!
result = Braintree::Transaction.create(
:type => "sale",
:amount => Braintree::Test::TransactionAmounts::Authorize,
:payment_method_nonce => Braintree::Test::Nonce::ApplePayVisa,
:options => {:store_in_vault_on_success => true},
@@ -2223,11 +2220,10 @@
expect(apple_pay_details.image_url).not_to be_nil
expect(apple_pay_details.token).not_to be_nil
end
it "can create a transaction with a fake google pay proxy card nonce" do
- customer = Braintree::Customer.create!
result = Braintree::Transaction.create(
:type => "sale",
:amount => Braintree::Test::TransactionAmounts::Authorize,
:payment_method_nonce => Braintree::Test::Nonce::GooglePayDiscover,
)
@@ -2255,11 +2251,10 @@
expect(google_pay_details.payroll).not_to be_nil
expect(google_pay_details.product_id).not_to be_nil
end
it "can create a vaulted transaction with a fake google pay proxy card nonce" do
- customer = Braintree::Customer.create!
result = Braintree::Transaction.create(
:type => "sale",
:amount => Braintree::Test::TransactionAmounts::Authorize,
:payment_method_nonce => Braintree::Test::Nonce::GooglePayDiscover,
:options => {:store_in_vault_on_success => true},
@@ -2280,11 +2275,10 @@
expect(google_pay_details.is_network_tokenized?).to eq(false)
expect(google_pay_details.token).not_to be_nil
end
it "can create a transaction with a fake google pay network token nonce" do
- customer = Braintree::Customer.create!
result = Braintree::Transaction.create(
:type => "sale",
:amount => Braintree::Test::TransactionAmounts::Authorize,
:payment_method_nonce => Braintree::Test::Nonce::GooglePayMasterCard,
)
@@ -2333,11 +2327,10 @@
)
expect(result).to be_success
end
it "can create a transaction with an unknown nonce" do
- customer = Braintree::Customer.create!
result = Braintree::Transaction.create(
:type => "sale",
:amount => Braintree::Test::TransactionAmounts::Authorize,
:payment_method_nonce => Braintree::Test::Nonce::AbstractTransactable,
)
@@ -2362,11 +2355,10 @@
expect(result.transaction.paypal_details.payer_id).to eq("PAYER-1234")
expect(result.transaction.paypal_details.payment_id).to eq("PAY-5678")
end
it "can create a transaction with a payee id" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -2386,11 +2378,10 @@
expect(result.transaction.paypal_details.debug_id).not_to be_nil
expect(result.transaction.paypal_details.payee_id).to eq("fake-payee-id")
end
it "can create a transaction with a payee id in the options params" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -2411,11 +2402,10 @@
expect(result.transaction.paypal_details.debug_id).not_to be_nil
expect(result.transaction.paypal_details.payee_id).to eq("fake-payee-id")
end
it "can create a transaction with a payee id in options.paypal" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -2437,11 +2427,10 @@
expect(result.transaction.paypal_details.debug_id).not_to be_nil
expect(result.transaction.paypal_details.payee_id).to eq("fake-payee-id")
end
it "can create a transaction with a payee email" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -2461,11 +2450,10 @@
expect(result.transaction.paypal_details.debug_id).not_to be_nil
expect(result.transaction.paypal_details.payee_email).to eq("bt_seller_us@paypal.com")
end
it "can create a transaction with a payee email in the options params" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -2486,11 +2474,10 @@
expect(result.transaction.paypal_details.debug_id).not_to be_nil
expect(result.transaction.paypal_details.payee_email).to eq("bt_seller_us@paypal.com")
end
it "can create a transaction with a payee email in options.paypal" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -2512,11 +2499,10 @@
expect(result.transaction.paypal_details.debug_id).not_to be_nil
expect(result.transaction.paypal_details.payee_email).to eq("bt_seller_us@paypal.com")
end
it "can create a transaction with a paypal custom field" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -2538,11 +2524,10 @@
expect(result.transaction.paypal_details.debug_id).not_to be_nil
expect(result.transaction.paypal_details.custom_field).to eq("Additional info")
end
it "can create a transaction with a paypal description" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -2564,11 +2549,10 @@
expect(result.transaction.paypal_details.debug_id).not_to be_nil
expect(result.transaction.paypal_details.description).to eq("A great product")
end
it "can create a transaction with STC supplementary data" do
- customer = Braintree::Customer.create!
nonce = nonce_for_new_payment_method(
:paypal_account => {
:consent_code => "PAYPAL_CONSENT_CODE",
},
)
@@ -3298,11 +3282,11 @@
},
},
)
config = Braintree::Configuration.instantiate
- response = config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
+ config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
transaction = Braintree::Transaction.find(transaction.id)
result = Braintree::Transaction.refund(
transaction.id,
:merchant_account_id => SpecHelper::FakeFirstDataMerchantAccountId,
@@ -3388,11 +3372,11 @@
:options => {
:submit_for_settlement => true
},
)
config = Braintree::Configuration.instantiate
- response = config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
+ config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
result = Braintree::Transaction.refund(transaction.id, :amount => "2046.00")
expect(result.success?).to eq(false)
expect(result.transaction.id).to match(/^\w{6,}$/)
expect(result.transaction.type).to eq("credit")
expect(result.transaction.status).to eq(Braintree::Transaction::Status::ProcessorDeclined)
@@ -3409,11 +3393,11 @@
:options => {
:submit_for_settlement => true
},
)
config = Braintree::Configuration.instantiate
- response = config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
+ config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
result = Braintree::Transaction.refund(transaction.id, :amount => "2009.00")
expect(result.success?).to eq(false)
expect(result.transaction.id).to match(/^\w{6,}$/)
expect(result.transaction.type).to eq("credit")
expect(result.transaction.status).to eq(Braintree::Transaction::Status::ProcessorDeclined)
@@ -7254,11 +7238,11 @@
:submit_for_settlement => true
},
)
config = Braintree::Configuration.instantiate
- response = config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
+ config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
Braintree::Transaction.find(transaction.id)
end
def create_paypal_transaction_for_refund
transaction = Braintree::Transaction.sale!(
@@ -7285,11 +7269,11 @@
:service_fee_amount => "1.00",
:options => {:hold_in_escrow => true},
)
config = Braintree::Configuration.instantiate
- response = config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
- response = config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/escrow")
+ config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
+ config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/escrow")
Braintree::Transaction.find(transaction.id)
end
context "paypal" do
it "can create a transaction for a paypal account" do