Skip to content

Comments

feat(currency): add Iranian Rial support #241

Merged
superdav42 merged 1 commit intoUltimate-Multisite:mainfrom
mahyarrezghi:feat/iranian-rial-currency
Oct 15, 2025
Merged

feat(currency): add Iranian Rial support #241
superdav42 merged 1 commit intoUltimate-Multisite:mainfrom
mahyarrezghi:feat/iranian-rial-currency

Conversation

@mahyarrezghi
Copy link
Contributor

@mahyarrezghi mahyarrezghi commented Oct 14, 2025

Added Iranian Rial (IRR) as a supported payment currency in the Ultimate plugin.

Includes:

  • Currency code: IRR
  • Symbol: ﷼

Summary by CodeRabbit

  • New Features
    • Added full support for the Iranian Rial (IRR).
    • IRR is now available in currency settings with the correct Rial symbol.
    • IRR is treated as a zero-decimal currency, ensuring accurate pricing, rounding, and display across checkout, plans, invoices, subscriptions, and receipts.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Added Iranian Rial (IRR) support by updating currency lists, symbol mapping, and zero-decimal handling within existing currency utility functions in inc/functions/currency.php. No function signatures changed; all updates are data additions inside current public functions.

Changes

Cohort / File(s) Summary
Currency support updates
inc/functions/currency.php
Added IRR to wu_get_currencies(); mapped Rial symbol in wu_get_currency_symbol(); marked IRR as zero-decimal in wu_is_zero_decimal_currency().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A hop and a skip through code we compile,
I tuck IRR in with a satisfied smile.
Symbols aligned, decimals at zero—
Rial joins the ledger, a brand-new hero.
Thump-thump goes my review, concise and spry,
Carrots for currencies—now watch them fly! 🥕💱

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the core change by indicating that support for the Iranian Rial currency has been added within the currency feature. It follows conventional formatting, is clear, concise, and directly references the main enhancement without extraneous details. This phrasing aligns with the PR objectives and will be easily understood by collaborators scanning the repository history.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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

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

@mahyarrezghi mahyarrezghi changed the title Added Iranian Rial (IRR) with ﷼ symbol feat(currency): add Iranian Rial support Oct 14, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
inc/functions/currency.php (2)

160-160: Consider maintaining alphabetical order in the currency list.

The IRR entry is correct, but it's appended at the end rather than in alphabetical position. To maintain consistency with the rest of the currency list (which appears alphabetically sorted by currency code), consider placing IRR between 'INR' (line 77) and 'ISK' (line 78).

Apply this diff to move IRR to its alphabetical position:

 		'INR' => __('Indian Rupee', 'ultimate-multisite'),
+		'IRR' => __('Iranian Rial', 'ultimate-multisite'),
 		'ISK' => __('Icelandic Króna', 'ultimate-multisite'),

And remove the duplicate entry from line 160:

 		'ZMW' => __('Zambian Kwacha', 'ultimate-multisite'),
-		'IRR' => __('Iranian Rial', 'ultimate-multisite'),
 	]

433-433: Consider maintaining alphabetical order in the zero-decimal currency list.

IRR is correctly classified as a zero-decimal currency (consistent with how payment processors like Stripe handle Iranian Rial). However, to maintain consistency with the alphabetically sorted list, consider placing IRR between 'GNF' and 'JPY'.

Apply this diff to move IRR to its alphabetical position:

 		'GNF', // Guinean Franc
+		'IRR', // Iranian Rial
 		'JPY', // Japanese Yen

And remove the duplicate entry from line 433:

 		'XPF', // CFP Franc
-		'IRR', // Iranian Rial
 	];
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb97d74 and 1a3c7c2.

📒 Files selected for processing (1)
  • inc/functions/currency.php (3 hunks)
🔇 Additional comments (1)
inc/functions/currency.php (1)

196-198: LGTM! Symbol mapping is correct.

The Rial symbol '﷼' (U+FDFC) is properly mapped for IRR. The implementation follows the existing pattern in the switch statement.

Copy link
Collaborator

@superdav42 superdav42 left a comment

Choose a reason for hiding this comment

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

LTGM. Thanks

@superdav42 superdav42 merged commit 767177a into Ultimate-Multisite:main Oct 15, 2025
1 check passed
@superdav42
Copy link
Collaborator

@mahyarrezghi Just wondering which payment method you will be using because I don't think stripe supports IRR

@mahyarrezghi
Copy link
Contributor Author

@superdav42 That’s right, nearly all global payment gateways don’t support IRR. I created an MU-plugin to integrate one of the Iranian payment gateways instead.

@mahyarrezghi mahyarrezghi deleted the feat/iranian-rial-currency branch October 15, 2025 12:37
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