Commit 9f88ed6 1 parent 9aa1d46 commit 9f88ed6 Copy full SHA for 9f88ed6
File tree 3 files changed +42
-0
lines changed
3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ import type Stripe from "stripe" ;
2
+ import type { FindMethod , ParamsWithStripe , ParamsWithStripeQuery } from "../types" ;
3
+ import { BaseService } from "./base" ;
4
+
5
+ export interface IBalanceTransactionService {
6
+ _find : FindMethod < ParamsWithStripeQuery < Stripe . BalanceTransactionListParams > , Stripe . BalanceTransaction > ;
7
+ _get : ( id : string , params : ParamsWithStripe ) => Promise < Stripe . BalanceTransaction > ;
8
+ _create : never ;
9
+ _update : never ;
10
+ _patch : never ;
11
+ _remove : never ;
12
+ }
13
+
14
+ export class BalanceTransactionService
15
+ extends BaseService < IBalanceTransactionService >
16
+ implements IBalanceTransactionService
17
+ {
18
+ _get ( id : string , params : ParamsWithStripe ) {
19
+ let { stripe } = this . filterParams ( params ) ;
20
+ stripe = Object . assign ( { } , stripe ) ;
21
+ if ( id ) {
22
+ stripe . stripeAccount = id ;
23
+ }
24
+ return this . stripe . balanceTransactions . retrieve ( undefined , stripe ) ;
25
+ }
26
+
27
+ _find ( params : ParamsWithStripeQuery < Stripe . BalanceTransactionListParams > ) {
28
+ const filtered = this . filterParams ( params ) ;
29
+ return this . handlePaginate (
30
+ filtered ,
31
+ this . stripe . balanceTransactions . list ( filtered . query , filtered . stripe )
32
+ ) ;
33
+ }
34
+
35
+ _create : never ;
36
+ _update : never ;
37
+ _patch : never ;
38
+ _remove : never ;
39
+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ export { AccountService } from "./account";
2
2
export { AccountLinkService } from "./account-links" ;
3
3
export { ApplicationFeeRefundService } from "./application-fee-refund" ;
4
4
export { BalanceService } from "./balance" ;
5
+ export { BalanceTransactionService } from "./balance-transactions" ;
5
6
export { BankAccountService } from "./bank-account" ;
6
7
export { ExternalAccountService } from "./external-account" ;
7
8
export { CardService } from "./card" ;
Original file line number Diff line number Diff line change 4
4
AccountLinkService ,
5
5
ApplicationFeeRefundService ,
6
6
BalanceService ,
7
+ BalanceTransactionService ,
7
8
BankAccountService ,
8
9
ExternalAccountService ,
9
10
CardService ,
@@ -37,6 +38,7 @@ const services = [
37
38
AccountLinkService ,
38
39
ApplicationFeeRefundService ,
39
40
BalanceService ,
41
+ BalanceTransactionService ,
40
42
BankAccountService ,
41
43
ExternalAccountService ,
42
44
CardService ,
You can’t perform that action at this time.
0 commit comments