diff --git a/lib/stripe/profile_storer.rb b/lib/stripe/profile_storer.rb index b4cccdb470..1806a48bd6 100644 --- a/lib/stripe/profile_storer.rb +++ b/lib/stripe/profile_storer.rb @@ -25,13 +25,17 @@ module Stripe private def options - options = { + { email: @payment.order.email, login: Stripe.api_key, address: address_for(@payment) - } - options = options.merge(stripe_account: @stripe_account_id) if @stripe_account_id.present? - options + }.merge(stripe_account_option) + end + + def stripe_account_option + return {} if @stripe_account_id.blank? + + { stripe_account: @stripe_account_id } end def address_for(payment)