【问题标题】:Dwolla : InvalidTokenType : The requested endpoint requires an account tokenDwolla : InvalidTokenType : 请求的端点需要一个帐户令牌
【发布时间】:2018-02-19 07:33:52
【问题描述】:

现在我正在转向生产。并在创建新客户时收到“InvalidTokenType : The requested endpoint requires an account token”错误。

  '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
    })
    );
    },

提前致谢!

【问题讨论】:

    标签: meteor dwolla


    【解决方案1】:

    如果此代码在 Dwolla 沙盒中有效,则可能不是您的代码有问题。请联系您的 Dwolla 客户经理以帮助解决。

    如果您没有与 Dwolla 签订合同和/或您没有任何客户经理,您可以使用联系表来帮助启动该流程:Contact Dwolla

    谢谢!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-22
      • 2011-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-20
      • 1970-01-01
      相关资源
      最近更新 更多