Giter Site home page Giter Site logo

igs-portable's Introduction

igs-portable

Интеграция пополнения доната через IGS

Внимание

Пополнение работает только если сервер запущен на момент транзакции, по-этому не давайте глобальную ссылку на пополнение, так как есть риск потери денежных средств

Настройка

Зайдите в igs-portable/cfg.lua и введите данные с панели GMD

Использование для пополнения

Чтобы интегрировать пополнение GMD в ваш донат-магазин, скопируйте наш образец и добавте функцию пополнения

hook.Add("IGS.IncomingMessage", "deposit", function(data, method)
  if data.method == "pay" then
    local sum = data.orderSum -- сумма пополнения
    local steamid64 = data.SteamID64
    local steamid = util.SteamIDFrom64(steamid64)
    -- ваш код
  end
end)

Генерация ссылки на пополнение

Пример:

--SV
util.AddNetworkString('donate.geturl')
net.Receive('donate.geturl', function(_, ply)
	local sum = net.ReadInt(32)
	IGS.GetPaymentURL(function(url)
		net.Start('donate.geturl')
		net.WriteString(url)
		net.Send(ply)
	end, ply:SteamID64(), sum)
end)
--CL
local function geturl(sum)
  net.Start('donate.geturl')
  net.WriteInt(sum, 32)
  net.SendToServer()
end
net.Receive('donate.geturl', function()
  local url = net.ReadString()
  gui.OpenURL(url)
end)

igs-portable's People

Contributors

glebux avatar

Stargazers

 avatar _AMD_ avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.