All Projects → dhaspden → nestjs-stripe

dhaspden / nestjs-stripe

Licence: MIT License
Provides an injectable Stripe client to nestjs modules

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to nestjs-stripe

direct-stripe
Stripe payment button for WordPress websites
Stars: ✭ 12 (-90.48%)
Mutual labels:  stripe, payment
stripe
Stripe integration with Magento 2
Stars: ✭ 58 (-53.97%)
Mutual labels:  stripe, payment-processing
cybersource-sdk-java
Java SDK for CyberSource Simple Order API
Stars: ✭ 44 (-65.08%)
Mutual labels:  payment, payment-processing
react-stripe-script-loader
A React Component that loads Stripe script if necessary and shows React Stripe Elements
Stars: ✭ 22 (-82.54%)
Mutual labels:  stripe, payment
stripe-update-card
💳 Expose a page that let your customers update their payment information on Stripe.
Stars: ✭ 16 (-87.3%)
Mutual labels:  stripe, payment
Chowder
Chowder for Android M-Pesa payments.
Stars: ✭ 31 (-75.4%)
Mutual labels:  payment, payment-processing
adyen-python-api-library
Adyen API Library for Python
Stars: ✭ 41 (-67.46%)
Mutual labels:  payment, payment-processing
Payum
PHP 7+ Payment processing library. It offers everything you need to work with payments: Credit card & offsite purchasing, subscriptions, payouts etc. - provided by Forma-Pro
Stars: ✭ 1,665 (+1221.43%)
Mutual labels:  stripe, payment
drf-stripe-subscription
An out-of-box Django REST framework solution for payment and subscription management using Stripe.
Stars: ✭ 42 (-66.67%)
Mutual labels:  stripe, payment
svelte-stripe-js
Everything you need to add Stripe Elements to your Svelte project
Stars: ✭ 139 (+10.32%)
Mutual labels:  stripe, payment
Omnipay Pingpp
A Ping++ driver for the Omnipay PHP payment processing library. 一个聚合了支付宝(APP、Wap、PC、即时到账、扫码、企业付款),微信(APP、公众号、红包), 银联网关、银联企业网银、Apple Pay、QQ 钱包、易宝支付、百度钱包、京东支付、京东白条、招行一网通、分期支付等国内主流支付渠道的聚合支付网关(Ping++, also known as Pingpp/Pingxx/Pingplusplus)
Stars: ✭ 227 (+80.16%)
Mutual labels:  stripe, payment
EPAYMENT
EPayment - Multi Payment Provider for .Net Core
Stars: ✭ 43 (-65.87%)
Mutual labels:  payment, payment-processing
Commerce billing
A payment processing library for Elixir
Stars: ✭ 170 (+34.92%)
Mutual labels:  stripe, payment
adyen-hybris
Adyen Payment plugin for Hybris
Stars: ✭ 23 (-81.75%)
Mutual labels:  payment, payment-processing
Stripe
Stripe library for Vapor
Stars: ✭ 151 (+19.84%)
Mutual labels:  stripe, payment
invoicing
GetPaid (Formerly the Invoicing plugin) is a lightweight Payments and Invoicing system for WordPress. It can be used to sell anything online via payment forms or buy now buttons that can be added to any landing page. It can also be used by freelancers to manage their Invoices or by 3rd party Themes and Plugins as their payment system. GeoDirecto…
Stars: ✭ 34 (-73.02%)
Mutual labels:  stripe, payment
Payumserver
Payment processing microservice. Written in Symfony4
Stars: ✭ 103 (-18.25%)
Mutual labels:  stripe, payment
Payumlaravelpackage
Payum offers everything you need to work with payments. From simplest use cases to very advanced ones.
Stars: ✭ 121 (-3.97%)
Mutual labels:  stripe, payment
adyen-salesforce-commerce-cloud
Salesforce Commerce Cloud (formerly Demandware)
Stars: ✭ 63 (-50%)
Mutual labels:  payment, payment-processing
PayumYiiExtension
Rich payment solutions for Yii framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more
Stars: ✭ 13 (-89.68%)
Mutual labels:  stripe, payment

nestjs-stripe

Injectable Stripe client for your nestjs projects

Table Of Contents

About

nestjs-stripe implements a module, StripeModule, which when imported into your nestjs project provides a Stripe client to any class that injects it. This lets Stripe be worked into your dependency injection workflow without having to do any extra work outside of the initial setup.

Installation

npm install --save nestjs-stripe

Getting Started

The simplest way to use nestjs-stripe is to use StripeModule.forRoot

import { Module } from '@nestjs-common';
import { StripeModule } from 'nestjs-stripe';

@Module({
  imports: [
    StripeModule.forRoot({
      apiKey: 'my_secret_key',
      apiVersion: '2020-08-27',
    }),
  ],
})
export class AppModule {}

You can then inject the Stripe client into any of your injectables by using a custom decorator

import { Injectable } from '@nestjs/common';
import { InjectStripe } from 'nestjs-stripe';
import Stripe from 'stripe';

@Injectable()
export class AppService {
  public constructor(@InjectStripe() private readonly stripeClient: Stripe) {}
}

Asynchronous setup is also supported

import { Module } from '@nestjs-common';
import { StripeModule } from 'nestjs-stripe';

@Module({
  imports: [
    StripeModule.forRootAsync({
      inject: [ConfigService],
      useFactory: (configService: ConfigService) => ({
        apiKey: configService.get('stripe_key'),
        apiVersion: '2020-08-27',
      }),
    }),
  ],
})
export class AppModule {}

Read up on the stripe-node caveats here. Due to the way stripe-node works you can only use the latest version of the Stripe API that was published at the time the module version was published. If you wish to use an older version of the Stripe API, follow the steps in the above link. Because of this, the apiVersion field is now required along with the apiKey field.

Example

In order to run the example run the following commands in your terminal. The expected output of the example is to show that the Stripe client was successfully injected into the AppService.

cd example
yarn install
yarn start

Contributing

I would greatly appreciate any contributions to make this project better. Please make sure to follow the below guidelines before getting your hands dirty.

  1. Fork the repository
  2. Create your branch (git checkout -b my-branch)
  3. Commit any changes to your branch
  4. Push your changes to your remote branch
  5. Open a pull request

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

Copyright © 2021 Dylan Aspden

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].