Braintreeをドロップイン機能を使用してサンドボックスモードで試用しています。 既存のcustomerID
を使用してクライアントトークンを作成しています。それは支払ナンスと顧客を更新する必要がありますドキュメントを1としてBraintree sandbox transaction.saleエラー:「セールスカスタマーIDはすでに取得済み」
Sale Customer ID has already been taken.
:私はこのcustomerId
とtransaction.sale
コールおよびオプションstoreInVault = true
を作るときしかし、それは次のエラーをエラーなります。ここで
はコードです:
gateway.transaction.sale({
amount: '10.00',
paymentMethodNonce: nonceFromTheClient, // Generated nonce passed from client
customer: {
id: 232057823, //this customer exist in the vault
email : user.emails[0].address
},
options: {
submitForSettlement: true,
storeInVault: true
//storeInVaultOnSuccess: true
}
}, function (err, result) {
if (err) {
console.log(err);
} else {
if (result.success) {
return result.success;
} else {
console.log('ERR Sale '+result.message);
return result.success;
}
}
});
私はパッケージpatrickml:braintree
で流星を使用しています。
私はそれが私がしなければならないかもしれないと思います。ただし、ドキュメントごとに**既存の顧客で新しい支払い方法を使用する** この取引の支払い方法を既存の顧客に関連付けるには、options.storeInVaultまたはoptions.storeInVaultOnSuccessと一緒にcustomerIdをtrueとして渡します。 のNode.js 'gateway.transaction.sale({ 量: "10.00"、 paymentMethodNonce:nonceFromTheClient、 はcustomerId: "theCustomerId"、 オプション:{ storeInVaultOnSuccess:真 }}、関数(ERR、結果){ }); ' –
ドキュメントは正しいですが、私は混乱を見ることができます。顧客オプション内に 'id'属性を入れ子にしています。リンクした例では、customerId属性が最上位レベルで指定されています。 – ThinkAboutIt
ああユーレカの瞬間!良いキャッチ、それは常に目の第二のペアを持っているのに役立ちます!どうもありがとう。 –