Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@deepkit-community/stripe
Advanced tools
Interacting with the Stripe API or consuming Stripe webhooks in your Deepkit applications is now easy as pie 🥧
Interacting with the Stripe API or consuming Stripe webhooks in your Deepkit applications is now easy as pie 🥧
💉 Injectable Stripe client for interacting with the Stripe API in Controllers and Providers
🎉 Optionally exposes an API endpoint from your Deepkit application at to be used for webhook event processing from Stripe. Defaults to /stripe/webhook/
but can be easily configured
🔒 Automatically validates that the event payload was actually sent from Stripe using the configured webhook signing secret
🕵️ Discovers providers from your application decorated with StripeWebhookHandler
and routes incoming events to them
🧭 Route events to logical services easily simply by providing the Stripe webhook event type
npm install --save @deepkit-community/stripe stripe
yarn add @deepkit-community/stripe stripe
Import and add stripeModule
to the imports
section of the consuming module. Your Stripe API key is required, and you can optionally include a webhook configuration if you plan on consuming Stripe webhook events inside your app.
import { stripeModule } from '@deepkit-community/stripe';
Application.create({
imports: [
stripeModule.configure({
apiKey: 'test',
webhookConfig: {
secret: STRIPE_SECRET,
},
}),
ApiConsoleModule,
],
});
Configuration can be provided inline as seen in the example above or using ENV variables with a prefix of stripe
.
The module exposes an injectable Stripe instance that is pre-configured with your API Key based on module configuration. To inject it, use the 'Stripe'
injection token:
@injectable()
class MyService {
constructor(@inject('Stripe') private readonly stripe: Stripe) {}
}
This module will automatically add a new API endpoint to your Deepkit application for processing webhooks. By default, the route for this endpoint will be stripe/webhook
but you can modify this to use a different prefix using the controllerRoutePrefix
and controllerRoute
configuration when importing the module.
Exposing provider/service methods to be used for processing Stripe events is easy! Simply use the provided decorator and indicate the event type that the handler should receive.
Review the Stripe documentation for more information about the types of events available.
@injectable()
class PaymentCreatedService {
@StripeWebhookHandler('payment_intent.created')
handlePaymentIntentCreated(evt: StripeEvent) {
// execute your custom business logic
}
}
Follow the instructions from the Stripe Documentation for remaining integration steps such as testing your integration with the CLI before you go live and properly configuring the endpoint from the Stripe dashboard so that the correct events are sent to your Deepkit app.
FAQs
Interacting with the Stripe API or consuming Stripe webhooks in your Deepkit applications is now easy as pie 🥧
We found that @deepkit-community/stripe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.