Closed ravinderk closed 2 years ago
This issue has been linked to a Canny post: Upsells should store the revenue correctly on forms created during the onboarding flow :tada:
@ravinderk, why does it ultimately matter? Isn't the string ultimately being cast as an integer? Or the integer as a string? Why does this break things?
@ravinderk, why does it ultimately matter? Isn't the string ultimately being cast as an integer? Or the integer as a string? Why does this break things?
I discuss this with @JasonTheAdams in Slack and on the pull request.
Details
I find out that donation level id stores in integer format for donation form which generated in onboarding. https://github.com/impress-org/givewp/blob/757e11895c8fd87cfa42d11d9eb8aa6ba1135a57/src/Onboarding/DefaultFormFactory.php#L150
Correct donation level id format is
string
. If we store donation level id as integer then, it is possible then at few place we will get wrong donation amount for that donation level ( if we are using strict type comparision ).Expected Behavior
Donation level id must store in integer format.
Steps to Reproduce
_give_donation_levels
meta key for donation form.Visuals
Expected
Result
Acceptance Criteria