簡體   English   中英

Dwolla:InvalidTokenType:請求的端點需要帳戶令牌

[英]Dwolla : InvalidTokenType : The requested endpoint requires an account token

現在我轉投生產。 在創建新客戶時出現“ InvalidTokenType:請求的端點需要帳戶令牌”錯誤。

  'getDwollaAccount' : function(userId) {
   var dwollaCredentials = getDwollaCreden();
   const client = new dwolla.Client({
     key         : dwollaCredentials.appKey,
     secret      : dwollaCredentials.appSecret,
     environment : 'production' // optional - defaults to production
   }); // call dwolla initial api

   client.auth.client()
   .then(Meteor.bindEnvironment(function(appToken) {

    var userFound = 
    Meteor.users.findOne({'_id':userId,'profile.dwollaLocation':''});
    if(userFound){
        var requestBody = {
          firstName : userFound.profile.firstname,
          lastName  : userFound.profile.lastname,
          email     : userFound.emails[0].address
        };
        appToken
            .post('customers', requestBody)
            .then( 
                (res)=> {
                    var dwollaLocation = res.headers.get('location');;      
                    return Promise.resolve(dwollaLocation);
                }
            )
            .then(
                Meteor.bindEnvironment((dloc) =>{ 
                        return Promise.resolve(dloc);
                })
            )
            .catch(Meteor.bindEnvironment((error) => {
               console.log(error);
                              }));  
    } // end of user found
    })
    );
    },

提前致謝!

如果此代碼可在Dwolla沙箱中使用,則代碼可能不是問題。 請與您的Dwolla客戶經理聯系以幫助解決。

如果您沒有與Dwolla簽訂合同和/或沒有任何客戶經理,則可以使用聯系表格來幫助您啟動該流程: 與Dwolla聯系

謝謝!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM