我想在沙盒模式下测试Braintree Marketplace API。我已经创建了沙箱帐户并使用了node.js SDK。
我在这里引用文档:https://developers.braintreepayments.com/guides/marketplace/onboarding/node
以下是我的节点代码:
app.get('/', function(req, res) {
merchantAccountParams = {
individual: {
firstName: "Jane",
lastName: "Doe",
email: "jane@14ladders.com",
phone: "5553334444",
dateOfBirth: "1981-11-19",
ssn: "456-45-4567",
address: {
streetAddress: "111 Main St",
locality: "Chicago",
region: "IL",
postalCode: "60622"
}
},
business: {
legalName: "Jane's Ladders",
dbaName: "Jane's Ladders",
taxId: "98-7654321",
address: {
streetAddress: "111 Main St",
locality: "Chicago",
region: "IL",
postalCode: "60622"
}
},
funding: {
descriptor: "Blue Ladders",
//destination: MerchantAccount.FundingDestination.Bank,
destination:"Demo Bank",
email: "funding@blueladders.com",
mobilePhone: "5555555555",
accountNumber: "1123581321",
routingNumber: "071101307"
},
tosAccepted: true,
masterMerchantAccountId: "14ladders_marketplace",
id: "blue_ladders_store"
};
gateway.merchantAccount.create(merchantAccountParams, function (err, result) {
res.send(result.success);
});
});
上面的代码总是返回false。我想知道我们甚至可以用沙盒测试这个吗?或者我错过了什么?
任何人在请求帮助之前都会遇到此问题。
谢谢。
答案 0 :(得分:1)
完全披露:我在Braintree工作。如果您还有其他问题,请随时contact support。
目标参数未查找银行名称,它正在查找文字字符串,该字符串指示是否应使用bank
,email
或{{1}来资助帐户}。您可以直接使用这些字符串,但我们建议您使用constant references,因为它可以使代码更清晰,并防止将来发生更改。