-
Notifications
You must be signed in to change notification settings - Fork 997
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
Update promo in MPE after bank flow #4370
base: master
Are you sure you want to change the base?
Conversation
🚨 New dead code detected in this PR: StripeAttestBackend.swift:24 warning: Parameter 'appId' is unused
StripeAttestBackend.swift:24 warning: Parameter 'deviceId' is unused
StripeAttestBackend.swift:24 warning: Parameter 'keyId' is unused
StripeAttestBackend.swift:20 warning: Parameter 'attestation' is unused
StripeAttestBackend.swift:14 warning: Property 'apiClient' is assigned, but never used
SavedPaymentMethodRowButton.swift:9 warning: Imported module 'StripeCore' is unused Please remove the dead code before merging. If this is intentional, you can bypass this check by adding the label ℹ️ If this comment appears to be left in error, double check that the flagged code is actually used and/or make sure your branch is up-to-date with |
5ad3d19
to
b83e20a
Compare
2ed15ab
to
242910b
Compare
b83e20a
to
e564e9e
Compare
cabfd94
to
98c8d0d
Compare
1e979a0
to
d9df82d
Compare
...Sheet/Source/PaymentSheet/Vertical Main Screen/VerticalPaymentMethodListViewController.swift
Outdated
Show resolved
Hide resolved
2bba9f1
to
8d2951b
Compare
@@ -164,6 +169,11 @@ final class InstantDebitsPaymentMethodElement: ContainerElement { | |||
|
|||
return nameValid && emailValid && phoneValid && addressValid | |||
} | |||
|
|||
var displayableIncentive: PaymentMethodIncentive? { | |||
let canShowIncentive = linkedBank?.incentiveEligible ?? true |
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.
Any reason we default to true
here? I'd expect the opposite
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.
If we don’t have a linked bank yet (and therefore no info if the session is eligible), we assume that the link_consumer_incentive
as coming from the backend is valid. Otherwise, we would never show the incentive before the user completes the flow 🙈
...StripePaymentSheet/Source/PaymentSheet/USBankAccount/InstantDebitsPaymentMethodElement.swift
Outdated
Show resolved
Hide resolved
...Sheet/Source/PaymentSheet/Vertical Main Screen/VerticalPaymentMethodListViewController.swift
Outdated
Show resolved
Hide resolved
19ff93c
to
8ae81af
Compare
7700e8a
to
4314eaf
Compare
8ae81af
to
10b949a
Compare
2076970
to
d965bd7
Compare
07039d1
to
a5db3ad
Compare
ca06961
to
96174cc
Compare
StripePaymentSheet- case integrationError(nonPIIDebugDescription: Swift.String) If you are adding a new public API consider the following:
If you are modifying or removing a public API:
If you confirm these APIs need to be added/updated and have undergone necessary review, add the label ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with |
- Rename `updateLinkedBank` to `renderLinkedBank` for greater clarity - Add explanatory comment to `canShowIncentive` - Make `refreshContent` a method instead of a property
8a63335
to
3f88f40
Compare
|
||
import Foundation | ||
|
||
protocol IncentiveOwner { |
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.
Ideas for better names are welcome!
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.
Maybe IncentiveDisplayable
or IncentiveBadgeDisplayer
- none are really great though 🤷
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.
I'm also curious your thoughts on making a protocol for this. Seems to only be one class conforming to it at the moment. I guess I'm wondering if showIncentiveInHeader
could just be a concrete property on InstantDebitsPaymentMethodElement
?
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 - some minor comments / questions
|
||
import Foundation | ||
|
||
protocol IncentiveOwner { |
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.
Maybe IncentiveDisplayable
or IncentiveBadgeDisplayer
- none are really great though 🤷
@@ -186,6 +186,8 @@ class RowButton: UIView { | |||
} | |||
}() | |||
promoBadge.translatesAutoresizingMaskIntoConstraints = false | |||
promoBadge.isUserInteractionEnabled = false | |||
promoBadge.isAccessibilityElement = false |
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.
What does this mean? We don't want it to be picked up by screen readers?
@@ -119,7 +148,7 @@ class VerticalPaymentMethodListViewController: UIViewController { | |||
promoText: incentive?.takeIfAppliesTo(paymentMethodType)?.displayText, | |||
appearance: appearance, | |||
// Enable press animation if tapping this transitions the screen to a form instead of becoming selected | |||
shouldAnimateOnPress: !delegate.shouldSelectPaymentMethod(selection) | |||
shouldAnimateOnPress: delegate?.shouldSelectPaymentMethod(selection) == true |
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.
I'm a bit confused about this change - it now does the inverse? Is the comment above still accurate?
|
||
import Foundation | ||
|
||
protocol IncentiveOwner { |
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.
I'm also curious your thoughts on making a protocol for this. Seems to only be one class conforming to it at the moment. I guess I'm wondering if showIncentiveInHeader
could just be a concrete property on InstantDebitsPaymentMethodElement
?
Summary
This pull request adds code to refresh the MPE’s promo information after the bank auth flow completes. If no incentive is available, the promo badge in the carousel and bank form should be updated accordingly.
Motivation
CONSUMERBANK-571
Testing
Changelog