Balance is not updated with new gateway

Hello,
I am developing a new gateway. I have been able to successfully send emails via playsms, but i am having a problem with credit balance.
Although the logs are correctly shown the cost associated with the sms send, the balance showd for the user is not deducted.

    • 2015-06-11 12:58:19 PID55795bbb4c65c - L3 simplerate_hook_rate_getbyprefix # found rate id:2 prefix:35 rate:0.001 description:CYP to:3575857845
    • 2015-06-11 12:58:19 PID55795bbb4c65c - L3 simplerate_hook_rate_getcharges # uid:1 u:admin len:168 unicode:1 to:3575857845 enable_credit_unicode:0 count:3 rate:0.001 charge:0.003
    • 2015-06-11 12:58:19 PID55795bbb4c65c - L2 simplerate__cansend # allowed user uid:1 sms_to:3575857845 credit:9.858 count:3 rate:0.001 charge:0.003 balance:9.855

So the final balance for this user should be 9.855
It is not. It constantly show me 9.858 the previous balance and i cannot figure out why? can someone please tell me what might be wrong?

can you send me a longer log ? pm me or paste here after sanitizing the log

make sure you’re doing only single test and no other activities (so that the log can be easily understood)

anton

Send you a pm(debug mode=3). it is a long log tell me if you want me to send you something else.
Becaause I also noticed that on Reports -> Credit transactions i don’t see any updates. My initial balance is 10.000 and remains the same no matter how many times i sent an sms

Hi,

This is from your longer log:

- - 2015-06-11 13:24:21 PID557961d4cefe6 - L3 dlr # isdlrd:1 smslog_id:108 p_status:2 uid:1
- - 2015-06-11 13:24:21 PID557961d4cefe6 - L3 XXXXXX_hook_sendsms # sendsms end
- - 2015-06-11 13:24:21 PID557961d4cefe6 - L2 sendsms_process # fail no hook for sendsms
- - 2015-06-11 13:24:21 PID557961d4cefe6 - L2 sendsms_process # end

Your gateway said it was failed, so playSMS did not billed it.

anton

But how is this possible?
I mean i am receiving the sms from them? Why do they report that it failed?
Is there any case i have messed up the success flags?

no, not them, your code decide it was failed.

just above the log I pasted before, you got this:

- - 2015-06-11 13:24:21 PID557961d4cefe6 - L2 XXXXXX__outgoing # failed smslog_id:108 resp:

do you expect resp empty or it supposed to be something ? check again.

anton