现在我要切换到生产。并在创建新客户时获得"无效的端点:请求的端点需要一个帐户"错误。
'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 Sandbox中起作用,则代码可能不是问题。请联系您的Dwolla客户经理以帮助解决。
如果您不与Dwolla签订合同和/或没有任何客户经理,则可以使用联系表来帮助启动该过程:联系Dwolla
谢谢!