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

Update promo in MPE after bank flow #4370

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Dec 18, 2024

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

Copy link

github-actions bot commented Dec 18, 2024

🚨 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 skip dead code check to this PR.

ℹ️ 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 master.

@tillh-stripe tillh-stripe force-pushed the tillh/ibp-incentives-fetch-available-incentives branch 2 times, most recently from 5ad3d19 to b83e20a Compare December 20, 2024 14:31
@tillh-stripe tillh-stripe force-pushed the tillh/ibp-incentives-update-mpe-after-flow branch 3 times, most recently from 2ed15ab to 242910b Compare December 20, 2024 19:43
@tillh-stripe tillh-stripe force-pushed the tillh/ibp-incentives-fetch-available-incentives branch from b83e20a to e564e9e Compare December 20, 2024 19:44
@tillh-stripe tillh-stripe force-pushed the tillh/ibp-incentives-fetch-available-incentives branch 5 times, most recently from cabfd94 to 98c8d0d Compare January 13, 2025 14:52
Base automatically changed from tillh/ibp-incentives-fetch-available-incentives to master January 13, 2025 16:18
@tillh-stripe tillh-stripe force-pushed the tillh/ibp-incentives-update-mpe-after-flow branch 2 times, most recently from 1e979a0 to d9df82d Compare January 13, 2025 21:25
@tillh-stripe tillh-stripe force-pushed the tillh/ibp-incentives-update-mpe-after-flow branch 3 times, most recently from 2bba9f1 to 8d2951b Compare January 14, 2025 16:40
mats-stripe
mats-stripe previously approved these changes Jan 14, 2025
@@ -164,6 +169,11 @@ final class InstantDebitsPaymentMethodElement: ContainerElement {

return nameValid && emailValid && phoneValid && addressValid
}

var displayableIncentive: PaymentMethodIncentive? {
let canShowIncentive = linkedBank?.incentiveEligible ?? true
Copy link
Collaborator

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

Copy link
Collaborator Author

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 🙈

@tillh-stripe tillh-stripe force-pushed the tillh/ibp-incentives-update-mpe-after-flow branch 2 times, most recently from 19ff93c to 8ae81af Compare January 16, 2025 20:15
@tillh-stripe tillh-stripe changed the base branch from master to tillh/ibp-incentives-header-badge-again January 16, 2025 20:15
@tillh-stripe tillh-stripe force-pushed the tillh/ibp-incentives-header-badge-again branch from 7700e8a to 4314eaf Compare January 16, 2025 21:12
- Rename `updateLinkedBank` to `renderLinkedBank` for greater clarity
- Add explanatory comment to `canShowIncentive`
- Make `refreshContent` a method instead of a property
@tillh-stripe tillh-stripe force-pushed the tillh/ibp-incentives-update-mpe-after-flow branch from 8ae81af to 10b949a Compare January 16, 2025 21:13
Base automatically changed from tillh/ibp-incentives-header-badge-again to master January 17, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants