1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

fix bug: admin takes a subscription with a payment schedule by stipe

This commit is contained in:
Du Peng 2021-09-10 18:32:39 +02:00
parent 65ba3a686b
commit f4ed3ca391

View File

@ -8,6 +8,7 @@ import SettingAPI from '../../../api/setting';
import { SettingName } from '../../../models/setting';
import { PaymentModal } from '../payment-modal';
import { PaymentSchedule } from '../../../models/payment-schedule';
import { PaymentMethod } from '../../../models/payment';
const ALL_SCHEDULE_METHODS = ['card', 'check'] as const;
type scheduleMethod = typeof ALL_SCHEDULE_METHODS[number];
@ -56,6 +57,11 @@ export const LocalPaymentForm: React.FC<GatewayFormProps> = ({ onSubmit, onSucce
* Callback triggered when the user selects a payment method for the current payment schedule.
*/
const handleUpdateMethod = (option: selectOption) => {
if (option.value === 'card') {
cart.payment_method = PaymentMethod.Card;
} else {
cart.payment_method = PaymentMethod.Other;
}
setMethod(option.value);
};
@ -129,7 +135,8 @@ export const LocalPaymentForm: React.FC<GatewayFormProps> = ({ onSubmit, onSucce
onError={onError}
cart={cart}
currentUser={operator}
customer={customer} />
customer={customer}
schedule={paymentSchedule} />
</div>}
{children}
</form>