-
Notifications
You must be signed in to change notification settings - Fork 46
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
Conversation
- Added endpoint to create stripe subscriptions - Add services to: Create stripe products Create stripe customers Create stripe subscriptions
This is where it should belong
✅ Tests will run for this PR. Once they succeed it can be merged. |
Needed for creating wishes after payment has been made
@@ -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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)
There are some conflicts to be resolved however... |
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.