From f4ed3ca3911251946353b348dbda62d9380b54b2 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Fri, 10 Sep 2021 18:32:39 +0200 Subject: [PATCH] fix bug: admin takes a subscription with a payment schedule by stipe --- .../payment/local-payment/local-payment-form.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/frontend/src/javascript/components/payment/local-payment/local-payment-form.tsx b/app/frontend/src/javascript/components/payment/local-payment/local-payment-form.tsx index a111f16cf..fae0f482e 100644 --- a/app/frontend/src/javascript/components/payment/local-payment/local-payment-form.tsx +++ b/app/frontend/src/javascript/components/payment/local-payment/local-payment-form.tsx @@ -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 = ({ 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 = ({ onSubmit, onSucce onError={onError} cart={cart} currentUser={operator} - customer={customer} /> + customer={customer} + schedule={paymentSchedule} /> } {children}