Skip to content

Shipping Labels: Show existing payment methods for selection #15679

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

Conversation

itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented May 28, 2025

Closes WOOMOB-434

Description

This PR adds UI updates to show existing payment methods for a store in the shipping label purchase flow. Button actions will be handle in subsequent PRs.

Testing steps

  1. Log in to a test store set up with the WooShipping plugin.
  2. Navigate to the Orders tab and select a paid order with physical products and unfulfilled shipments.
  3. If your store already has no payment methods set up, put a breakpoint in Proxyman for responses of API request path path=/wcshipping/v1/account/setting. When this breakpoint stops, add the payment methods to the response.
  4. Select Create Shipping Label > Expand Shipment details bottom sheet > Select payment method.
  5. Confirm that:
  • The presented sheet contains all existing credit/debit cards added to the test store.
  • The currently selected payment method is pre-selected.
  • The email receipt toggle state matches the current settings.
  • The Use this card button is only enabled either when a new payment method is selected or when the email receipt toggle is switched.
  • The sheet still looks good if there are no existing payment methods.

Testing information

Tested and confirmed using simulator iPhone 16 iOS 18.4 in light & dark modes with different font sizes. Both portrait and landscape modes look good.

Screenshots


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@itsmeichigo itsmeichigo added this to the 22.5 milestone May 28, 2025
@itsmeichigo itsmeichigo added type: task An internally driven task. feature: shipping labels Related to creating, ordering, or printing shipping labels. labels May 28, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 28, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Number30205
VersionPR #15679
Bundle IDcom.automattic.alpha.woocommerce
Commit5651dfe
Installation URL4laedk8q8hj40
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@itsmeichigo itsmeichigo marked this pull request as ready for review May 28, 2025 12:14
@itsmeichigo itsmeichigo marked this pull request as draft May 28, 2025 12:15
Comment on lines +22 to +28
HStack(alignment: .top) {
Image(systemName: "info.circle")
Text(String(format: Localization.note, viewModel.storeOwnerUsername))
.frame(maxWidth: .infinity, alignment: .leading)
}
.font(.footnote)
.foregroundStyle(Color.primary)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This view is inconsistent in the design. I'm using the style used in both the design for existing payment methods and the one for shop managers.

@itsmeichigo itsmeichigo modified the milestones: 22.5, 22.6 May 29, 2025
@itsmeichigo itsmeichigo marked this pull request as ready for review May 29, 2025 04:01
@itsmeichigo itsmeichigo requested a review from RafaelKayumov June 2, 2025 09:32
@RafaelKayumov RafaelKayumov self-assigned this Jun 3, 2025
Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

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

LGTM. Tested - works as described. Left a couple of questions.

Another question. Tested the edge case with many payment methods. In case if the selected method has a distant position in a long list, it won't be visible right after presenting the bottom sheet. Should we address that and always show the selected method on top of the list despite its original position? Or may me scroll to the selected method on pre-selection?

Simulator.Screen.Recording.-.iPhone.16.-.2025-06-03.at.13.00.03.mp4

@@ -18,13 +19,41 @@ struct WooShippingPaymentMethodsView: View {
paymentMethodList
}

HStack(alignment: .top) {
Image(systemName: "info.circle")
Text(String(format: Localization.note, viewModel.storeOwnerUsername))
Copy link
Contributor

Choose a reason for hiding this comment

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

This view is inconsistent in the design. I'm using the style used in both the design for existing payment methods and the one for shop managers.

Were you mentioning the inconsistency in note appearance between empty / non empty states in designs?
NIT: The note in the design contains a user first name + last name and the @ username wrapped in angle brackets.

Снимок экрана 2025-06-03 в 13 12 49

Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: the note and padding look a bit different for empty state comparing to design:

Снимок экрана 2025-06-03 в 13 12 10

Copy link
Contributor Author

@itsmeichigo itsmeichigo Jun 3, 2025

Choose a reason for hiding this comment

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

Were you mentioning the inconsistency in note appearance between empty / non empty states in designs?

Yes, I mean details like the (i) icon and the text color. I decided to use unify the styles for simplicity.

NIT: The note in the design contains a user first name + last name and the @ username wrapped in angle brackets.

NIT: the note and padding look a bit different for empty state comparing to design:

I'll update these as part of #15705

@itsmeichigo
Copy link
Contributor Author

Another question. Tested the edge case with many payment methods. In case if the selected method has a distant position in a long list, it won't be visible right after presenting the bottom sheet. Should we address that and always show the selected method on top of the list despite its original position? Or may me scroll to the selected method on pre-selection?

Good idea. I added the sorting for the list in #15705. Since this PR is the base of 2 other PRs, I'll merge this for now.

@itsmeichigo itsmeichigo merged commit a795a99 into trunk Jun 3, 2025
13 checks passed
@itsmeichigo itsmeichigo deleted the woomob-434-payment-update-the-payment-method-sheet-with-existing branch June 3, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: shipping labels Related to creating, ordering, or printing shipping labels. type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants