Alipay payment based on micro-channel mobile games chess games and other APP Third Quartet docking interface (API) integration CODE technical analysis automatic callback pay

Abstract: pay CODE Technical Analysis Po-letter receivables automatic callback payment interface (API) based on integrated docking hand travel chess games and other third-party APP Quartet!
Description: MSI proud to play mobile games and other chess game APP, member users recharge after successful payment, the user is automatically credited into account the increase in the balance. Unmanned automated payment management functions.

Methods: payment API interface documentation butt, butt through the game system, after receiving the success notification callback information automatically increase the balance.

Development tools and programming languages: android studio, Eclipse, Cocos creator of game development, LUA language, JAVA, APP development. Services backend programming languages: JAVA / ASPNET C # / PHP + MYSQL.

The core source code as follows:

- [[
Common Definition
]]
appdf or appdf = {}

appdf.bili = 1.0 - fold reduction (Original 1000)

- Aspect
appdf.WIDTH = 1334 of
appdf.HEIGHT = 750
appdf.g_scaleX = display.width / appdf.WIDTH --X scaling values YCC coordinates added
appdf.g_scaleY = display.height / appdf.HEIGHT --Y scaling coordinate value added ycc

appdf.BASE_SRC = "base.src."
appdf.CLIENT_SRC = "client.src."
appdf.GAME_SRC = "download."
appdf.gamepath = device.writablePath.."download/"
appdf.gamecodepath = "download."

- Extended Directory
appdf.EXTERNAL_SRC = "client.src.external."
- common definition directory
appdf.HEADER_SRC = "client.src.header."
- private room directory
appdf.PRIVATE_SRC = "client.src.privatemode."

appdf.channelId = 1
appdf.Ratio = false

- download information
appdf.DOWN_PRO_INFO = 1 - the download progress
appdf.DOWN_COMPELETED = 3 - download result
appdf.DOWN_ERROR_PATH = 4 - Error path
appdf.DOWN_ERROR_CREATEFILE = 5 - Error file created
appdf.DOWN_ERROR_CREATEURL = 6 - Creating a connection failed
appdf.DOWN_ERROR_NET = 7 - download failed

appdf.CLIENT_NOTIFY = "__global_client_notify_event__" - client notification

- Environmental
appdf.isTest = false - (. False true test release.)
- Whether Apple version
appdf.APPSTORE_VERSION = false
- Gateway
appdf.SERVER_LIST = {}
- API
appdf.http_api = {}
appdf.HTTP_URL = "http://112.27.6.62:2119/"
- the current address index
appdf.CURRENT_INDEX = 1
appdf.TOTAL_COUNT = # appdf.SERVER_LIST

- landing address
appdf.LOGONSERVER = appdf.SERVER_LIST [appdf.CURRENT_INDEX]

- Codec
appdf.VALIDATE = "11E9E77D-C628-4FD6-AC60-91A541DBD5C1 " - @ compilation

- version
appdf.BASE_C_VERSION = 1 - @ APP_VERSION
- resource version
appdf.BASE_C_RESVERSION = 1000 - @ client_version

- a local version of an initial sub-game resources
appdf.BASE_GAME = 
{
{kind = 100, Version = "-1"}, - Landlords
{kind = 101, version = " -1"}, --zha Golden
{kind = 102, version = "-1" }, - one hundred beef
{kind = 103, version = " -1"}, - grab Zhuang beef
{kind = 104, version = " -1"}, - red and black war
{kind = 105, version = " -1"}, - Illustrating
{kind = 106, version = " -1"}, - Baccarat
{kind = 107, version = " -1"}, - fishing
{kind = 108, version = " -1"}, - a ball fame
{kind = 109, version = " -1"}, --2 person mahjong
{kind = 110, version = " -1 '}, - Feiqinzoushou
{kind = 111, version = " -1"}, - Benz BMW
{kind = 113, version = " -1"}, - run fast
{kind = 118, version = " -1"},- Texas Hold'em
{kind = 119, version = " -1"}, - fruit machine
{kind = 121, version = " -1"}, - video Baccarat
{kind = 122, version = " -1"}, --21 point
{kind = 123, version = " -1"}, - Russian turntable
{kind = 124, version = " -1"}, - spinach BC dish (website)
{kind = 125, Version = "-1"}, - Stud
{kind = 126, version = " -1"}, - thirteen water
{kind = 127, version = " -1" }, - hundred SicBo
{kind = 210, version = " -1"}, - video Sicbo
}

- Set the gateway
function appdf.setGate (gatelist, http_api)
- Gateway
appdf.SERVER_LIST = gatelist
- API
appdf.http_api = http_api

- current address index
appdf.CURRENT_INDEX. 1 =
appdf.TOTAL_COUNT = # appdf.SERVER_LIST
appdf.HTTP_URL http_api = [. 1]

- landing address
appdf.LOGONSERVER = appdf.SERVER_LIST [appdf.CURRENT_INDEX]
End

-- 获取域名对应的ip
function appdf.replaceHostbyIP(url_)
if device.platform ~= "ios" then
-- return
end
local host = ""
local strlist = string.split(url_,"/")
if string.find(string.lower(strlist[1]),"http") then
if strlist[2] == "" then
host = strlist[3]
else
host = strlist[2]
end
else
host = strlist[1]
end
if string.find( host,":") then
local hostlist = string.split(host,":")
host = hostlist[1]
end
local socket = appdf.req("socket.core")
local addrinfo, err = socket.dns.getaddrinfo(host)
if addrinfo and addrinfo[1] and addrinfo[1].addr then
local addr = addrinfo[1].addr
if addr == "127.0.0.1" or addr == "0.0.0.0" then
return 
end
return string.gsub(url_,host,addr)
end
end

function appdf.req(path)
if path and type(path) == "string" then
return require(path)
else
print("require paht unknow")
end
end

- character segmentation
function appdf.split (STR, In Flag)
local Tab = {}
the while to true do

local n = string.find(str, flag)
if n then
local first = string.sub(str, 1, n-1) 
str = string.sub(str, n+1, #str) 
table.insert(tab, first)
else
table.insert(tab, str)
break
end
end
return tab
end

- detecting whether the string is empty
function appdf.isNullString (targetStr)
IF Not targetStr or type (targetStr) ~ = "String" or TRIM (targetStr) == "" the then
return to true
End
End

- width of the character based on truncated
function appdf.stringEllipsis (szText, sizeE, sizeCN, maxWidth)
- calculates the width of the current
local width = 0
- to truncate
local lastpos = 0
- the results are truncated
local szResult = "..."
- Analyzing complete
local to false bOK =

local. 1 = I

public abstract void handleNotification();
protected String extractMoney(String content){
Pattern pattern = Pattern.compile("(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?元");
Matcher matcher = pattern.matcher(content);
if(matcher.find()){
String tmp=matcher.group();
Pattern patternnum = Pattern.compile("(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?");
Matcher matchernum = patternnum.matcher(tmp);
if(matchernum.find())
return matchernum.group();
return null;

}

Game management background - payment orders automatically rendering a callback

 

Game management background - two shots automatically increase the balance effect

 

Disclaimer: This article bloggers original article. Blog, shall not be reproduced without consent.

 

Guess you like

Origin www.cnblogs.com/novasoul/p/12509614.html