This commit is contained in:
efrilm
2025-11-01 16:17:45 +07:00
parent ef23839761
commit 069c2296de
24 changed files with 2670 additions and 133 deletions
@@ -198,4 +198,26 @@ class OrderRepository implements IOrderRepository {
return left(const OrderFailure.unexpectedError());
}
}
@override
Future<Either<OrderFailure, Unit>> refundOrder({
required String id,
required String reason,
required int refundAmount,
}) async {
try {
final result = await _dataProvider.refundPayment(
id: id,
reason: reason,
refundAmount: refundAmount,
);
if (result.hasError) {
return left(result.error!);
}
return right(unit);
} catch (e) {
log('refundOrderError', name: _logName, error: e);
return left(const OrderFailure.unexpectedError());
}
}
}