Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Repos that we’ll change

...

Expand
titlefrontend/src/pages/cart/payment/order-payment/paycomet-hosted-page-payment/paycomet-hosted-page-payment.tsx

Return the new values from the useOrderPayment hook

Code Block
languagetypescript
const {
    // ... rest of code
    setIsPaycometNewMethodSelected,
    isPaycometNewMethodSelected,
  } = useOrderPayment({
    enableOrderTimedFire,
    onPriceOrder,
    serverOrder,
  });

Add a new condition for the paycomet form: I NEED TO VALIDATE THIS = WIP

Code Block
languagetsx
 // Add a new condition here
 {showAddPaymentMethod && showPaymentSodexo && showPaymentChequeGourmet && (
  <ConditionalWrapper
    condition={!paymentMethods.length}
    wrapper={children => <AddNewCreditCardWrapper>{children}</AddNewCreditCardWrapper>}
  >
    <PaycometCreditCardHostedPaymentForm
      rbiOrder={serverOrder}
      onResult={onPaymentOutcome}
      onChange={onChange}
      paymentValues={paymentValues}
      errors={errors}
      isCheckoutErrorsModalOpenPaycomet={isCheckoutErrorsModalOpenPaycomet}
      tpvToken={tpvToken}
      onError={(errorMessageId: TLocalizationKey) => {
        setShowAddPaymentMethod(false);
        setIsPaymentError(false);
        setIsCheckoutErrorsModalOpenPaycomet(true);
        setErrorOnPreAuth({ messageId: errorMessageId, hasError: true });
      }}
      preAuthCallback={() => {
        setIsPreauthLoading(true);
      }}
    />
  </ConditionalWrapper>
)}

...