The function should receive the entirety of the input from the client, returning a validation rule. The idea being to make it so that a developer can conditionally apply rules based on other input. For example, if the payment provider is stripe, make the source field required: true, otherwise, required: false.
The function should receive the entirety of the input from the client, returning a validation rule. The idea being to make it so that a developer can conditionally apply rules based on other input. For example, if the payment provider is
stripe
, make thesource
fieldrequired: true
, otherwise,required: false
.