Git Product home page Git Product logo

stripe-event-types's Issues

Error When Trying to Commit to Github

I am trying commit files to github but I am getting an error from the package seen below:

Screenshot 2023-12-02 at 3 00 13 PM

I have tried deleting yarn and node_modules as well as tried to run yarn upgrade. I see that on npm it says status: build failing so I am guessing thats a factor.

Thanks!

Getting error deploying to google cloud, because the package is not a module

When I deploy a google cloud function that has this in it:

import Stripe from 'stripe';
import "stripe-event-types";

I get this error back from google cloud at deploy time:

Provided module can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module 'stripe-event-types'
Require stack:
- /workspace/dist/cjs/paymentIntentPayloadToMutations.js
- /workspace/dist/cjs/index.js
- /workspace/node_modules/@google-cloud/functions-framework/build/src/loader.js
- /workspace/node_modules/@google-cloud/functions-framework/build/src/main.js

I'm 99% sure this is because stripe-event-types isn't a module i.e. it has no main property in package.json

What is the recommended way of permitting import of this package as a module? Thx!

Missing treasury event types?

Looks like we are missing the treasury event types

/// <reference types="stripe-event-types" />

import express from "express";
import Stripe from "stripe";

export const webhook = async (
    req: express.Request,
    res: express.Response
  ) => {
    const event = req.body as Stripe.DiscriminatedEvent;
    if (event.type === "treasury.outbound_payment.posted") { // causes a ts(2367) "no overlap" error

    }
    if (event.type === "treasury.outbound_payment.returned") { // causes a ts(2367) "no overlap" error

    }
  }

I'd be happy to jump in and help implement this if you can point me in the right direction

Order and SKU are not exported in stripe v11.7.0

[12:28:04 PM] File change detected. Starting incremental compilation...

node_modules/stripe-event-types/index.d.ts:519:46 - error TS2694: Namespace '"stripe".Stripe' has no exported member 'Order'.

519         data: DiscriminatedEvent.Data<Stripe.Order>;
                                                 ~~~~~

node_modules/stripe-event-types/index.d.ts:642:46 - error TS2694: Namespace '"stripe".Stripe' has no exported member 'Sku'.

642         data: DiscriminatedEvent.Data<Stripe.Sku>;
                                                 ~~~

[12:28:15 PM] Found 2 errors. Watching for file changes.

Type reference not being recognized

When referencing the package I get an error saying

Namespace '"stripe".Stripe' has no exported member 'DiscriminatedEvent'.

I am working on a nestjs project and this is what my code looks like

import { Controller, Post, Req } from "@nestjs/common";
import { Request } from "express";
import Stripe from "stripe";

/// <reference types="stripe-event-types" />

@Controller("stripe")
export class StripeController {
  private readonly stripe: Stripe;

  constructor() {
    this.stripe = new Stripe("secret", {
      apiVersion: "2022-08-01",
    });
  }

  @Post()
  async webhook(@Req() req: Request) {
    const event = this.stripe.webhooks.constructEvent(
      req.body,
      req.headers["stripe-signature"],
      "secret"
    ) as Stripe.DiscriminatedEvent; // <--- error here
    console.log(event);
  }
}

I managed to fix the type issue by directly importing the package instead of referencing

import "stripe-event-types";

However, I now get this error when building or starting the dev server

Error: Cannot find module 'stripe-event-types'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.