refound method

  1. @override
Future<bool> refound()
override

Implementation

@override
Future<bool> refound() async {
  if (_selectPaymentMethod == null) {
    throw Exception('no select payment method');
  }
  try {
    if (_selectPaymentMethod == PaymentMethodEntity.termianlSber) {
      await payTerminal.refoundPay();
      return true;
    }
    if (_selectPaymentMethod != PaymentMethodEntity.termianlSber) {
      await payYookassa.refundPayment();
      return true;
    }
    return false;
  } catch (e) {
    // TODO: Save Failure operation
    return false;
  }
}