2013-10-16 64 views
1

方法ItemManagementService.updateCredentialsForItem1如何工作?方法updateCredentialsForItem1如何工作

如果我使用錯誤的憑證更新帳戶,會發生什麼情況?它會拋出異常嗎?

我在yodlee中添加了一個賬戶,然後我更改了該賬戶的密碼。當我試圖獲得交易時,它拋出了錯誤402。在此之後,我調用此方法ItemManagementService.updateCredentialsForItem1(userContext,itemId,true,fieldInfoList.ToArray(),true)更新此帳戶。但是這種方法不會拋出任何異常或錯誤代碼,即使我使用錯誤的密碼更新了它。

如果我使用錯誤的憑證更新帳戶,我應該怎麼做以確保yodlee會告訴我憑證是錯誤的?

非常感謝。 YUJ

回答

3

我相信,研究和經驗告訴/教我說,你需要通過假爲「上添加/更新開始刷新」,並開始刷新手動

的工作流程是完全一樣的是否你添加或更新。 您添加/更新: AddItemForContentService1(如果爲New)或updateCredentialsForItem1(如果更新憑證)。

然後您檢查是否可以刷新項目以及是否/何時可以開始刷新然後開始輪詢。

您需要檢查RefreshService.isItemRefreshing(這需要是false) 然後開始刷新RefreshService.startRefresh7。 然後你的標準輪詢程序就是你將會發現更新的證書是否工作的地方。 Ala,在10/15秒間隔內,您需要通過RefreshClient.getRefreshInfo傳遞內容項ID來檢查狀態。

返回值最值得注意的是與Gatherer Error代碼相關的RefreshInfo.statusCode(請參閱下面的代碼)可以讓您知道是否有問題。 0成功。

以下是我基於Java SDK構建的C#枚舉,並用一些技術支持填寫了一些缺失的值。無論使用什麼語言,這些值都是相同的。所以這是一個很好的參考,因爲名稱是半意義的。 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, 
} 
+0

傳遞「false」和「true」作爲「加載/更新時的開始刷新」有什麼區別?如果我用錯誤的憑證進行更新,「RefreshService.startRefresh7」方法是否會拋出異常?在我的代碼中,如果我使用錯誤的憑據更新,方法「RefreshService.startRefresh7」不會引發任何異常。 – user2634329

+0

我指的是false/true指定是否應該自動開始刷新。正如我所說的,在「老Yoldee開發者論壇」中,總是被告知要指定false。 – MDR

+0

您需要使用getRefreshInfo1 startRefresh7然後輪詢(以5/10/15秒的間隔)。 getRefreshInfo1的返回值將告訴您憑據是否無效。特別是RefreshInfo.statusCode。返回值與收集器錯誤相關。 – MDR