Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Auto gcash payment api? :) [python]

Experienced Elementalist
Joined
Mar 10, 2011
Messages
229
Reaction score
50
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
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Oct 9, 2009
Messages
46
Reaction score
19
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:
Newbie Spellweaver
Joined
Aug 5, 2020
Messages
7
Reaction score
16
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 :)
 
Back
Top