codeboxrcodehub / flutter-bkash

Flutter/dart package for payment gateway bKash (Bangladesh)
https://pub.dev/packages/flutter_bkash
BSD 3-Clause "New" or "Revised" License
16 stars 15 forks source link

use enum instead of string for payment status #1

Closed Musfick closed 1 year ago

Musfick commented 2 years ago

Using String

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;
  }
manchumahara commented 2 years ago

Hi @Musfick you can send PR to dev branch

rdnasim commented 1 year ago

Now we are changed the payment functionality, now you can use it as tokenized based payment.