forked from podkrepi-bg/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added error loging to stripe client (podkrepi-bg#470)
* added error logging to stripe client * added type for stripe config * removed unneded import --------- Co-authored-by: quantum-grit <[email protected]>
- Loading branch information
1 parent
234e7f9
commit 1e5a4b7
Showing
4 changed files
with
65 additions
and
33 deletions.
There are no files selected for viewing
34 changes: 18 additions & 16 deletions
34
apps/api/src/bank-transactions-file/helpers/use-factory-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
import { StripeModuleConfig } from '@golevelup/nestjs-stripe' | ||
import { ConfigService } from '@nestjs/config' | ||
import { Public } from 'nest-keycloak-connect' | ||
|
||
export const useFactoryService = { | ||
useFactory: async (config: ConfigService) => ({ | ||
apiKey: config.get('stripe.secretKey', ''), | ||
webhookConfig: { | ||
stripeWebhookSecret: config.get('stripe.webhookSecret', ''), | ||
requestBodyProperty: 'body', | ||
decorators: [ | ||
/** | ||
* Avoid Keycloak @AuthGuard and @RoleGuard on Webhook controller | ||
**/ | ||
Public(), | ||
], | ||
stripeSecrets: { | ||
connect: config.get('stripe.webhookSecret', ''), | ||
account: config.get('stripe.webhookSecret', ''), | ||
useFactory: async (config: ConfigService) => | ||
({ | ||
apiKey: config.get('stripe.secretKey', ''), | ||
webhookConfig: { | ||
stripeWebhookSecret: config.get('stripe.webhookSecret', ''), | ||
requestBodyProperty: 'body', | ||
decorators: [ | ||
/** | ||
* Avoid Keycloak @AuthGuard and @RoleGuard on Webhook controller | ||
**/ | ||
Public(), | ||
], | ||
stripeSecrets: { | ||
connect: config.get('stripe.webhookSecret', ''), | ||
account: config.get('stripe.webhookSecret', ''), | ||
}, | ||
}, | ||
}, | ||
}), | ||
} as StripeModuleConfig), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters