feat: implement tax calculations for subscription and SMS wallet payments
- Updated SubscriptionPeriod interface to include tax-related fields: tax_percent, tax_rials, and payable_rials. - Modified payment API documentation to reflect changes in tax handling for subscriptions and SMS wallet charges. - Adjusted PaymentController to calculate payment amounts based on subscription period details instead of client input. - Enhanced PaymentManager to handle net amounts for SMS wallet charges, ensuring tax is not credited to the wallet. - Created PaymentTaxCalculator and SubscriptionTaxCalculator services to manage tax calculations consistently across payment types. - Added tests for tax calculations in both subscription and SMS wallet contexts, ensuring correct behavior with and without tax enabled. - Updated frontend components to display tax information appropriately during payment processes.
This commit is contained in:
@@ -574,7 +574,13 @@ export interface SubscriptionPeriod {
|
||||
uuid: string;
|
||||
label: string;
|
||||
duration_months: number;
|
||||
/** قیمت خالص، بدون مالیات. */
|
||||
price_rials: number;
|
||||
/** درصد مالیات؛ با مالیاتِ خاموش برابر صفر. */
|
||||
tax_percent: number;
|
||||
tax_rials: number;
|
||||
/** قیمت خالص + مالیات — مبلغی که واقعاً پرداخت میشود. */
|
||||
payable_rials: number;
|
||||
is_trial: boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user