我正在尝试在单个用户对象上存储多个源(卡)。
假设我有一位客户已经存储了一个源。
使用新的源 token ,我将执行以下操作
stripe.customers.update(customer, {source:call.request.source}, function(err, updatedCustomer){
if(err){
return console.log(err);
}
console.log(updatedCustomer.sources.data);
})
当我这样做时,客户现有的源将丢失,新的源将被存储。
如何存储同一客户的多个来源?
最佳答案
使用 createSource 而不是 update 就可以了。
stripe.customers.createSource(customer, {source:call.request.source}, function(err, updatedCustomer){
if(err){
return console.log(err);
}
console.log(updatedCustomer.sources.data);
})
关于stripe-payments - Stripe - 在一个用户上存储多个源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47457486/