AW-46-changePaymentForm
This commit is contained in:
parent
04254c4a83
commit
b51fc34b7f
@ -46,22 +46,16 @@ function PaymentModal({
|
|||||||
useState<string>("");
|
useState<string>("");
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [isError, setIsError] = useState<boolean>(false);
|
const [isError, setIsError] = useState<boolean>(false);
|
||||||
const [isStripePaymentButtonEnabled, setIsStripePaymentButtonEnabled] =
|
|
||||||
useState<boolean>(false);
|
|
||||||
|
|
||||||
const paymentMethodsButtons = useMemo(() => {
|
const paymentMethodsButtons = useMemo(() => {
|
||||||
if (!isStripePaymentButtonEnabled) {
|
// return paymentMethods.filter(
|
||||||
return paymentMethods.filter(
|
// (method) => method.id !== EPaymentMethod.PAYMENT_BUTTONS
|
||||||
(method) => method.id !== EPaymentMethod.PAYMENT_BUTTONS
|
// );
|
||||||
);
|
|
||||||
}
|
|
||||||
return paymentMethods;
|
return paymentMethods;
|
||||||
}, [isStripePaymentButtonEnabled]);
|
}, []);
|
||||||
|
|
||||||
const [selectedPaymentMethod, setSelectedPaymentMethod] = useState(
|
const [selectedPaymentMethod, setSelectedPaymentMethod] = useState(
|
||||||
isStripePaymentButtonEnabled
|
EPaymentMethod.PAYMENT_BUTTONS
|
||||||
? EPaymentMethod.PAYMENT_BUTTONS
|
|
||||||
: EPaymentMethod.CREDIT_CARD
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const onSelectPaymentMethod = (method: EPaymentMethod) => {
|
const onSelectPaymentMethod = (method: EPaymentMethod) => {
|
||||||
@ -170,7 +164,6 @@ function PaymentModal({
|
|||||||
client_secret={clientSecret}
|
client_secret={clientSecret}
|
||||||
subscriptionReceiptId={subscriptionReceiptId}
|
subscriptionReceiptId={subscriptionReceiptId}
|
||||||
returnUrl={window.location.href}
|
returnUrl={window.location.href}
|
||||||
setCanMakePayment={setIsStripePaymentButtonEnabled}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -24,6 +24,9 @@
|
|||||||
|
|
||||||
.payment-method-container {
|
.payment-method-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address {
|
.address {
|
||||||
@ -41,4 +44,4 @@
|
|||||||
.address {
|
.address {
|
||||||
color: gray;
|
color: gray;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user