fromString static method

LokotroPaymentStatus fromString(
  1. String status
)

Implementation

static LokotroPaymentStatus fromString(String status) {
  switch (status.toLowerCase()) {
    case 'pending':
      return LokotroPaymentStatus.pending;
    case 'processing':
      return LokotroPaymentStatus.processing;
    case 'approved':
    case 'success':
    case 'successful':
      return LokotroPaymentStatus.approved;
    case 'declined':
      return LokotroPaymentStatus.declined;
    case 'failed':
    case 'fail':
      return LokotroPaymentStatus.failed;
    case 'cancelled':
    case 'canceled':
      return LokotroPaymentStatus.cancelled;
    case 'expired':
      return LokotroPaymentStatus.expired;
    case 'refunded':
      return LokotroPaymentStatus.refunded;
    case 'pending_bank_proof_upload':
      return LokotroPaymentStatus.pendingBankProofUpload;
    default:
      return LokotroPaymentStatus.failed;
  }
}