fix(recurly): remove conditional fraud instantiation #764
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The conditional check before instantiation of the
fraud
attribute makes the calls to the.configure()
idempotent after the first one. For instance, if some user visits the payment form, the first visit will have thefraud_session_id
and other fields injected successfully. But if the user decides to take a tour and return to the payment form, the second.configure()
will have no effect and no fraud attributes will be available.Here we have two forms as an example. The second one, calls the
.configure()
after a few seconds which has no effect on creating the fraud attributes.With the fix in this PR, the fraud object instantiates with every
.configure()
call and the attributes are available in the second form.Currently, we put
delete window.recurly.fraud
before the call to.configure()
in our code to mitigate the problem but we thought it was better to create this PR.