This formats the text users enter on the card donation screen. For
example, "4242424242424242" becomes "4242 4242 4242 4242".
It uses [the `textField(_:shouldChangeCharactersIn:replacementString:)`
method of `UITextFieldDelegate`][0] to accomplish this, and implements a
helper that can handle all the cases (inserting, deleting, replacing,
pasting, and so on).
Tested this in an iPhone 14 simulator and on a physical iOS 12 device.
[0]: https://developer.apple.com/documentation/uikit/uitextfielddelegate/1619599-textfield
This adds very basic support for donations via credit/debit card. It's
missing important features which is why it's behind an internal-only
feature flag.
At a high level, this adds a new screen with a card form. This card data
is submitted to Stripe and then uses the same "rails" as our existing
Apple Pay donations.
This change is missing a few important features, intended to be added
soon:
- [3D Secure][3DS] support
- Validation error messages
- Input formatting (e.g., "1234" becomes "12/34")
- Gift badge support (currently only supports Apple Pay)
- Various smaller UI changes
[3DS]: https://stripe.com/docs/payments/3d-secure