我正在尝试获取带有条纹的客户卡详细信息,我只有客户ID和Payment_method ID,我如何使用此ID来检索卡详细信息。主要是卡的后四位
我已经尝试购买以获取客户对象,但是它没有卡的最后4位数字。有谁知道如何使用客户ID或付款方式ID取回
stripe.customers.retrieve(
req.body.customerId,
function(err, customer) {
// asynchronously called
res.send(customer)
}
);
答案 0 :(得分:0)
在sources
对象上检查Customer
。例如
stripe.customers.retrieve(
req.body.customerId,
function(err, customer) {
// asynchronously called
res.send(customer.sources.data[0].last4)
}
);
答案 1 :(得分:0)
stripe.paymentMethods.retrieve(
req.body.paymentId,
function(err, paymentMethod) {
// asynchronously called
res.send(paymentMethod.card.last4)
}
);