Page MenuHomePhabricator

Apple Pay: Donate form UI work
Closed, ResolvedPublic

Assigned To
None
Authored By
Tsevener
Sep 7 2023, 2:09 PM
Referenced Files
F38207699: IMG_0240.PNG
Oct 11 2023, 4:28 PM
F38207195: Settings 3.jpeg
Oct 11 2023, 3:38 PM
F37987767: IMG_3784017D5C4A-1.jpeg
Oct 5 2023, 6:58 PM
F37987685: IMG_0F3E1D6EFC74-1.jpeg
Oct 5 2023, 5:58 PM
F37738149: IMG_98CF832A83EE-1.jpeg
Sep 19 2023, 1:10 PM
F37738143: IMG_BBD973AECA1B-1.jpeg
Sep 19 2023, 1:10 PM
F37737599: IMG_3784017D5C4A-1.jpeg
Sep 19 2023, 1:10 PM
F37737591: IMG_8A2419376517-1.jpeg
Sep 19 2023, 1:10 PM

Description

This subtask covers the native donation form UI work. See parent task for design details.

Technical Details

  • Build out donate form that with default amount button options, and a textfield for inputting custom options, as well as a transaction fee checkbox and email opt-in checkbox.
  • Form needs to be able to take in a particular currency and country code, in case they came from a campaign plea that specifies a particular currency and country code.
  • Default amount button option values, minimum and maximum donation values, and transaction fee amount need to be dynamic depending on currency. Email me checkmark visibility also changes depending on country code. This mapping will be fetched from the donate config (see T345847).
  • Formatting here also needs to be based on device’s region, so that decimals/etc are formatted correctly for that user’s region.
  • Form needs to have a checkbox for monthly recurring that sends the "recurring" boolean to the submitPayment endpoint.

Background: https://docs.google.com/document/d/1fXdHRknr8gz5Pou8PHFujIpb8Im06rDWdW04liFH42s/edit.

Testing Notes

This can be tested starting in Wikipedia TestFlight 7.4.3 (2809) build.

Testing tips:
All new donor experience work (in-app web view, new campaign modals with maybe later, multilingual campaign support, Apple Pay native donation) are set up to become available in the app only once the Netherlands or Italy Oct/Nov 2023 campaigns become valid.

  1. Device iOS Settings > Language & Region > Region needs to be set to either the Netherlands or Italy
  2. Device date & time needs to be set on or after the campaign start date (change device date to 10/17)
  3. After fresh install, you must background and foreground the app, then pull to refresh on the Explore feed to trigger a force refresh of the campaign data.
  4. To be provided the option to donate via Apple Pay (native donate form), you must have a valid card set up in Apple Wallet.

Event Timeline

PR: https://github.com/wikimedia/wikipedia-ios/pull/4629

@scblr Form UI is in TestFlight Experimental build #42. Please design review this form UI. Banner and Apple Pay action sheet choice is not in place yet. The flow after tapping the Apple Pay button is not in place yet either.

Test steps:

  1. On fresh install, force load announcements. Do this by backgrounding once, then pulling to refresh on the Explore feed. This populates the configs we need to display the form.
  2. Go to Settings > Donate. Design review across multiple themes and dynamic type sizes. Also please check minimum amount error handling.
  3. It may be helpful to look at the config, to see what to expect for each currency code and/or country code. The email opt-in only appears for certain countries, and different default amounts and transaction fees appear for different currencies. You can change your currency and country code by adjusting iOS Settings > Language and Region, change region and language.

Thanks @Tsevener – you themed it perfectly! 👏 Here’s some feedback:

1) Change copy to Donate to Wikipedia.

IMG_B82B867FAC6C-1.jpeg (2×1 px, 240 KB)

2) Remove the external link icon.

IMG_B82B867FAC6C-1 copy.jpeg (2×1 px, 242 KB)

3) Done button is too large.

IMG_CF3512266DAA-1.jpeg (2×1 px, 254 KB)

4) After selecting an amount, it’s possible to delete the entire input field (including the currency). Only the amount should be selectable/deletable.

IMG_0940.PNG (2×1 px, 371 KB)
IMG_0941.PNG (2×1 px, 262 KB)

5) Make sure to reset all input field contents and set them to the above (button) values. Here’s a video that shows that some values from the previous selection are kept.

6) Can we show the PTF (pay the fee) checkbox after users have typed or selected an amount? Here’s an example from the web banner. Otherwise, this situation could happen (no amount selected yet).

