Skip to content

Commit

Permalink
Only try to load Stripe's PaymentMethodMessagingElement on supported …
Browse files Browse the repository at this point in the history
…methods on block checkout (#8648)
  • Loading branch information
brettshumaker authored and elazzabi committed Apr 16, 2024
1 parent 9a93ac2 commit 10d107a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog/fix-only-try-to-load-pmme-on-bnpl-methods
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: This is a quick fix to another item already in the changelog.


5 changes: 2 additions & 3 deletions client/checkout/blocks/payment-method-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default ( {
upeAppearanceTheme,
} ) => {
const cartData = wp.data.select( 'wc/store/cart' ).getCartData();
const bnplMethods = [ 'affirm', 'afterpay_clearpay', 'klarna' ];

// Stripe expects the amount to be sent as the minor unit of 2 digits.
const amount = normalizeCurrencyToMinorUnit(
Expand All @@ -27,13 +28,11 @@ export default ( {
cartData.billingAddress.country ||
window.wcBlocksCheckoutData.storeCountry;

// console.log( currentCountry );

return (
<>
<span>
{ upeConfig.title }
{ upeName !== 'card' &&
{ bnplMethods.includes( upeName ) &&
( upeConfig.countries.length === 0 ||
upeConfig.countries.includes( currentCountry ) ) && (
<>
Expand Down

0 comments on commit 10d107a

Please sign in to comment.