Skip to content

Commit

Permalink
docs: update stripe documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Aug 30, 2023
1 parent c11ff8f commit 77a8649
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/tutorials/stripe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ meta:
content: Use Stripe with Express, TypeScript and Ts.ED. The Stripe Node library provides convenient access to the Stripe API from applications written in server-side JavaScript.
- name: keywords
content: ts.ed express typescript stripe node.js javascript decorators
projects:
- title: Kit Stripe
href: https://github.com/tsedio/tsed-stripe-example
src: /stripe.svg
---

# Stripe
Expand All @@ -16,6 +20,8 @@ The Stripe Node library provides convenient access to the Stripe API from applic

For collecting customer and payment information in the browser, use [Stripe.js](https://stripe.com/docs/stripe.js).

<Projects type="projects"/>

## Features

Currently, [`@tsed/stripe`](https://www.npmjs.com/package/@tsed/stripe) allows you to:
Expand Down Expand Up @@ -66,6 +72,20 @@ export class Server {
See Stripe options for more details: https://www.npmjs.com/package/stripe
:::

`STRIPE_SECRET_KEY` can be retrieved on the Stripe Dashboard here: https://dashboard.stripe.com/test/apikeys

And the `STRIPE_WEBHOOK_SECRET` can be retrieved by using the `stripe listen` or `stripe forward`:

```sh
stripe listen

> Ready! You are using Stripe API Version [2020-08-27]. Your webhook signing secret is whsec_*****************************
```

::: note
You have to install the `stripe-cli` to run `stripe listen`. See https://stripe.com/docs/stripe-cli.
:::

## Inject Stripe

```typescript
Expand Down Expand Up @@ -224,6 +244,16 @@ describe("Stripe", () => {
});
```

### Known issue

If you have the followings message, it means you have an issue with your STRIPE_WEBHOOK_SECRET.

```sh
Error message: No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?
```

Please double-check your configuration!

## Author

<GithubContributors users="['Romakita']"/>
Expand Down

0 comments on commit 77a8649

Please sign in to comment.