IMG_8A2419376517-1.jpeg (2×1 px, 255 KB)
IMG_3784017D5C4A-1.jpeg (2×1 px, 255 KB)

Bonus: it has proven to impact a higher average gift if the checkbox is shown after users select an amount.

7) Is there any way to hide the numbers when it’s empty/when users enter the form/flow?

Like thisNot this
IMG_BBD973AECA1B-1.jpeg (2×1 px, 544 KB)
IMG_98CF832A83EE-1.jpeg (2×1 px, 561 KB)

The difference is (US example): rather than entering cents, users type in dollars first on their keyboard (higher donations). We can still show the cents (e.g. *.00) once users hit Done.

@scblr I fixed a few of your lighter-weight issues (3 and 5, small change to improve the 6 situation) in the PR, but I will need to come back later to the more difficult ones. I will do the Settings tweaks as a part of a different task (this one is only for the form UI). Unfortunately with the textfield, what I'm using is what SwiftUI gives us out-of-the-box, and I'm finding it difficult to customize. Once we get further along in development, feel free to spin up another task with those improvements.

@scblr I fixed a few of your lighter-weight issues (3 and 5, small change to improve the 6 situation) in the PR, but I will need to come back later to the more difficult ones. I will do the Settings tweaks as a part of a different task (this one is only for the form UI). Unfortunately with the textfield, what I'm using is what SwiftUI gives us out-of-the-box, and I'm finding it difficult to customize. Once we get further along in development, feel free to spin up another task with those improvements.

Sounds good, thanks @Tsevener 👍👍👍

@cmadeo Ready for more design review. This has been through one round but we are closer to the end-to-end flow now, so we can try another round. Here are some more involved test steps to trigger the payment sheet:

  1. Download TestFlight Experimental build # 7.4.3(45) on a test device.
  2. Log out of your usual testing Apple ID in iOS Settings, and instead log into the "iOS Sandbox Tester Apple ID" in 1Password. Do not enable 2 factor when prompted on the security modal (choose Other options), since this is a shared account.
  3. Now add a Test card in Apple Wallet. I've had luck with the top Discover one.
  4. Change your device region (Settings > General > Language and Region) to the Netherlands to qualify for our faked active campaign.
  5. Open the Experimental app. Background, then foreground, then pull to refresh on the Explore feed to trigger campaigns to fetch.
  6. Go to Settings. Tapping "Donate to Wikipedia" should now prompt you with an Apple Pay or Other method choice. Tap into the Apple Pay option.
  7. Fill out amount and tap the Apple Pay button. Fill out billing address and email in the payment sheet (this can be fake information). Then authorize the payment.
  8. Payment should succeed (this is all faked) and you will be popped back to Settings with the thank you toast.

Hi @Tsevener apologies if this are issue is one that should have new task written for it for later based on your comment from Fri, Sep 22.

IMG_0F3E1D6EFC74-1.jpeg (2×1 px, 500 KB)
I can currently delete the currency in the text box

Additionally I'm still seeing the issue described by Robin above as #6

apologies if this are issue is one that should have new task written for it for later based on your comment from Fri, Sep 22.

@cmadeo thanks for catching that! Yeah, I haven't had time yet to revisit and see how far I can get with a custom textfield...right now this is what I can do with SwiftUI's default currency textfield handling. Please spin up a separate task for this if you don't mind, we can hash out soon if we think it's a blocker or not.

Additionally I'm still seeing the issue described by Robin above as #6

The minor improvement I made for #6 is that now I don't do minimum validation immediately after tapping the transaction fee checkbox, so that this screenshot from his feedback no longer occurs:

IMG_3784017D5C4A-1.jpeg (2×1 px, 255 KB)

Hiding the checkbox would require a heavier lift and might introduce more bugs with this form, so I went with this. Let me know if this is okay, thanks!

cmadeo removed cmadeo as the assignee of this task.Oct 5 2023, 7:09 PM

@Tsevener Thanks for letting me know! I'll spin up a new task for the text box and will move this task over to the next column.

@cmadeo Please let me know if this new "Apple is not in charge of raising money for this purpose." fine print looks ok. See https://phabricator.wikimedia.org/T346823#9229993 for background. Thanks!

Settings 3.jpeg (2×1 px, 572 KB)

Design review passed on this screenshot:

IMG_0240.PNG (1×642 px, 155 KB)