fix: payment
This commit is contained in:
parent
e462326495
commit
00cd5bbeb8
@ -61,6 +61,7 @@ class _PaymentDialogState extends State<PaymentDialog> {
|
||||
return CustomModalDialog(
|
||||
title: 'Pembayaran',
|
||||
subtitle: 'Silahkan lakukan pembayaran',
|
||||
minWidth: context.deviceWidth * 0.6,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@ -187,13 +188,6 @@ class _PaymentDialogState extends State<PaymentDialog> {
|
||||
);
|
||||
}
|
||||
|
||||
// Set default selected payment method if none selected or if current selection is not in the list
|
||||
if (selectedPaymentMethod == null ||
|
||||
!paymentMethods.any((method) =>
|
||||
method.id == selectedPaymentMethod?.id)) {
|
||||
selectedPaymentMethod = paymentMethods.first;
|
||||
}
|
||||
|
||||
return Wrap(
|
||||
spacing: 12.0,
|
||||
runSpacing: 8.0,
|
||||
@ -360,7 +354,9 @@ class _PaymentDialogState extends State<PaymentDialog> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final itemPending = widget.order.orderItems
|
||||
?.where((item) => item.status == "pending")
|
||||
.toList();
|
||||
final request = PaymentRequestModel(
|
||||
amount: widget.order.totalAmount ?? 0,
|
||||
orderId: widget.order.id,
|
||||
@ -369,7 +365,7 @@ class _PaymentDialogState extends State<PaymentDialog> {
|
||||
splitNumber: 1,
|
||||
splitTotal: 1,
|
||||
transactionId: '',
|
||||
paymentOrderItems: widget.order.orderItems
|
||||
paymentOrderItems: itemPending
|
||||
?.map((item) => PaymentOrderItemModel(
|
||||
orderItemId: item.id,
|
||||
amount: item.totalPrice,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user