Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Pay - finalizing authorization sheet and thank you toast presentation #4641

Merged
merged 14 commits into from
Oct 3, 2023

Conversation

tonisevener
Copy link
Collaborator

@tonisevener tonisevener commented Sep 25, 2023

Phabricator:
https://phabricator.wikimedia.org/T345852
https://phabricator.wikimedia.org/T288285

Notes

This PR represents the last pieces needed to get the Donate form to display the payment sheet and thank you toast once the submitPayment call succeeds. I expect smaller followup PRs will be needed once the endpoints are finalized.

This PR is dependent on #4619.

Test Steps

Prep work: On a test device, log out of your iCloud account in device settings, and log into a sandbox testing account (see iOS Sandbox Tester details in 1Password). Do not enable 2-factor if prompted. Once logged into sandbox account, go to the Apple Wallet app and add a sandbox testing card. (I have had luck with the top Discover one).

To test Xcode Cloud script injection:

  1. Download the ad-hoc build from Staging build number 43 in App Store Connect and drag it to a connected device on your machine.
  2. Confirm you can successfully go through steps 3 - 5 below

To test locally:

  1. From repo root directory, run this command in terminal: ./scripts/copy_staging_environment_vars.sh "{merchantID}" "ABCDPaymentAPIKeyEFGH" replacing {merchantID} with our test merchant ID. Reach out to me if you need help finding this. This payment API key is fake, but we aren't using it in the endpoint calls yet so this is just to confirm it gets copied to the Info.plist file properly.

  2. After running, confirm you see a change in Staging-Info.plist (added MerchantID and PaymentsAPIKey) and Wikipedia.entitlements (added merchant ID to com.apple.developer.in-app-payments key) in git.

  3. Launch app. Background, foreground, and pull to refresh Explore feed to trigger config fetches.

  4. Go through the form and tap the Apple Pay button. Confirm you now see a payment authorization sheet. Confirm you are prompted to enter billing address, name, and email details if needed, and can complete a payment.

  5. Confirm after completing payment, you are taken back to the Settings root and see a thank you toast.

Note: Just an FYI. For the Staging app, we are mocking the donate endpoint calls, thanks to a temporary commit in the first PR. This mocking commit is reverted in the next PR (#4645)

@tonisevener tonisevener added the Dependent PR PR is dependent on another PR - merge dependent PR first and update branch before merging label Sep 25, 2023
@tonisevener tonisevener requested review from a team and mazevedofs and removed request for a team September 25, 2023 18:59
Copy link
Collaborator

@mazevedofs mazevedofs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependent PR PR is dependent on another PR - merge dependent PR first and update branch before merging
2 participants