Skip to content

fix(paypal): handle zero-decimal currencies (JPY) during order creation (#29983) - #30002

Open
jihadMo wants to merge 1 commit into
calcom:mainfrom
jihadMo:fix/paypal-zero-decimal-currency-jpy-29983
Open

fix(paypal): handle zero-decimal currencies (JPY) during order creation (#29983)#30002
jihadMo wants to merge 1 commit into
calcom:mainfrom
jihadMo:fix/paypal-zero-decimal-currency-jpy-29983

Conversation

@jihadMo

@jihadMo jihadMo commented Aug 19, 2026

Copy link
Copy Markdown

Closes #29983

Summary of Changes

  • Uses convertFromSmallestToPresentableCurrencyUnit(amount, currency) from @calcom/lib/currencyConversions when constructing PayPal order purchase unit amounts in packages/app-store/paypal/lib/Paypal.ts.
  • Fixes critical pricing bug where zero-decimal currencies (such as Japanese Yen / JPY) were divided by 100, causing PayPal to collect only 1/100th of the organizer's configured price (e.g. ¥100 instead of ¥10,000).
  • Preserves standard minor-unit conversions for decimal currencies (USD, EUR, GBP, etc.).

Verification

  • Verified against @calcom/lib/currencyConversions:
    • JPY: 10000 -> "10000" (sent as full unscaled unit)
    • USD: 5000 -> "50" (sent as $50.00)

@github-actions github-actions Bot added the 🐛 bug Something isn't working label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @jihadMo! Thanks for opening this pull request.

A few things to keep in mind:

  • This is Cal.diy, not Cal.com. Cal.diy is a community-driven, fully open-source fork of Cal.com licensed under MIT. Your changes here will be part of Cal.diy — they will not be deployed to the Cal.com production app.
  • Please review our Contributing Guidelines if you haven't already.
  • Make sure your PR title follows the Conventional Commits format.

A maintainer will review your PR soon. Thanks for contributing!

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 00a0c30b-4e43-4571-8c6a-0bdda74f4766

📥 Commits

Reviewing files that changed from the base of the PR and between 176037d and a556e37.

📒 Files selected for processing (1)
  • packages/app-store/paypal/lib/Paypal.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

PayPal order creation now uses convertFromSmallestToPresentableCurrencyUnit(amount, currency) to convert amounts from smallest currency units. The previous fixed division by 100 is replaced. The required currency conversion utility is imported.

Merge Risk: ⚪ Minimal · up to a556e

The PR updates PayPal order amount conversion for zero-decimal currencies while preserving decimal-currency behavior. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the PayPal fix for zero-decimal currencies during order creation.
Description check ✅ Passed The description directly explains the currency conversion change, the JPY pricing bug, and verification results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@CLAassistant

CLAassistant commented Aug 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: PayPal charges JPY bookings 1/100th of the configured price

2 participants