0
我已經擁有一張卡片的客戶,並且正在嘗試向他們添加另一張卡片。這是我的要求:添加新卡片以覆蓋舊卡片
function stripe_post (route, data) {
return fetch(STRIPE_API + route, {
method: 'POST',
headers: {
Authorization: `Bearer ${STRIPE_ACCESS_KEY}`,
'Content-Type': 'application/x-www-form-urlencoded'
},
body: serialize(data) }) }
stripe_post(`customers/${stripeId}`, {
source: {
object: 'card',
exp_month: card.expiry.slice(0, 2),
exp_year: card.expiry.slice(-2),
number: card.number,
name: card.name,
cvc: card.cvc
}
})
它返回正確的新卡對象,但是當我嘗試獲取客戶對象之後的新卡已經覆蓋舊的一個對象內。