60 lines
3.0 KiB
Plaintext
60 lines
3.0 KiB
Plaintext
|
Documentation of cma
|
||
|
----------------------
|
||
|
|
||
|
1. GetOTP
|
||
|
===========
|
||
|
-->Send mobilenumber and countrycode in POST method using getOtp link
|
||
|
-->get mobilenumber and countrycode from application
|
||
|
-->check mobilenumber exist or not
|
||
|
-->if exist means
|
||
|
-->send to msg91 with mobilenumber and otp, get response from msg91
|
||
|
-->final result sent as response
|
||
|
-->not exist means insert mobilenumber and countrycode in register table
|
||
|
-->final result sent as response
|
||
|
|
||
|
2. VerifyOTP
|
||
|
============
|
||
|
-->send mobilenumber and otp as base64encode and devicetype,devicetoken,deviceid as normal value in POST method using verifyOtp link
|
||
|
-->get mobilenumber and otp as base64 decodemethod and also get devicetype,devicetoken,deviceidfrom application
|
||
|
-->send to msg91 with mobilenumber and otp, get response from msg91
|
||
|
-->final result sent as response
|
||
|
-->check that response is seccess or error
|
||
|
-->Get userid from select query by using mobile number
|
||
|
-->if success means update those values into register table by using userId
|
||
|
-->not success means show error
|
||
|
|
||
|
3.ResendOTP
|
||
|
===========
|
||
|
-->Send mobilenumber in POST method using resendOtp link
|
||
|
-->get mobilenumber and countrycode from application
|
||
|
-->Get counrtycode from select query by using mobile number
|
||
|
-->send to msg91 with mobilenumber and get response from msg91
|
||
|
-->final result sent as response
|
||
|
|
||
|
4.Listplans
|
||
|
==========
|
||
|
-->using userid and deviceid we have to check there is any data in register table(this is for check which device is having this app with this mobile number)
|
||
|
-->if yes
|
||
|
-->check trial_status is 0 or 1 in register table (trial_status from select query of userid & deviceid)
|
||
|
-->if 0 means show all palns in plan table
|
||
|
-->sent code is 1 for success & message & result
|
||
|
-->if 1 means show plans without trial plan
|
||
|
-->sent code is 1 for success & message & result
|
||
|
-->if no
|
||
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|
||
|
|
||
|
5.SubscribePlan
|
||
|
==============
|
||
|
-->using userid and deviceid ,we have to check there is any data in register table with deviceid and userid(this is for check which device is having this app with this mobile number)
|
||
|
-->if yes
|
||
|
-->get mobile and plan from application also get plan table all details using select query
|
||
|
-->check there is any match from select query of planid and given request plan id
|
||
|
-->if match
|
||
|
-->get usertype(1-free,0-payment) is 1 or 0
|
||
|
-->if 1 this is free plan
|
||
|
-->update details trial-status=1,status=2(activeplan),plan_type=1,startdate,enddate with 7days(dynamically get days from above select query) perid in register table by using mobilenumber
|
||
|
-->if 0 means this is paid plan
|
||
|
-->update details status=2(activeplan),plan_type=2(dynamic),startdate,enddate with 365days(dynamically get days from above select query) perid in register table by using mobilenumber
|
||
|
-->sent code is 1 for success & message & planid
|
||
|
-->if no
|
||
|
-->show code is 2 for error & message is "this mobile number is register with another device please check"
|