@@ -132,12 +132,6 @@ module('billing', function (hooks) {
132
132
await handlePaymentSucceeded (
133
133
dbAdapter ,
134
134
stripeInvoicePaymentSucceededEvent ,
135
- async function ( stripeUserId : string ) {
136
- assert . strictEqual (
137
- stripeUserId ,
138
- stripeInvoicePaymentSucceededEvent . data . object . customer ,
139
- ) ;
140
- } ,
141
135
) ;
142
136
143
137
// Assert that the stripe event was inserted and processed
@@ -197,16 +191,7 @@ module('billing', function (hooks) {
197
191
198
192
// Error if stripe event is attempted to be processed again when it's already been processed
199
193
await assert . rejects (
200
- handlePaymentSucceeded (
201
- dbAdapter ,
202
- stripeInvoicePaymentSucceededEvent ,
203
- async function ( stripeUserId : string ) {
204
- assert . strictEqual (
205
- stripeUserId ,
206
- stripeInvoicePaymentSucceededEvent . data . object . customer ,
207
- ) ;
208
- } ,
209
- ) ,
194
+ handlePaymentSucceeded ( dbAdapter , stripeInvoicePaymentSucceededEvent ) ,
210
195
'error: duplicate key value violates unique constraint "stripe_events_pkey"' ,
211
196
) ;
212
197
} ) ;
@@ -297,12 +282,6 @@ module('billing', function (hooks) {
297
282
await handlePaymentSucceeded (
298
283
dbAdapter ,
299
284
stripeInvoicePaymentSucceededEvent ,
300
- async function ( stripeUserId : string ) {
301
- assert . strictEqual (
302
- stripeUserId ,
303
- stripeInvoicePaymentSucceededEvent . data . object . customer ,
304
- ) ;
305
- } ,
306
285
) ;
307
286
308
287
// Assert that new subscription was created
@@ -399,12 +378,6 @@ module('billing', function (hooks) {
399
378
await handlePaymentSucceeded (
400
379
dbAdapter ,
401
380
stripeInvoicePaymentSucceededEvent ,
402
- async function ( stripeUserId : string ) {
403
- assert . strictEqual (
404
- stripeUserId ,
405
- stripeInvoicePaymentSucceededEvent . data . object . customer ,
406
- ) ;
407
- } ,
408
381
) ;
409
382
410
383
// Assert there are now three subscriptions and last one is active
@@ -488,12 +461,6 @@ module('billing', function (hooks) {
488
461
await handlePaymentSucceeded (
489
462
dbAdapter ,
490
463
stripeInvoicePaymentSucceededEvent ,
491
- async function ( stripeUserId : string ) {
492
- assert . strictEqual (
493
- stripeUserId ,
494
- stripeInvoicePaymentSucceededEvent . data . object . customer ,
495
- ) ;
496
- } ,
497
464
) ;
498
465
499
466
// Assert there are now four subscriptions and last one is active
@@ -562,12 +529,6 @@ module('billing', function (hooks) {
562
529
await handlePaymentSucceeded (
563
530
dbAdapter ,
564
531
stripeInvoicePaymentSucceededEvent ,
565
- async function ( stripeUserId : string ) {
566
- assert . strictEqual (
567
- stripeUserId ,
568
- stripeInvoicePaymentSucceededEvent . data . object . customer ,
569
- ) ;
570
- } ,
571
532
) ;
572
533
573
534
// Assert there are now 5 subscriptions and last one is active
@@ -681,12 +642,6 @@ module('billing', function (hooks) {
681
642
await handlePaymentSucceeded (
682
643
dbAdapter ,
683
644
stripeInvoicePaymentSucceededEvent ,
684
- async function ( stripeUserId : string ) {
685
- assert . strictEqual (
686
- stripeUserId ,
687
- stripeInvoicePaymentSucceededEvent . data . object . customer ,
688
- ) ;
689
- } ,
690
645
) ;
691
646
692
647
// Assert that there are now two subscription cycles
@@ -754,12 +709,6 @@ module('billing', function (hooks) {
754
709
await handleSubscriptionDeleted (
755
710
dbAdapter ,
756
711
stripeSubscriptionDeletedEvent ,
757
- async function ( stripeUserId : string ) {
758
- assert . strictEqual (
759
- stripeUserId ,
760
- stripeSubscriptionDeletedEvent . data . object . customer ,
761
- ) ;
762
- } ,
763
712
) ;
764
713
765
714
let subscriptions = await fetchSubscriptionsByUserId ( dbAdapter , user . id ) ;
@@ -800,12 +749,6 @@ module('billing', function (hooks) {
800
749
await handleCheckoutSessionCompleted (
801
750
dbAdapter ,
802
751
stripeCheckoutSessionCompletedEvent ,
803
- async function ( stripeUserId : string ) {
804
- assert . strictEqual (
805
- stripeUserId ,
806
- stripeCheckoutSessionCompletedEvent . data . object . customer ,
807
- ) ;
808
- } ,
809
752
) ;
810
753
811
754
let stripeEvents = await fetchStripeEvents ( dbAdapter ) ;
@@ -844,12 +787,6 @@ module('billing', function (hooks) {
844
787
await handleCheckoutSessionCompleted (
845
788
dbAdapter ,
846
789
stripeCheckoutSessionCompletedEvent ,
847
- async function ( stripeUserId : string ) {
848
- assert . strictEqual (
849
- stripeUserId ,
850
- stripeCheckoutSessionCompletedEvent . data . object . customer ,
851
- ) ;
852
- } ,
853
790
) ;
854
791
855
792
let availableExtraCredits = await sumUpCreditsLedger ( dbAdapter , {
0 commit comments