方法updateCredentialsForItem1如何工作

时间:2013-10-16 15:48:24

标签: yodlee

ItemManagementService.updateCredentialsForItem1方法如何工作?

如果我使用错误的凭据更新帐户会怎样?它会抛出异常吗?

我在yodlee中添加了一个帐户,然后我更改了该帐户的密码。当我试图获得交易时,它抛出错误402。在此之后,我调用了此方法ItemManagementService.updateCredentialsForItem1(userContext,itemId,true,fieldInfoList.ToArray(),true)来更新此帐户。但是,即使我使用错误的密码更新它,此方法也不会引发任何异常或错误代码。

如果我使用错误的凭据更新帐户,我应该怎么做才能确保yodlee告诉我凭证是错误的?

非常感谢。 YUJ

1 个答案:

答案 0 :(得分:3)

我相信研究和经验告诉/教导我需要传递错误作为“添加/更新时开始刷新”并手动启动刷新

无论您是添加还是更新,工作流程都完全相同。 你添加/更新: AddItemForContentService1(如果是New)或updateCredentialsForItem1(如果更新凭证)。

然后检查是否可以刷新该项目以及是否/何时可以开始刷新然后开始轮询。

您需要检查RefreshService.isItemRefreshing(这需要为false) 然后启动刷新RefreshService.startRefresh7。 然后是您的标准轮询例程,您可以在其中查看更新的凭据是否有效。 Ala,每隔10/15秒,您需要使用RefreshClient.getRefreshInfo检查状态,并传递内容项ID。

返回值最值得注意的是与收集器错误代码相关的RefreshInfo.statusCode(请参阅下面的代码),可以让您知道是否存在问题。 0成功。

以下是我基于Java SDK构建的C#Enums,并通过一些技术支持填充了一些缺失值。无论使用何种语言,值都是相同的。所以这是一个很好的参考,因为名称半有意义。 402和419是两个最常见的登录错误代码。 402是无效凭证,419表示它没有及时注册。完整的错误代码列表可以在Yodlee的网站上找到:https://developer.yodlee.com/FAQs/Error_Codes

