mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-21 15:54:22 +01:00
fix bug: admin takes a subscription with a payment schedule by stipe
This commit is contained in:
parent
65ba3a686b
commit
f4ed3ca391
@ -8,6 +8,7 @@ import SettingAPI from '../../../api/setting';
|
|||||||
import { SettingName } from '../../../models/setting';
|
import { SettingName } from '../../../models/setting';
|
||||||
import { PaymentModal } from '../payment-modal';
|
import { PaymentModal } from '../payment-modal';
|
||||||
import { PaymentSchedule } from '../../../models/payment-schedule';
|
import { PaymentSchedule } from '../../../models/payment-schedule';
|
||||||
|
import { PaymentMethod } from '../../../models/payment';
|
||||||
|
|
||||||
const ALL_SCHEDULE_METHODS = ['card', 'check'] as const;
|
const ALL_SCHEDULE_METHODS = ['card', 'check'] as const;
|
||||||
type scheduleMethod = typeof ALL_SCHEDULE_METHODS[number];
|
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.
|
* Callback triggered when the user selects a payment method for the current payment schedule.
|
||||||
*/
|
*/
|
||||||
const handleUpdateMethod = (option: selectOption) => {
|
const handleUpdateMethod = (option: selectOption) => {
|
||||||
|
if (option.value === 'card') {
|
||||||
|
cart.payment_method = PaymentMethod.Card;
|
||||||
|
} else {
|
||||||
|
cart.payment_method = PaymentMethod.Other;
|
||||||
|
}
|
||||||
setMethod(option.value);
|
setMethod(option.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -129,7 +135,8 @@ export const LocalPaymentForm: React.FC<GatewayFormProps> = ({ onSubmit, onSucce
|
|||||||
onError={onError}
|
onError={onError}
|
||||||
cart={cart}
|
cart={cart}
|
||||||
currentUser={operator}
|
currentUser={operator}
|
||||||
customer={customer} />
|
customer={customer}
|
||||||
|
schedule={paymentSchedule} />
|
||||||
</div>}
|
</div>}
|
||||||
{children}
|
{children}
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user