feat: only success charges
This commit is contained in:
parent
258378770e
commit
7bfa3e5ad9
1 changed files with 12 additions and 10 deletions
|
|
@ -831,16 +831,18 @@ export class StripeService {
|
|||
limit: 100,
|
||||
});
|
||||
|
||||
return charges.data.map((charge) => ({
|
||||
id: charge.id,
|
||||
amount: charge.amount,
|
||||
currency: charge.currency,
|
||||
created: charge.created,
|
||||
status: charge.status,
|
||||
refunded: charge.refunded,
|
||||
amount_refunded: charge.amount_refunded,
|
||||
description: charge.description,
|
||||
}));
|
||||
return charges.data
|
||||
.filter((f) => f.status === 'succeeded')
|
||||
.map((charge) => ({
|
||||
id: charge.id,
|
||||
amount: charge.amount,
|
||||
currency: charge.currency,
|
||||
created: charge.created,
|
||||
status: charge.status,
|
||||
refunded: charge.refunded,
|
||||
amount_refunded: charge.amount_refunded,
|
||||
description: charge.description,
|
||||
}));
|
||||
}
|
||||
|
||||
async refundCharges(organizationId: string, chargeIds: string[]) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue