docs: @Override
      protected CreditCardAuthorizationResult run() {
          // Simulate transitive dependency from CreditCardCommand to GetUserAccountCommand.
          // UserAccount could be injected into this command as an argument (and that would be more accurate)
          // but often in large codebase that ends up not happening and each library fetches common data
          // such as user information directly such as this example.
          UserAccount user = new GetUserAccountCommand(new HttpCookie("mockKey", "mockValueFromHttpRequest")).execute();
          if (user.getAccountType() == 1) {
              // do something
          } else {
              // do something else
          }
  
          // perform credit card transaction
          Result<Transaction> result = gateway.submit(payment.getCreditCardNumber(),
                  String.valueOf(payment.getExpirationMonth()),
                  String.valueOf(payment.getExpirationYear()),
                  TransactionType.AUTH_CAPTURE, amount, order);
  
          if (result.isApproved()) {
              return CreditCardAuthorizationResult.createSuccessResponse(result.getTarget().getTransactionId(), result.getTarget().getAuthorizationCode());
          } else if (result.isDeclined()) {
              return CreditCardAuthorizationResult.createFailedResponse(result.getReasonResponseCode() + " : " + result.getResponseText());
          } else {
              // check for duplicate transaction
              if (result.getReasonResponseCode().getResponseReasonCode() == 11) {
                  if (result.getTarget().getAuthorizationCode() != null) {
                      // We will treat this as a success as this is telling us we have a successful authorization code
                      // just that we attempted to re-post it again during the 'duplicateWindow' time period.
                      // This is part of the idempotent behavior we require so that we can safely timeout and/or fail and allow
                      // client applications to re-attempt submitting a credit card transaction for the same order again.
                      // In those cases if the client saw a failure but the transaction actually succeeded, this will capture the
                      // duplicate response and behave to the client as a success.
                      return CreditCardAuthorizationResult.createDuplicateSuccessResponse(result.getTarget().getTransactionId(), result.getTarget().getAuthorizationCode());
                  }
              }
              // handle all other errors
              return CreditCardAuthorizationResult.createFailedResponse(result.getReasonResponseCode() + " : " + result.getResponseText());
              /**
               * NOTE that in this use case we do not throw an exception for an "error" as this type of error from the service is not a system error,
               * but a legitimate usage problem successfully delivered back from the service.
               * 
               * Unexpected errors will be allowed to throw RuntimeExceptions.
               * 
               * The HystrixBadRequestException could potentially be used here, but with such a complex set of errors and reason codes
               * it was chosen to stick with the response object approach rather than using an exception.
               */
          }
      }