AW-46-changePaymentForm
This commit is contained in:
parent
04254c4a83
commit
b51fc34b7f
@ -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>
|
||||
)}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user