Sha256: 5dd87a016ec6ea609478f1b8ac4907ea42beeacea33ce544596328c39108901c
Contents?: true
Size: 1.38 KB
Versions: 92
Compression:
Stored size: 1.38 KB
Contents
Given /^that the credit card "([^"]*)" is invalid$/ do |number| FakeBraintree.failures[number] = { "message" => "Credit card number is invalid.", "errors" => { "customer" => { "errors" => [], "credit-card" => { "errors" => [{ "message" => "Credit card number is invalid.", "code" => 81715, "attribute" => :number }] }}}} end Given /^that the credit card "([^"]*)" should not be honored$/ do |number| FakeBraintree.failures[number] = { "message" => "Do Not Honor", "code" => "2000", "status" => "processor_declined" } end Given /^the "([^"]*)" account is past due$/ do |account_name| account = Account.find_by_name!(account_name) account.update_attribute(:subscription_status, Braintree::Subscription::Status::PastDue) end Given /^the following transaction exist for the "([^"]*)" account:$/ do |account_name, table| account = Account.find_by_name!(account_name) subscription = FakeBraintree.subscriptions[account.subscription_token] subscription["transactions"] = [] table.hashes.each do |transaction| FakeBraintree.transaction = { :status => transaction["status"], :amount => transaction["amount"], :created_at => Time.parse(transaction["created_at"]), :subscription_id => account.subscription_token } subscription["transactions"] << FakeBraintree.generated_transaction end end
Version data entries
92 entries across 92 versions & 2 rubygems