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

Hiding messaging when external payments are provided #1425

Merged

Conversation

travjenkins
Copy link
Member

@travjenkins travjenkins commented Jan 17, 2025

Issues

contributes to #1419

Changes

1419

  • Use the payment method fetching when first logging in to check if the tenant uses external payment provider
  • Setting the message if it does. Leaving it blank to "hide" it and then allow us to easily add content if we want to in the future.

Tests

Manually tested

  • hit stripe and external payment tenants

Automated tests

  • unit testing covered

Playwright tests ran locally

  • Admin
  • Captures
  • Collections
  • HomePage
  • Login
  • Materialization

Screenshots

stripe payment for tenant
image

external payment for tenant
image

Adding a blank message in case we want to put something there
Updating store names to match what they're doing now
@travjenkins travjenkins marked this pull request as ready for review January 22, 2025 16:15
@travjenkins travjenkins requested a review from a team as a code owner January 22, 2025 16:15
Copy link
Member

@kiahna-tucker kiahna-tucker left a comment

Choose a reason for hiding this comment

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

Approved with suggestions.

Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason why this component shouldn't return null when an external payment method is detected? The argument I would make against returning null in this scenario is to more easily accommodate external payment method messaging in the future.

The only minor oddity with the current approach is that the loading state will still be displayed when externalPaymentMethod is true despite the message not having any content.

Comment on lines +73 to +80
return !tenantBillingDetails
? false
: tenantBillingDetails.some((tenantBillingDetail) => {
return (
tenantBillingDetail.tenant === selectedTenant &&
tenantBillingDetail.payment_provider === 'external'
);
});
Copy link
Member

Choose a reason for hiding this comment

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

Is there a benefit to using a ternary as opposed to the nullish coalescing operator?

@travjenkins travjenkins merged commit 449fa4a into main Jan 23, 2025
3 checks passed
@travjenkins travjenkins deleted the travjenkins/bug/fix-billing-content-for-external-payments branch January 23, 2025 17:29
@travjenkins travjenkins added the change:planned This is a planned change label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:planned This is a planned change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants