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
[PAY-1829] Card Selection With Newly Created Payment Sheet Cards #1711
Conversation
…etup intent methods will update existing signals in pledge payment methods view and pledge view.
@scottkicks Hey Scott, just getting the hang of adding you to new PR's -- no need to review it or anything, feel free to post questions/comments if you want. |
Generated by 🚫 Danger |
@@ -8,6 +8,7 @@ public struct CreateBackingInput: GraphMutationInput, Encodable { | |||
let projectId: String | |||
let refParam: String? | |||
let rewardIds: [String] | |||
let setupIntentClientSecret: String? |
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.
Useful in the next ticket.
Codecov Report
@@ Coverage Diff @@
## main #1711 +/- ##
==========================================
+ Coverage 85.23% 85.26% +0.03%
==========================================
Files 1269 1269
Lines 113329 113813 +484
Branches 30068 30143 +75
==========================================
+ Hits 96598 97046 +448
- Misses 15684 15721 +37
+ Partials 1047 1046 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
📲 What
This PR address the selection logic of picking a card after it has been added via the new payment sheet.
🤔 Why
User should see newly added card for project with/without backing pre-selected. User should also be able to pick between pre-existing cards and newly created ones. (Both with the payment sheet and no).
🛠 How
configuredCards
is updated with new setup intent card datanewSetupIntentCards
after the flow controller has returned the display data (it's coupled with the setup intent for that display data only.)updatedCards
is now based onconfiguredCards
instead ofcards
, after its' been combined withnewSetupIntentCards
. PreviouslyupdatedCards
was used withdidSelectRowAt
which is the same as now, except the setup intent card data is combined in here as well.Previous flow:
cards
= user's fetched cards + new cards added through add new card pageconfiguredCards
=cards
(after some card selection logic)configuredCards
-->reloadPaymentMethods
updatedCards
=didSelectRowAt
+cards
updatedCards
-->reloadPaymentMethods
New flow:
cards
= user's fetched cards + new cards added through add new card pageconfiguredCards
=cards
(after some card selection logic)setupIntentConfiguredCards
=configuredCards
OR (inclusive)newSetupIntentCards
(re-select correct card if setup intent cards added)setupIntentConfiguredCards
-->reloadPaymentMethods
updatedCards
=setupIntentConfiguredCards
OR (inclusive)configuredCards
updatedCards
+didSelectRowAt
(re-select cards if setup intent cards were added) -->reloadPaymentMethods
Whenever setup intent card logic is combined with pre-existing
cards
, we re-configure the pledge display data for either one or the other card type display, because they are two different models.Also the payment source id OR the setup intent is passed to the pledge view for making the backing.
👀 See
Trello, screenshots, external resources?
After 🐛
Simulator.Screen.Recording.-.iPhone.8.-.2022-08-11.at.15.33.51.mp4
Before 🦋
Simulator.Screen.Recording.-.iPhone.8.-.2022-08-11.at.15.38.31.mp4
✅ Acceptance criteria
With
ios_payment_sheet
ON.pledge
contextWith
ios_payment_sheet
OFF.pledge
context⏰ TODO
CreateBackingData
toPledgeViewModel
in this ticket, as that is more aligned with the creation of the backing in the next ticket.