AW-46-changePaymentForm

This commit is contained in:
Денис Катаев 2024-04-25 14:35:13 +00:00 committed by Daniil Chemerkin
parent 04254c4a83
commit b51fc34b7f
2 changed files with 9 additions and 13 deletions

View File

@ -46,22 +46,16 @@ function PaymentModal({
useState<string>("");
const [isLoading, setIsLoading] = useState(true);
const [isError, setIsError] = useState<boolean>(false);
const [isStripePaymentButtonEnabled, setIsStripePaymentButtonEnabled] =
useState<boolean>(false);
const paymentMethodsButtons = useMemo(() => {
if (!isStripePaymentButtonEnabled) {
return paymentMethods.filter(
(method) => method.id !== EPaymentMethod.PAYMENT_BUTTONS
);
}
// return paymentMethods.filter(
// (method) => method.id !== EPaymentMethod.PAYMENT_BUTTONS
// );
return paymentMethods;
}, [isStripePaymentButtonEnabled]);
}, []);
const [selectedPaymentMethod, setSelectedPaymentMethod] = useState(
isStripePaymentButtonEnabled
? EPaymentMethod.PAYMENT_BUTTONS
: EPaymentMethod.CREDIT_CARD
EPaymentMethod.PAYMENT_BUTTONS
);
const onSelectPaymentMethod = (method: EPaymentMethod) => {
@ -170,7 +164,6 @@ function PaymentModal({
client_secret={clientSecret}
subscriptionReceiptId={subscriptionReceiptId}
returnUrl={window.location.href}
setCanMakePayment={setIsStripePaymentButtonEnabled}
/>
</div>
)}

View File

@ -24,6 +24,9 @@
.payment-method-container {
width: 100%;
display: flex;
flex-direction: column;
gap: 24px;
}
.address {
@ -41,4 +44,4 @@
.address {
color: gray;
font-size: 10px;
}
}