# ngx-stripe-checkout

> With ngx-stripe-checkout you can integrate stripe checkout in angular.

Latest version **1.0.3** (published 2021-02-27) · 0 weekly downloads

## Install

```sh
npm install ngx-stripe-checkout
pnpm add ngx-stripe-checkout
yarn add ngx-stripe-checkout
bun add ngx-stripe-checkout
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-02-27 |
| First published | 2019-10-20 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 96.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | haripranesh |
| Keywords | angular, stripe, checkout, stripe client integration |

## Links

- npm: https://www.npmjs.com/package/ngx-stripe-checkout
- Repository: https://github.com/haripraneshHP/ngx-stripe-checkout
- Homepage: https://github.com/haripraneshHP/ngx-stripe-checkout#readme
- Issues: https://github.com/haripraneshHP/ngx-stripe-checkout/issues
- npm.io page: https://npm.io/package/ngx-stripe-checkout

## Recent versions

- 1.0.3 (latest) — 2021-02-27
- 1.0.2 — 2021-02-25
- 1.0.1 — 2019-10-20
- 1.0.0 — 2019-10-20
- 0.0.1 — 2019-10-20

## README

With ngx-stripe-checkout you can integrate stripe checkout in angular.

<img width="250px" src="https://res.cloudinary.com/ds5isiog4/image/upload/v1571595753/Payment-Gateway_Stripe.png">
<img width="250px" src="https://res.cloudinary.com/ds5isiog4/image/upload/v1571595824/2016815_1.jpg">

## Features

 * Lazy loading
 * Angular 4 and above 

<br/>

### Getting Started

Install with NPM:
```bash
$ npm i ngx-stripe-checkout --save
```

Stripe configurations:
```bash
Configure your stripe account for integrating checkout.
https://stripe.com/docs/payments/checkout
```

Import into your project:
```ts
// Module
import { StripeCheckout, StripeModule } from 'ngx-stripe-checkout';

@NgModule({
  declarations: [
  ],
  imports: [
    StripeModule
  ],
  providers: [
    StripeCheckout
  ],
  bootstrap: []
})
```
Import and initialize stripe in your component:
```ts
// Component
import { StripeCheckout, OnetimeCheckoutOptions, RecurringCheckoutOptions } from 'ngx-stripe-checkout';

  constructor(public stripe: StripeCheckout) {
	this.stripe.initializeStripe(`your stripe key`)
	.then((res) => console.log(res))	// Stripe Initialized
    .catch((err) => console.log(err));	// Error message
  }

// For Recurring Payments
// Invoke this function on button click
   openSubscriptionCheckout() {
    var checkoutOptions: RecurringCheckoutOptions = {
      items: [{
        plan: 'your plan id',
        quantity: 'quantity'
      }],
      successUrl: 'https://example.com/payment/success',
      cancelUrl: 'https://example.com/payment/failure'
    }
    this.stripe.openRecurringCheckout(checkoutOptions);
  }

// For One time Payments
// Invoke this function on button click
    var checkoutOptions: OnetimeCheckoutOptions = {
      items: [{
        sku: 'your sku id',
        quantity: 'quantity'
      }],
      successUrl: 'https://example.com/payment/success',
      cancelUrl: 'https://example.com/payment/failure'
      submitType: 'donate',
      billingAddressCollection: 'required'
    }
    this.stripe.openOnetimeCheckout(checkoutOptions);
  }
```

---
_Source: https://npm.io/package/ngx-stripe-checkout · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
