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

[SC-11] Integrated Stripe API and added another donation page (v2) and a post-successful donation page #25

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

thanhliemtu
Copy link
Collaborator

image
image

}
],
mode="payment",
success_url="https://google.com", # this should route to the /success page
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you use this for testing? if so can you change this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changing this requires us to have a public facing domain, I can't put "http://localhost:3000" to redirect to the "/success" page in the front-end. I used ngrok to get a temporary public domain that mapped to my port 3000, allowing me to test it

Copy link
Collaborator

Choose a reason for hiding this comment

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

fair enough, could you make a note to change this once we do have a proper domain?

case ("true", "50"):
return "price_1QwQioLtztZ9KxoQdil8ZPj0"
case ("false", _):
return "price_1QuMCdLtztZ9KxoQXBt26UDy"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not know what these values represent, in the case of a non-fixed amount being donated what happens?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are the price id for a specific product in Stripe, I hard coded them for now. In the case where a non-fixed amount being donate, it's also just another price id.
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see, so if I donated 60 dollars then the last hardcoded value will represent that in the stripe end?

@@ -27,7 +27,7 @@ def send_payment_recieved_email(request):
from_email = Email(STOCK_CHARITY_EMAIL)
to_email = To(request.data["receiver"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you utilize this work in order to send emails if there is a successful donation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could, but I'm not sure how to retrieve the authentication of the logged in user (their emails) at the moment

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you discuss this with William?

@@ -45,7 +45,7 @@ const NavBar: React.FC = () => {
<Link href="/account" className="hover:text-[#007bff] text-[#333] block font-semibold text-[15px]">Account</Link>
</li>
<li className="max-lg:border-b max-lg:py-3 px-3">
<Link href="/donate" className="hover:text-[#007bff] text-[#333] block font-semibold text-[15px]">Donate</Link>
<Link href="/donate_v2" className="hover:text-[#007bff] text-[#333] block font-semibold text-[15px]">Donate</Link>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you have to create a new page here instead of modifying /donate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't modify the old donate page since I thought maybe we could find a use or repurpose it in the future

Copy link
Collaborator

@VamsiGajjela VamsiGajjela left a comment

Choose a reason for hiding this comment

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

Also the backend CI seems like there's an issue

@thanhliemtu
Copy link
Collaborator Author

Also the backend CI seems like there's an issue

It seems the build script for the backend doesn't have the STRIPE_SECRET_KEY environmental variable

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.

2 participants