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

Update Custom Checkout types #567

Merged
merged 6 commits into from
Mar 4, 2024
Merged

Conversation

danwang-stripe
Copy link
Contributor

@danwang-stripe danwang-stripe commented Mar 1, 2024

Summary & motivation

r? @pololi-stripe

Update Custom Checkout types for custom_checkout_beta_2

  • Added lineItem.amountsSubtotal, amountDiscount, amountTaxInclusive, amountTaxExclusive
  • Removed lineItem.amount
  • Added lineItem.recurring.usageType, isProrated, intervalCount
  • Removed lineItem.recurring.interval_count
  • Added total.appliedBalance and balanceAppliedToNextInvoice
  • Added tax
  • Added status
  • Added recurring
  • Added lastPaymentError
  • Added discount.recurring
  • Added lineItem.adjustableQuantity

Testing & documentation

types/stripe-js/custom-checkout.d.ts Outdated Show resolved Hide resolved
types/stripe-js/custom-checkout.d.ts Outdated Show resolved Hide resolved
@danwang-stripe
Copy link
Contributor Author

r? @pololi-stripe

Updated in b475dd9 and f175d7e

  • Added line item adjustable quantity (forgot this earlier)
  • Updated type for ECE. To do this, I split all the ECE events into separate interfaces, then recombined them in the ECE type, and selected only the applicable events for Custom Checkout.

@danwang-stripe
Copy link
Contributor Author

r? @pololi-stripe

I ditched the strategy of trying to reuse existing definitions. Instead, I just copied in the on/once/off methods for all events that we need, changing the return type in e80ef80

Copy link
Contributor

@pololi-stripe pololi-stripe left a comment

Choose a reason for hiding this comment

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

one minor comments

types/stripe-js/custom-checkout.d.ts Outdated Show resolved Hide resolved
Co-authored-by: Polo Li <65737086+pololi-stripe@users.noreply.github.com>
@danwang-stripe danwang-stripe merged commit 06d2a95 into master Mar 4, 2024
2 checks passed
@danwang-stripe danwang-stripe deleted the danwang/custom_checkout_beta_2 branch March 4, 2024 18:44
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