Default Braintree configuration on store creation overwrites custom configuration
mdesantis opened this issue · 0 comments
mdesantis commented
Building the default Braintree configuration record on store creation doesn't check whether a braintree configuration already exists:
solidus_paypal_braintree/app/models/spree/store_decorator.rb
Lines 4 to 10 in 73e9a69
overwriting a custom configuration on store creation:
store = Spree::Store.new(
code: 'some unique store code',
name: 'name',
url: 'example.com',
mail_from_address: 'store@example.com'
)
store.build_braintree_configuration(
credit_card: true,
paypal: true,
apple_pay: true
)
store.save!
store.braintree_configuration #=> ... paypal: false, apple_pay: false, credit_card: false>