Auto gcash payment api? :) [python]

Socius Decennalis
Decennium
Joined
Mar 10, 2011
Messages
387
Reaction score
184
Im using as GATEWAY to Get SMS From Mobile


THIS IS INCOMPLETE YOU MUST HAVE A KNOWLEDGE IN CODING IN ORDER TO FINISH THIS :D

Things to do :

1.) make it run 24/7 just like discord bot :D
2.) add sql module for auto add topup code in RanDatabase :D
3.) modify the code so it will be beautiful :D


ITS UP TO YOU NOW IF YOU WANT TO SHARE IT OR KEEP IT FOR YOUR SELF :D

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 :

kC4ymHk - Auto gcash payment api? :) [python] - RaGEZONE Forums
 
Last edited:
This is written in Python, you must connect it using Pyobdc module to be able to integrate it into your SQL Server.

Additionally, you can create a discord bot in Python and have this run 24/7.

Hope this additional clues will ease your coding life :D
 
Last edited:
Cool, would it be alright if I remake this into .Net with MSSQL Connection so everyone can use this by just changing something on appsetting.json :)
 
Is there an updated version sir?

Sorry I'm newbie, thanks for understanding as well.
 
Back