status == 'paymentSuccess'
status == 'paymentFailed'
status == 'paymentError'
status == 'paymentClose'
Enum
enum PaymentStatus {
Success,
Failed,
Error,
Close
}
Using enum
switch (status) {
case PaymentStatus.Success:
// do something
break;
case PaymentStatus.Failed:
// do something
break;
case PaymentStatus.Error:
// do something
break;
case PaymentStatus.Close:
// do something
break;
}
Using String
Enum
Using enum