Hello,
how
does one change the expiration date of a balance?
I’ve tried changing it from the cgr-console on an existing balance as well as while creating a new balance:
cgr>
balance_set Tenant="1518536340" Account="default"
Balance={"ID":"*default", "ExpirationDate":
"2022-01-01T00:00:00Z"} Value=10
cgr> balance_add
Tenant="1518536340" Account="default"
Balance={"ID":"credit", "ExpirationDate":
"2022-01-01T00:00:00Z"} Value=10
It does change the Value to 10 but not the ExpirationDate. I’ve also tried it with HTTP curl using SetBalance method with the same result:
curl -v --noproxy "*" -X POST -i http://192.168.6.23:2088/jsonrpc --data '{"method":"ApierV1.SetBalance","params":[{"Tenant":"1518536340","Account":"default","BalanceType":"*monetary","Value":10,"Balance":{"ID":"*default", "ExpirationDate":"2022-01-01T00:00:00Z"},"ActionExtraData":null,"Cdrlog":false}],"id":1}'
curl
-v --noproxy "*" -X POST -i
http://192.168.6.23:2088/jsonrpc --data
'{"method":"ApierV1.SetBalance","params":[{"Tenant":"1518536340","Account":"default","BalanceType":"*monetary","Value":10,"Balance":{"ID":"*default"},"ActionExtraData":{"ExpirationDate":"2022-01-01T00:00:00Z"},"Cdrlog":false}],"id":1}'
I
don’t understand from the godoc
whether I should put the ExpirationDate in Balance or in
ActionExtraData or elsewhere.
Thanks.