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

feat: Add auto payment methods for paid bookings on Stripe #18513

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

zomars
Copy link
Member

@zomars zomars commented Jan 8, 2025

What does this PR do?

This pull request includes several changes to the PaymentService class in the stripepayment module and enhancements to the handlePayment function in the payment module. The most important changes include enabling automatic payment methods, adding type annotations, and improving type safety with utility functions.

Enhancements to PaymentService:

  • Enabled automatic payment methods by adding the automatic_payment_methods property to the payment parameters in the PaymentService class.
  • Added type annotations to the params object in the PaymentService class to use Stripe.PaymentIntentCreateParams.

Improvements to handlePayment function:

  • Introduced isPaymentApp and isKeyOf utility functions to improve type safety and validation.
  • Refactored the handlePayment function to use the new utility functions for better validation and error handling.

refs #6629
fixes #5263

Here's a local test with Mexico-specific options:

image

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

@zomars zomars requested a review from joeauyeung January 8, 2025 00:44
@graphite-app graphite-app bot requested a review from a team January 8, 2025 00:44
Copy link

graphite-app bot commented Jan 8, 2025

Graphite Automations

"Add foundation team as reviewer" took an action on this PR • (01/08/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add ready-for-e2e label" took an action on this PR • (01/08/25)

1 label was added to this PR based on Keith Williams's automation.

@keithwillcode keithwillcode added core area: core, team members only foundation labels Jan 8, 2025
@dosubot dosubot bot added payments Created by Linear-GitHub Sync ✨ feature New feature or request labels Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

E2E results are ready!

@zomars zomars merged commit b9b0a86 into main Jan 8, 2025
63 of 84 checks passed
@zomars zomars deleted the feat/auto-pay-menthods-on-stripe branch January 8, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only ✨ feature New feature or request foundation payments Created by Linear-GitHub Sync ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3032] Allow other payment method types
3 participants