嗨,我目前在我的流星应用程序中使用平衡支付。我可以很好地创建卡片和客户,并且可以很好地将卡片与客户相关联。但是,当我尝试创建借记卡时遇到了问题。这是我编写的代码,几乎直接取自平衡文档。
var customer = balanced.Customers.get(user.customer.uri, function (err, customer) {
console.error(err);
console.log(customer);
var customerContext = balanced.Customers.nbalanced(customer);
var debitInfo = {
amount: amount,
appears_on_statement_as: "Statement text",
description: "Some descriptive text for the debit in the dashboard"
};
customerContext.Debits.create(debitInfo, function(err, result) {
console.error(err);
console.log(result);
});
});
每当上述代码运行时,我都会收到错误“在服务器上找不到请求的 URL”。我发现了问题,但我不完全确定如何解决它。我去平衡仪表板检查日志,我发现的是这个。
Date: Fri, 27 Sep 2013, 6:46 AM
Method: POST
URI: /v1/marketplaces/TEST-MPFj4MYWjZc9xt2IjTIni7/v1/customers/CU6jgv9FlavhPyYQ6ObZKDny/debits
Status: 404 NOT FOUND
请求正文在这里:
{
"appears_on_statement_as": "Statement text",
"amount": 1200,
"description": "Some descriptive text for the debit in the dashboard"
}
这是响应正文:
{
"status": "Not Found",
"category_code": "not-found",
"description": "<p>The requested URL was not found on the server.</p><p>If you entered the URL manually please check your spelling and try again.</p> Your request id is OHM38291020277b11e38b38026ba7cac9da.",
"status_code": 404,
"category_type": "request",
"_uris": {},
"request_id": "OHM38291020277b11e38b38026ba7cac9da"
}
我看到 URI 具有市场和客户 url,但我不知道为什么或什么可能导致这种情况发生,因为就像我说的那样,客户创建、卡创建和卡关联调用都可以正常工作。
任何意见,将不胜感激。