playSMS Forum

How can I access the function that adds sms credit to users on playsms after making payment?

Hi everyone, I successfully added a payment option that is not currently included or bundled with in PlaySMS.

The challenge I now have is how to access the function that handles adding or crediting sms to a specific user after they have made payment.

Please help or advise on how I can sort this out whether through any link or just pointing me to the file with the code.

Thank you for your time. Cheers.

Hi,

Example of adding credit can be found here:

The function to add credit to a user is credit_add()

To reduce it also using the same function credit_add() but the amount is negative.

anton

I remember there are more official way to add/deduct credit:

  • rate_addusercredit($uid, $amount)
  • rate_deductusercredit($uid, $amount)

both functions are hooked by credit’s functions in plugin/feature/credit/fn.php if you want to know how they work

$amount is positive value.

you can call those functions from your plugin should you need to add/deduct a user’s credit.

anton

Hi Thomas,
Did you succeed to fix the issue?
Please can you help by sharing The steps how you did to implement payment option on PlaySMS?
Thank you