mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 05:39:54 +05:00
CDRs refundCDR method implementation
This commit is contained in:
@@ -286,9 +286,20 @@ func (cdrS *CDRServer) rateCDRWithErr(cdr *CDRWithArgDispatcher) (ratedCDRs []*C
|
||||
return
|
||||
}
|
||||
|
||||
// refundCDR will refund the EventCost within the CDR
|
||||
func (cdrS *CDRServer) refundCDR(cdr *CDR) (err error) {
|
||||
|
||||
return
|
||||
if !AccountableRequestTypes.HasField(cdr.RequestType) || cdr.CostDetails == nil {
|
||||
return // non refundable
|
||||
}
|
||||
cd := cdr.CostDetails.AsRefundIncrements(cdr.ToR)
|
||||
if cd == nil || len(cd.Increments) == 0 {
|
||||
return
|
||||
}
|
||||
var acnt engine.Account
|
||||
if err = cdrS.rals.Call(utils.ResponderRefundIncrements,
|
||||
&engine.CallDescriptorWithArgDispatcher{CallDescriptor: cd}, &acnt); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// chrgProcessEvent will process the CGREvent with ChargerS subsystem
|
||||
|
||||
@@ -35,6 +35,12 @@ var NonMonetaryBalances = MapEvent{
|
||||
utils.GENERIC: struct{}{},
|
||||
}
|
||||
|
||||
var AccountableRequestTypes = MapEvent{
|
||||
utils.MetaPrepaid: struct{}{},
|
||||
utils.MetaPostpaid: struct{}{},
|
||||
utils.MetaPseudoprepaid: struct{}{},
|
||||
}
|
||||
|
||||
// ChargingInterval represents one interval out of Usage providing charging info
|
||||
// eg: PEAK vs OFFPEAK
|
||||
type ChargingInterval struct {
|
||||
|
||||
Reference in New Issue
Block a user