Braintree 在沙盒中提交结算
Braintree submit for settlement in sandbox
我在 NodeJS 中创建了一个简单的测试脚本,用于使用 Braintree SDK 创建交易。但是,每当我尝试使用伪造的失败随机数时,它都会成功。我确定我在这里遗漏了一些简单的东西,但我不知道它是什么。
gateway.transaction.sale({
amount: 10,
paymentMethodNonce: "fake-processor-declined-mastercard-nonce",
options: {
submitForSettlement: true
}
}, function(err, res) {
console.log(JSON.stringify(res, null, "\t"));
});
完全披露:我为 Braintree 工作。
fake-processor-declined
随机数不模拟失败的交易,而是模拟信用卡验证失败。通过转到设置 > 处理 > 卡片验证,在 Braintree 控制面板中启用卡片验证。然后,让你的选项散列看起来像这样:
options: {
submitForSettlement: true,
verifyCard: true
}
交易将不再成功,并将 return 授权错误。
如果您尝试模拟失败的交易,请改用特定的 test transaction amount 和 fake-valid-nonce
。
如果您有任何其他问题,请随时联系 Braintree support。
我在 NodeJS 中创建了一个简单的测试脚本,用于使用 Braintree SDK 创建交易。但是,每当我尝试使用伪造的失败随机数时,它都会成功。我确定我在这里遗漏了一些简单的东西,但我不知道它是什么。
gateway.transaction.sale({
amount: 10,
paymentMethodNonce: "fake-processor-declined-mastercard-nonce",
options: {
submitForSettlement: true
}
}, function(err, res) {
console.log(JSON.stringify(res, null, "\t"));
});
完全披露:我为 Braintree 工作。
fake-processor-declined
随机数不模拟失败的交易,而是模拟信用卡验证失败。通过转到设置 > 处理 > 卡片验证,在 Braintree 控制面板中启用卡片验证。然后,让你的选项散列看起来像这样:
options: {
submitForSettlement: true,
verifyCard: true
}
交易将不再成功,并将 return 授权错误。
如果您尝试模拟失败的交易,请改用特定的 test transaction amount 和 fake-valid-nonce
。
如果您有任何其他问题,请随时联系 Braintree support。