getPaymentIntentStatus function

PaymentIntentStatus getPaymentIntentStatus(
  1. String name
)

Implementation

PaymentIntentStatus getPaymentIntentStatus(String name) {
  switch (name) {
    case "canceled":
      return PaymentIntentStatus.canceled;
    case "requires_payment_method":
      return PaymentIntentStatus.requiresPaymentMethod;
    case "requires_confirmation":
      return PaymentIntentStatus.requiresConfirmation;
    case "requires_action":
      return PaymentIntentStatus.requiresAction;
    case "processing":
      return PaymentIntentStatus.processing;
    case "succeeded":
      return PaymentIntentStatus.succeeded;
    case "requires_capture":
      return PaymentIntentStatus.requiresCapture;
    default:
      return PaymentIntentStatus.unknown;
  }
}