File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
import {
2
2
type Environment ,
3
+ LogLevel ,
3
4
Paddle ,
4
5
type Subscription ,
5
6
} from '@paddle/paddle-node-sdk' ;
6
7
import { logger } from '../logger' ;
7
8
import { PricingPreviewLineItem } from '@paddle/paddle-node-sdk/dist/types/entities/pricing-preview' ;
9
+ import { SubscriptionProvider } from '../entity' ;
10
+ import { isProd } from './utils' ;
8
11
9
12
export const paddleInstance = new Paddle ( process . env . PADDLE_API_KEY , {
10
13
environment : process . env . PADDLE_ENVIRONMENT as Environment ,
14
+ logLevel : isProd ? LogLevel . error : LogLevel . verbose ,
11
15
} ) ;
12
16
13
17
type CancelSubscriptionProps = {
@@ -23,7 +27,7 @@ export const cancelSubscription = async ({
23
27
} catch ( e ) {
24
28
logger . error (
25
29
{
26
- type : 'paddle' ,
30
+ provider : SubscriptionProvider . Paddle ,
27
31
subscriptionId,
28
32
error : e ,
29
33
} ,
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export const deleteUser = async (
49
49
} ) ;
50
50
logger . info (
51
51
{
52
- type : 'paddle' ,
52
+ provider : SubscriptionProvider . Paddle ,
53
53
userId,
54
54
subscriptionId : subscriptionFlags . subscriptionId ,
55
55
} ,
You can’t perform that action at this time.
0 commit comments