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

refactor(stripe): Use PaymentIntent and subscriptions instead of Checkout sessions #627

Merged
merged 22 commits into from
Oct 9, 2024

Conversation

sashko9807
Copy link
Member

@sashko9807 sashko9807 commented Apr 11, 2024

Closes #473 #466

Motivation and context

Continuation of #479
-Replaced current implementation of Stripe.Checkout Sessions with Stripe's PaymentIntent and Subscriptions APIs.
-Refactored the donation module. Removed any logic not related to donations(e.g. payment provider logic), and moved it to its own module.

  • Created Stripe's own module.
  • Moved updateDonationPayment, from CampaignService, to DonationService

Copy link

github-actions bot commented Apr 11, 2024

✅ Tests will run for this PR. Once they succeed it can be merged.

@sashko9807 sashko9807 changed the title feat: Add support for stripe setupIntent and subscription create refactor(stripe): Use PaymentIntent and subscriptions instead of Checkout sessions Apr 30, 2024
@sashko9807 sashko9807 marked this pull request as ready for review April 30, 2024 15:11
@sashko9807 sashko9807 added the run tests Allows running the tests workflows for forked repos label Apr 30, 2024
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Apr 30, 2024
@sashko9807 sashko9807 added the run tests Allows running the tests workflows for forked repos label Jun 19, 2024
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Jun 19, 2024
@@ -36,7 +36,7 @@ export function getPaymentData(
charge?: Stripe.Charge,
): PaymentData {
const isAnonymous = paymentIntent.metadata.isAnonymous === 'true'

console.log(charge?.payment_method_details?.card?.country)
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a leftover.

@@ -63,6 +63,7 @@ export function getPaymentData(

export function getPaymentDataFromCharge(charge: Stripe.Charge): PaymentData {
const isAnonymous = charge.metadata.isAnonymous === 'true'
console.log(charge?.payment_method_details?.card?.country)
Copy link
Contributor

Choose a reason for hiding this comment

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

same here


let metadata: DonationMetadata = {
Logger.log('[ handleInvoicePaid ]', invoice)
const charge = await this.stripeService.findChargeById(invoice.charge as string)
Copy link
Contributor

Choose a reason for hiding this comment

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

We are using this variable 30 lines below.
Can we move this line closer to:

const paymentData = getInvoiceData(invoice, charge)

@slavcho
Copy link
Contributor

slavcho commented Aug 31, 2024

There are some conflicts to be resolved however...

@sashko9807 sashko9807 added the run tests Allows running the tests workflows for forked repos label Sep 13, 2024
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Sep 13, 2024
@slavcho slavcho merged commit f96d503 into podkrepi-bg:master Oct 9, 2024
10 of 11 checks passed
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.

New Donation Flow - Recurring Payments Setup Intent
3 participants