solidusio / solidus_braintree

💳 Integrate Solidus with Braintree
https://www.braintreepayments.com/
BSD 3-Clause "New" or "Revised" License
19 stars 55 forks source link

Fix: user should still be able to disable data collection in a SolidusBraintree hosted form #126

Closed gsmendoza closed 1 year ago

gsmendoza commented 1 year ago

Expected behavior

Given I have installed SolidusBraintree on my Solidus app And I have disabled the use_data_collector preference (see https://github.com/solidusio/solidus_braintree#disabling-the-data-collector) And I have enabled the Hosted Fields credit card form When I run the app Then the Hosted Fields credit card form should not use the data collector And the app should not collect device data

Current behavior

The hosted form uses the data collector regardless of the use_data_collector preference setting. See https://github.com/solidusio/solidus_braintree/blob/3817011ef6c12576429202b00083ea7d0e7190c7/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/hosted_form.js#L10.

Background

We enabled useDataCollector for SolidusBraintree.HostedForm in https://github.com/solidusio/solidus_braintree/pull/116.