Skip to content

Commit

Permalink
2.27.1
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Dec 5, 2013
1 parent a1babb9 commit 4f2c931
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
6 changes: 5 additions & 1 deletion lib/braintree/merchant_account.rb
Expand Up @@ -8,12 +8,16 @@ module Status
Suspended = "suspended"
end

module FundingDestinations
module FundingDestination
Bank = "bank"
MobilePhone = "mobile_phone"
Email = "email"
end

module FundingDestinations
include Braintree::MerchantAccount::FundingDestination
end

attr_reader :status, :id, :master_merchant_account,
:individual_details, :business_details, :funding_details

Expand Down
2 changes: 1 addition & 1 deletion lib/braintree/version.rb
Expand Up @@ -2,7 +2,7 @@ module Braintree
module Version
Major = 2
Minor = 27
Tiny = 0
Tiny = 1

String = "#{Major}.#{Minor}.#{Tiny}"
end
Expand Down
18 changes: 9 additions & 9 deletions spec/integration/braintree/merchant_account_spec.rb
Expand Up @@ -50,7 +50,7 @@
}
},
:funding => {
:destination => Braintree::MerchantAccount::FundingDestinations::Bank,
:destination => Braintree::MerchantAccount::FundingDestination::Bank,
:routing_number => "011103093",
:account_number => "43759348798"
},
Expand Down Expand Up @@ -108,15 +108,15 @@
context "funding destination" do
it "accepts a bank" do
params = VALID_APPLICATION_PARAMS.dup
params[:funding][:destination] = ::Braintree::MerchantAccount::FundingDestinations::Bank
params[:funding][:destination] = ::Braintree::MerchantAccount::FundingDestination::Bank
result = Braintree::MerchantAccount.create(params)

result.should be_success
end

it "accepts an email" do
params = VALID_APPLICATION_PARAMS.dup
params[:funding][:destination] = ::Braintree::MerchantAccount::FundingDestinations::Email
params[:funding][:destination] = ::Braintree::MerchantAccount::FundingDestination::Email
params[:funding][:email] = "joebloggs@compuserve.com"
result = Braintree::MerchantAccount.create(params)

Expand All @@ -125,7 +125,7 @@

it "accepts a mobile_phone" do
params = VALID_APPLICATION_PARAMS.dup
params[:funding][:destination] = ::Braintree::MerchantAccount::FundingDestinations::MobilePhone
params[:funding][:destination] = ::Braintree::MerchantAccount::FundingDestination::MobilePhone
params[:funding][:mobile_phone] = "3125882300"
result = Braintree::MerchantAccount.create(params)

Expand Down Expand Up @@ -159,7 +159,7 @@
params[:funding][:routing_number] = "071000013"
params[:funding][:email] = "check@this.com"
params[:funding][:mobile_phone] = "1234567890"
params[:funding][:destination] = Braintree::MerchantAccount::FundingDestinations::MobilePhone
params[:funding][:destination] = Braintree::MerchantAccount::FundingDestination::MobilePhone
result = Braintree::MerchantAccount.update("sandbox_sub_merchant_account", params)
result.should be_success
result.merchant_account.status.should == "active"
Expand All @@ -185,7 +185,7 @@
result.merchant_account.funding_details.routing_number.should == "071000013"
result.merchant_account.funding_details.email.should == "check@this.com"
result.merchant_account.funding_details.mobile_phone.should == "1234567890"
result.merchant_account.funding_details.destination.should == Braintree::MerchantAccount::FundingDestinations::MobilePhone
result.merchant_account.funding_details.destination.should == Braintree::MerchantAccount::FundingDestination::MobilePhone
end

it "does not require all fields" do
Expand Down Expand Up @@ -329,7 +329,7 @@
result = Braintree::MerchantAccount.update(
"sandbox_sub_merchant_account", {
:funding => {
:destination => Braintree::MerchantAccount::FundingDestinations::Bank,
:destination => Braintree::MerchantAccount::FundingDestination::Bank,
:routing_number => "",
:account_number => ""
},
Expand All @@ -343,7 +343,7 @@
result = Braintree::MerchantAccount.update(
"sandbox_sub_merchant_account", {
:funding => {
:destination => Braintree::MerchantAccount::FundingDestinations::Email,
:destination => Braintree::MerchantAccount::FundingDestination::Email,
:email => ""
},
}
Expand All @@ -355,7 +355,7 @@
result = Braintree::MerchantAccount.update(
"sandbox_sub_merchant_account", {
:funding => {
:destination => Braintree::MerchantAccount::FundingDestinations::MobilePhone,
:destination => Braintree::MerchantAccount::FundingDestination::MobilePhone,
:mobile_phone => ""
},
}
Expand Down

0 comments on commit 4f2c931

Please sign in to comment.