Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating stripe checkout session endpoint #42

Closed
wants to merge 7 commits into from

Conversation

strawluck
Copy link
Collaborator

@strawluck strawluck commented Jun 4, 2024

Notion ticket link

Ticket Name

Implementation description

We implemented a Stripe Checkout session for a one time payment by first creating the Stripe route that calls the Stripe service which calls and creates a checkout session. This is a basic endpoint that when called, it will direct the user to a separate page to a checkout session and it currently shows a static item in the checkout (one product).

Things to implement / keep in mind for later tickets:

  • need to add an attribute of ui_mode: "embedded" to checkoutSessionDefaultOptions in order to make the checkout session embedded into the page instead of going to a separate Stripe checkout page (is a bit more complicated and requires a frontend component to test)
  • add/edit endpoint to allow for subscriptions
  • when adding subscriptions, we must store the session_id in the database so it can be accessed later (when wanting to cancel or update the subscription)

Steps to test

What should reviewers focus on?

  • test that the endpoint works and a session.url is returned (to a separate webpage of a checkout session)
  • we also noticed that in donationService.ts, that one of the types for is_recurring should be of type Recurrence?

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@strawluck strawluck changed the title creating checkout session endpoint creating stripe checkout session endpoint Jun 4, 2024
);

/*
stripeRouter.post("/create-checkout-session-subscription", async (req, res) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint still a WIP?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mat-ng
Copy link
Collaborator

mat-ng commented Jun 6, 2024

Looking good so far! Thanks for also including that db work, so we store Stripe session ids internally.

Can you also include sample requests and responses in this PR for your new endpoints?

@strawluck strawluck closed this Jun 11, 2024
@andy-liuu
Copy link
Collaborator

superseded by #46 to remove ongoing db changes from PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants