fix(paypal): handle zero-decimal currencies (JPY) during order creation (#29983) - #30002
fix(paypal): handle zero-decimal currencies (JPY) during order creation (#29983)#30002jihadMo wants to merge 1 commit into
Conversation
|
Welcome to Cal.diy, @jihadMo! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughPayPal order creation now uses Merge Risk: ⚪ Minimal · up to 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)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
Closes #29983
Summary of Changes
convertFromSmallestToPresentableCurrencyUnit(amount, currency)from@calcom/lib/currencyConversionswhen constructing PayPal order purchase unit amounts inpackages/app-store/paypal/lib/Paypal.ts.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).Verification
@calcom/lib/currencyConversions:JPY: 10000 ->"10000"(sent as full unscaled unit)USD: 5000 ->"50"(sent as $50.00)