-
Notifications
You must be signed in to change notification settings - Fork 118
Shipping Labels: Support adding new payment method on web view #15700
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
Shipping Labels: Support adding new payment method on web view #15700
Conversation
…nt-settings' into woomob-433-payment-handle-adding-a-payment-method-on-a-web-view
|
@itsmeichigo sorry for the delay you are experiencing in this PR... I pushed #15702 with my progress in fixing the Sourcery configuration. From one of the commits: WooFoundation When updating WooFoundation to be a Swift package, see #15651, I neglected updating the Codegen/Sourcery configuration. In the migration from framework to package, we lost the Xcode project file. Sourcery provides a The only option I could find was to list The side effect of this change has been that the generated file lost the module name. Networking It seems that after migrating the Networking project to synchronized folders, #15653, Sourcery could no longer access the sources. The only fix I could find was to move from passing a Here, too, the side effect has been that the generated file lost the module name. Unfortunately, the missing module is resulting in name clashes. I found a way to avoid some, but it results in a different issue. 🙄 I might need to rethink the whole fakes and copiable implementation to cope with this. In the meantime, I'm afraid my best suggestion to unblock this is to manually edit the Sourcery files based on what it's been generated in #15702 diff --git a/Fakes/Fakes/Networking.generated.swift b/Fakes/Fakes/Networking.generated.swift
index c225813701..a530f67b8c 100644
--- a/Fakes/Fakes/Networking.generated.swift
+++ b/Fakes/Fakes/Networking.generated.swift
@@ -1871,7 +1871,8 @@ extension Networking.ShippingLabelAccountSettings {
selectedPaymentMethodID: .fake(),
isEmailReceiptsEnabled: .fake(),
paperSize: .fake(),
- lastSelectedPackageID: .fake()
+ lastSelectedPackageID: .fake(),
+ addPaymentMethodURL: .fake()
)
}
} |
Thank you @mokagio for the suggestion! I'll follow that solution to unblock this PR 🙇 |
As CI reports, we are now failing with
|
@itsmeichigo given I couldn't sort out Sourcery yesterday, the least I could do was getting the build to green today. Hope this help as a temporary workaround... |
…method-on-a-web-view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Works as described.
🔵 Tracked wcs_payment_step, properties: [is_wpcom_store: false, blog_id: -1, plan: , site_url: {…}, was_ecommerce_trial: false, state: started, store_id: {…}]
🔵 Tracked wcs_payment_step, properties: [was_ecommerce_trial: false, state: add_payment_method_button_tapped, plan: , blog_id: -1, site_url: {…}, store_id: {…}, is_wpcom_store: false]
🔵 Tracked wcs_payment_step, properties: [state: payment_method_added, was_ecommerce_trial: false, is_wpcom_store: false, site_url: {…}, blog_id: -1, store_id: {…}, plan: ]
🔵 Tracked wcs_payment_step, properties: [blog_id: -1, is_wpcom_store: false, site_url: {…}, state: started, was_ecommerce_trial: false, plan: , store_id: {…}]
After re opening web view to add another card:
🔵 Tracked wcs_payment_step, properties: [store_id: {…}, plan: , state: add_payment_method_button_tapped, site_url: {…}, was_ecommerce_trial: false, is_wpcom_store: false, blog_id: -1]
After adding another card
🔵 Tracked wcs_payment_step, properties: [was_ecommerce_trial: false, store_id: {…}, site_url: {…}, is_wpcom_store: false, state: payment_method_added, blog_id: -1, plan: ]
After selecting the second card as a payment method
🔵 Tracked wcs_payment_step, properties: [store_id: {…}, state: payment_method_selected, blog_id: -1, site_url: {…}, is_wpcom_store: false, plan: , was_ecommerce_trial: false]
Closes WOOMOB-433
Also closes WOOMOB-493
Description
This PR adds a new web view to support adding new payment methods for the shipping label purchase flow.
Tracking for the states of the payment step has also been added following the tracking plan in pe5sF9-4hO-p2.
Tesing steps
Since adding test payment methods is not available on mobile web view (see pfOicC-4C-p2#comment-580), it's more straightforward to test with real payment methods for this PR. You can do this by setting up a test site with Jurassic Ninja and install the Woo Shipping plugin without setting up the testing environment for the plugin. Ensure to connect the site's Jetpack with your WPCom account to enable adding payment methods later. Remove any existing payment methods before testing.
wcs_payment_step
is tracked in Xcode console withstate: started
.wcs_payment_step
is tracked withstate: add_payment_method_button_tapped
. Confirm that a web view is presented for adding a new payment method.wcs_payment_step
is tracked withstate: state: payment_method_added
. If this is the first payment method added, confirm that the payment methods sheet is dismissed automatically and the new card is displayed in the Shipment Details sheet.wcs_payment_step
is tracked withstate: add_payment_method_button_tapped
. The same web view for adding payment method should be displayed.wcs_payment_step
is tracked withstate: state: payment_method_added
.wcs_payment_step
is tracked withstate: payment_method_selected
.Testing error reloading payment methods:
GET wcshipping/v1/account/settings
endpoint.Testing information
Tested and confirmed all the above tests with simulator iPhone 16 iOS 18.4.
Screenshots
Presenting web view:
Simulator.Screen.Recording.-.iPhone.16.-.2025-06-04.at.15.50.44.mp4
First payment method added:
Simulator.Screen.Recording.-.iPhone.16.-.2025-06-04.at.16.00.49.mp4
Non-first payment method added:
Simulator.Screen.Recording.-.iPhone.16.-.2025-06-04.at.16.20.14.mp4
Error reloading payment methods:
RELEASE-NOTES.txt
if necessary.