Conversation
Austin2Shih
approved these changes
May 20, 2024
Contributor
Austin2Shih
left a comment
There was a problem hiding this comment.
This looks good! There are a few things we can do to clean up the code but I think it'll be best if you start working on integrating your stuff with the GraphQL API to be able to update order status or like createOrders when we get pinged. Both the CreateOrder and UpdateOrder stuff should already be made.
You can start with unhardcoding this stuff first though.
A few things: - Moved PaymentForm to ShippingInfo.tsx to be able to pass billing info as props - The billing info form is wrapped as a div instead of a form to prevent nested forms, and also because there's no button connected to it - A few components have been changed to accept a handful of props for billing info In summary, the billing info is not hardcoded and uses whatever information is inputted in our form 👍
Just wrote out a mutation for posting billing info to our own database rathe than having to hop on Stripe to manage orders. This is done ONLY after the order successfully goes through Stripe. Also I made two queries for grabbing all the orders or just one order from our database. Only thing is that everything isn't tested because I couldn't see if my branch had a way for me to run a server (if that's setup already) (Austin or Brandon please save me tomorrow in meeting if you see this before)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If needed I can of course walk through in a call what I did/how what I did works.
(Assuming this is Austin reviewing) This works from /checkout. I have a super basic credit card info form to make payments since the checkout form already has stuff like address. From last time we created a checkout form on the backend with:
const session = await auth_stripe.checkout_session.create({})But for this, I swapped it (as well as the params) to:
const session = await auth_stripe.paymentIntents.createEverything seems to be plug and play. I hardcoded billing info name, email, as well as the amounts for the payment intent, but when it all goes through I console.log everything from the payment intent. The payment intent doesn't directly give me the payment method, but it gives me a payment method ID, which I used to fetch payment methods to get stuff like the last 4 digits of someone's credit card (this is all console.logged).