- Joined
- Mar 10, 2011
- Messages
- 229
- Reaction score
- 50
Im using
THIS IS INCOMPLETE YOU MUST HAVE A KNOWLEDGE IN CODING IN ORDER TO FINISH THIS
ITS UP TO YOU NOW IF YOU WANT TO SHARE IT OR KEEP IT FOR YOUR SELF
SCREENSHOT :
You must be registered to see links
as GATEWAY to Get SMS From MobileTHIS IS INCOMPLETE YOU MUST HAVE A KNOWLEDGE IN CODING IN ORDER TO FINISH THIS
Things to do :
1.) make it run 24/7 just like discord bot
2.) add sql module for auto add topup code in RanDatabase
3.) modify the code so it will be beautiful
ITS UP TO YOU NOW IF YOU WANT TO SHARE IT OR KEEP IT FOR YOUR SELF
Code:
import requests
class gcashpayments:
def check_message():
keywords = ["You have received PHP "," of GCash from ","Ref. No. "]
url = "https://api.telerivet.com/v1/projects/<project_id_here>/messages"
header = {"Content-Type": "application/json","Authorization":"Basic <api_key_here>"}
r = requests.get(url,headers=header)
data = r.json()
if len(data['data']) == 0:
print("No Messages yet")
else:
for donate in data['data']:
content = donate['content']
sender = donate['from_number']
if sender == 'GCash':
amount_index = content.find(keywords[0])
amount_end_index = content.find(keywords[1])
reference_index = content.find(keywords[2])
amount = content[amount_index+len(keywords[0]):amount_end_index]
reference_no = content[reference_index+len(keywords[2]):reference_index+len(keywords[2])+13]
print("Amount : {} - Reference : {}".format(amount,reference_no))
gcashpayments.insert_topup(amount,reference_no)
gcashpayments.delete_message(donate['id'])
def delete_message(message_id):
url = "https://api.telerivet.com/v1/projects/<project_id_here>/messages/{}".format(message_id)
header = {"Content-Type": "application/json","Authorization":"Basic <api_key_here>"}
r = requests.delete(url,headers=header)
def insert_topup(amount,reference):
print("Insert toup -> Amount = {} / Reference : {}".format(amount,reference))
gcashpayments.check_message()
SCREENSHOT :
Attachments
You must be registered for see attachments list
Last edited: