File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 3
3
"version" : " 0.0.17" ,
4
4
"type" : " commonjs" ,
5
5
"private" : false ,
6
- "author" : " opavlovskyi-valor-software" ,
7
6
"license" : " ISC" ,
8
7
"description" : " Stripe service with DTO's and Swagger for nestjs projects. Include Webhooks listeners and Event enums." ,
9
8
"repository" : {
Original file line number Diff line number Diff line change @@ -71,14 +71,16 @@ import { StripeLogger } from './stripe.logger';
71
71
72
72
@Injectable ( )
73
73
export class StripeService {
74
- protected stripe : Stripe = new Stripe ( this . config . apiKey , {
75
- apiVersion : '2022-11-15'
76
- } ) ;
74
+ protected readonly stripe ! : Stripe ;
77
75
78
76
constructor (
79
77
@Inject ( STRIPE_CONFIG ) protected readonly config : StripeConfig ,
80
78
private readonly logger : StripeLogger
81
- ) { }
79
+ ) {
80
+ this . stripe = new Stripe ( this . config . apiKey , {
81
+ apiVersion : '2022-11-15'
82
+ } ) ;
83
+ }
82
84
83
85
//#region Payment Intent
84
86
async createPaymentIntent ( dto : CreatePaymentIntentDto ) : Promise < PaymentIntentResponse > {
@@ -1112,7 +1114,7 @@ export class StripeService {
1112
1114
discountable : dto . discountable ,
1113
1115
discounts : dto . discounts ,
1114
1116
expand : dto . expand ,
1115
- invoice : dto . invoice ,
1117
+ invoice : invoiceId || dto . invoice ,
1116
1118
period : dto . period ,
1117
1119
price : dto . price ,
1118
1120
price_data : dto . priceData ? {
You can’t perform that action at this time.
0 commit comments