cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

feat: BTCPay Server App

Open TChukwuleta opened this issue 7 months ago • 9 comments

What does this PR do?

  • Adds BTCPay Server as a new payment gateway to Cal.com

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Mandatory Tasks (DO NOT REMOVE)

  • [x] I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • [x] 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.
  • [x] I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Relevant docs would be shared upon request

Checklist


Summary by mrge

Added BTCPay Server as a new payment processor option in Cal.com, allowing users to accept Bitcoin payments for bookings.

  • New Features
    • Integrated BTCPay Server setup and credential management in the app store.
    • Enabled Bitcoin payment flow with checkout, webhook handling, and event type configuration.
    • Added UI components for payment, settings, and key input.

TChukwuleta avatar May 08 '25 17:05 TChukwuleta

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: anikdhabal
:x: TChukwuleta
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar May 08 '25 17:05 CLAassistant

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Include BTCPay server as a payment processor option to Cal.com". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

github-actions[bot] avatar May 08 '25 17:05 github-actions[bot]

@TChukwuleta is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar May 08 '25 17:05 vercel[bot]

Graphite Automations

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

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

"Add community label" took an action on this PR • (05/08/25)

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

graphite-app[bot] avatar May 08 '25 17:05 graphite-app[bot]

Hey @TusharBhatt1 thanks for pointing it out

Resolved the comments.

TChukwuleta avatar May 10 '25 18:05 TChukwuleta

Hey all, great to see this integration taking shape, it’s a strong open-source match! 🚀

@TChukwuleta from our team is leading the dev side, but I’d love to explore a potential marketing collaboration to help us highlight this feature and reach both communities.

We did something similar with InvoiceNinja a while back and it turned out great: link

@PeerRich I’ve been following your work on X for years just sent you an email, but feel free to ping me there too: https://x.com/pavlenex

pavlenex avatar May 16 '25 11:05 pavlenex

Hey all, great to see this integration taking shape, it’s a strong open-source match! 🚀

@TChukwuleta from our team is leading the dev side, but I’d love to explore a potential marketing collaboration to help us highlight this feature and reach both communities.

We did something similar with InvoiceNinja a while back and it turned out great: link

@PeerRich I’ve been following your work on X for years just sent you an email, but feel free to ping me there too: https://x.com/pavlenex

yeah lets do it!

[email protected]

PeerRich avatar May 16 '25 13:05 PeerRich

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Jun 13 '25 00:06 github-actions[bot]

@TChukwuleta Can you also add a README with steps to set it up locally?

anikdhabal avatar Jun 24 '25 14:06 anikdhabal

@TChukwuleta Can you also add a README with steps to set it up locally?

Hey @anikdhabal

https://github.com/btcpayserver/btcpayserver-doc/pull/1506/files

you can look at Cal.md file.

Edit: The only thing that would be needed locally to test it out would be to have a BTCPay account ran locally (https://github.com/btcpayserver/btcpayserver) or in live demo (https://mainnet.demo.btcpayserver.org/login).

https://deploy-preview-1506--btcpayserver-docs-preview.netlify.app/calcom/

Lemme if you need any assistance

TChukwuleta avatar Jun 24 '25 14:06 TChukwuleta

Hey @anikdhabal @PeerRich When do we expect this one to go through? We'd love to have a rough time-frame so we can work on the announcement on our end.

pavlenex avatar Jul 14 '25 08:07 pavlenex

It would be great if this feature were available. The existing Alby app doesn't work properly unless you install the Alby extension in your browser when you need to pay for your reservation. Additionally, the "Show QR" button doesn't work to allow you to pay with an external wallet other than the Alby browser extension; it shows a 500 error in many cases.

imagen

Or after making the payment successful, the screen remains indefinitely in this state:

https://github.com/user-attachments/assets/695e21af-3262-4e9d-b82f-507915b32615

And the book status is still showing "Pending payment":

imagen

Many bugs....

twofaktor avatar Jul 23 '25 11:07 twofaktor

[!IMPORTANT]

Review skipped

Review was skipped due to path filters

:no_entry: Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This change introduces a comprehensive integration of BTCPay Server as a payment provider within the application ecosystem. The update includes new backend API handlers, React UI components, configuration schemas, and supporting utility modules. A webhook handler for BTCPay payment notifications is implemented with signature validation and booking status updates. The integration features dynamic imports and registration in various app store mapping files, Zod-based schema validation for credentials and payment options, and Prisma-based repository interfaces for payment data access. The UI includes setup, configuration, and payment processing components, with appropriate server-side and client-side logic for credential management and payment tracking.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Complexity label: Complex
Rationale:

  • The change introduces a full-featured payment integration, spanning backend API endpoints, React UI components, schema definitions, configuration files, and database repository interfaces.
  • Several files contain non-trivial logic, such as the webhook handler, payment service class, and React setup/payment components.
  • The update affects multiple layers of the application (API, UI, database, configuration), requiring careful review for correctness, security (e.g., signature validation), and integration consistency.
  • Estimated review time considers the need to cross-verify schema usage, API contract adherence, and the interplay between newly introduced and existing modules.
✨ Finishing Touches
🧪 Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jul 25 '25 13:07 coderabbitai[bot]

Hey @anikdhabal I have addressed the reviews

TChukwuleta avatar Jul 25 '25 16:07 TChukwuleta

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License

View full report

socket-security[bot] avatar Jul 29 '25 10:07 socket-security[bot]

E2E results are ready!

github-actions[bot] avatar Jul 29 '25 10:07 github-actions[bot]