Skip to content

Commit

Permalink
fix: payment provider ID detection
Browse files Browse the repository at this point in the history
fix: payment provider ID detection
  • Loading branch information
shahednasser authored Jun 10, 2024
2 parents 3b5eeaa + b533d21 commit 179a245
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/checkout/components/payment-button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ const PaymentButton: React.FC<PaymentButtonProps> = ({

const paymentSession = cart.payment_collection?.payment_sessions?.[0]

switch (paymentSession?.provider_id) {
case "stripe":
switch (true) {
case paymentSession?.provider_id.startsWith("pp_stripe_"):
return (
<StripePaymentButton
notReady={notReady}
cart={cart}
data-testid={dataTestId}
/>
)
case "manual":
case "pp_system_default":
case paymentSession?.provider_id.startsWith("manual"):
case paymentSession?.provider_id.startsWith("pp_system_default"):
return (
<ManualTestPaymentButton notReady={notReady} data-testid={dataTestId} />
)
case "paypal":
case paymentSession?.provider_id.startsWith("pp_paypal"):
return (
<PayPalPaymentButton
notReady={notReady}
Expand Down

0 comments on commit 179a245

Please sign in to comment.