public  enum    GathererErrorsEnum
{
    STATUS_OK = 0,
    STATUS_INVALID_GATHERER_REQUEST = 400,
    STATUS_NO_CONNECTION = 401,
    STATUS_LOGIN_FAILED = 402,
    STATUS_INTERNAL_ERROR = 403,
    STATUS_LOST_REQUEST = 404,
    STATUS_ABORT_REQUEST = 405,
    STATUS_PASSWORD_EXPIRED = 406,
    STATUS_ACCOUNT_LOCKED = 407,
    STATUS_DATA_EXPECTED = 408,
    STATUS_SITE_UNAVILABLE = 409,
    STATUS_POP3_SERVER_FAILED = 410,
    STATUS_SITE_OUT_OF_BUSINESS = 411,
    STATUS_SITE_APPLICATION_ERROR = 412,
    STATUS_REQUIRED_FIELD_UNAVAILABLE = 413,
    STATUS_NO_ACCOUNT_FOUND = 414,
    STATUS_SITE_TERMINATED_SESSION = 415,
    STATUS_SITE_SESSION_ALREADY_ESTABLISHED = 416,
    STATUS_DATA_MODEL_NO_SUPPORT = 417,
    STATUS_HTTP_DNS_ERROR = 418,
    STATUS_LOGIN_NOT_COMPLETED = 419,
    STATUS_SITE_MERGED_ERROR = 420,
    STATUS_UNSUPPORTED_LANGUAGE_ERROR = 421,
    STATUS_ACCOUNT_CANCELLED = 422,
    STATUS_ACCT_INFO_UNAVAILABLE = 423,
    STATUS_SITE_DOWN_FOR_MAINTENANCE = 424,
    STATUS_SITE_CERTIFICATE_ERROR = 425,
    STATUS_SITE_BLOCKING_ERROR = 426,
    STATUS_NEW_SPLASH_PAGE = 427,
    STATUS_NEW_TERMS_AND_CONDITIONS = 428,
    STATUS_UPDATE_INFORMATION_ERROR = 429,
    STATUS_SITE_NOT_SUPPORTED = 430,
    STATUS_HTTP_FILE_NOT_FOUND_ERROR = 431,
    STATUS_HTTP_INTERNAL_SERVER_ERROR = 432,
    STATUS_REGISTRATION_PARTIAL_SUCCESS = 433,
    STATUS_REGISTRATION_FAILED_ERROR = 434,
    STATUS_REGISTRATION_INVALID_DATA = 435,
    STATUS_REGISTRATION_ACCOUNT_ALREADY_REGISTERED = 436,
    STATUS_REGISTRATION_TIMEOUT = 404,
    UNIQUEID_FROM_DATA_SOURCE_ERROR = 475,
    ACCOUNT_REQUIRED_FIELDS_NOT_SET = 476,
    BILL_REQUIRED_FIELDS_NOT_SET = 477,
    STATUS_DUPLICATE_BILL = 478,
    STATUS_COULD_NOT_GENERATE_AUTOREGISTER_CREDENTIALS = 479,
    STATUS_MAX_REGISTRATION_ATTEMPTS_EXCEEDED = 481,
    STATUS_ACCOUNT_REGISTERED_ELSE_WHERE = 484,
    STATUS_REGISTRATION_BOT_SUPPORTED_FOR_REGION = 485,
    STATUS_REGISTRATION_NOT_SUPPORTED_FOR_REGION = 485,
    STATUS_UNSUPPORTED_REGISTRATION_ACCOUNT_TYPE = 486,
    REWARDS_PROGRAM_REQUIRED_FIELDS_NOT_SET = 491,
    REWARDS_ACTIVITY_REQUIRED_FIELDS_NOT_SET = 492,
    TAX_LOT_REQUIRED_FIELDS_NOT_SET = 493,
    INVESTMENT_TRANSACTION_REQUIRED_FIELDS_NOT_SET = 494,
    LOAN_TRANSACTION_REQUIRED_FIELDS_NOT_SET = 495,
    CARD_TRANSACTION_REQUIRED_FIELDS_NOT_SET = 496,
    BANK_TRANSACTION_REQUIRED_FIELDS_NOT_SET = 497,
    HOLDING_REQUIRED_FIELDS_NOT_SET = 498,
    SITE_CURRENTLY_NOT_SUPPORTED = 505,
    NEW_LOGIN_INFO_REQUIRED_FOR_SITE = 506,
    BETA_SITE_WORK_IN_PROGRESS = 507,
    STATUS_INSTANT_REQUEST_TIMEDOUT = 508,
    TOKEN_ID_INVALID = 509,
    PROPERTY_RECORD_NOT_FOUND = 510,
    HOME_VALUE_NOT_FOUND = 511,
    NO_PAYEE_FOUND = 512,
    NO_PAYEE_RETRIEVED = 513,
    SOME_PAYEE_NOT_RETRIEVED = 514,
    NO_PAYMENT_ACCOUNT_FOUND = 515,
    NO_PAYMENT_ACCOUNT_SELECTED = 516,
    GENERAL_EXCEPTION_WHILE_GATHERING_MFA_DATA = 517,
    NEW_MFA_INFO_REQUIRED_FOR_AGENTS = 518,
    MFA_INFO_NOT_PROVIDED_TO_YODLEE_BY_USER_FOR_AGENTS = 519,
    MFA_INFO_MISMATCH_FOR_AGENTS = 520,
    ENROLL_IN_MFA_AT_SITE = 521,
    MFA_INFO_NOT_PROVIDED_IN_REAL_TIME_BY_USER_VIA_APP = 522,
    INVALID_MFA_INFO_IN_REAL_TIME_BY_USER_VIA_APP = 523,
    USER_PROVIDED_REAL_TIME_MFA_DATA_EXPIRED = 524,
    MFA_INFO_NOT_PROVIDED_IN_REAL_TIME_BY_GATHERER = 525,
    INVALID_MFA_INFO_OR_CREDENTIALS = 526,
    STATUS_DBFILER_SUMMARY_SAVE_ERROR = 601,
    STATUS_REQUEST_GENERATION_ERROR = 602,
    STATUS_REQUEST_DISPATCH_ERROR = 603,
    STATUS_REQUEST_GENERATION_ERROR_LOGIN_FAILURE = 604,
    STATUS_REQUEST_GENERATION_ERROR_DELETED_ITEM = 605,
    INPUT_INVALID_DATA = 701,
    INPUT_LENGTH_ERROR = 702,
    INPUT_FORMAT_ERROR = 703,
    INPUT_USERNAME_ALREADY_TAKEN_ERROR = 704,
    INPUT_VALUE_TOO_SMALL = 705,
    INPUT_VALUE_TOO_LARGE = 706,
    REFRESH_NEVER_DONE = 801,
    REFRESH_NEVER_DONE_AFTER_CREDENTIALS_UPDATE     = 802,
}