From b8457ebeced22747eaadfd7553eb0d7b67371d98 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Thu, 16 Jan 2020 13:18:59 +0000 Subject: [PATCH] Make profile storer a bit easier to read --- lib/stripe/profile_storer.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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)