flagflag  If you want to see English page, please click "English" Button at Left.

LoadUrl Money

  • このフォーラムに新しいトピックを立てることはできません
  • このフォーラムではゲスト投稿が禁止されています

なし LoadUrl Money

msg# 1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 .2 .3 .4 .5 | 投稿日時 2012-2-18 20:14
milo  Not too shy to talk   投稿数: 30
Hello Iseki,

I would create an instant payment system, I would like dealing from this place:

in currency.php
$transactionPermit = false;

If true -> llLoadUrl(paiement system external);

the customers go on webpage -> pay and return on the website.

If success i use php page callback and i send money .

my question is: is it possible to return a "llLoadurl" from currency.php after:

$allowed = array("uuid_avatar");

if(in_array($agentid,$allowed)):
$transactionPermit = true;
if($transactionPermit !== false):
LOAD URL HERE
endif;
endif;

Thanks for your answer.

Milo.
投票数:96 平均点:5.52
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2012-2-19 14:58
iseki  Home away from home   投稿数: 1581
Hi,

Ummm....
I am thinking now ..........
投票数:117 平均点:6.84

なし Re: LoadUrl Money

msg# 1.1.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2012-2-19 17:51
milo  Not too shy to talk   投稿数: 30
Hi,

I try modify in MoneyModule.cs

section: // "UserAlert" RPC from Script

client.SendLoadURL ("MoneyServer", UUID.Zero, client, false, "Confirm payment ?", "httpurl");

But i not understand perfectly this language :)
投票数:71 平均点:4.65

なし Re: LoadUrl Money

msg# 1.1.1.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2012-2-19 18:29
iseki  Home away from home   投稿数: 1581
Hi

I think that there are 2 ways.

1. One is to modify Money Module like your try.
It is smart method but it will be difficult.
I look LSL code of OpenSim now.

        public void llLoadURL(string avatar_id, string message, string url)
        {
            m_host.AddScriptLPS(1);

            IDialogModule dm = World.RequestModuleInterface<IDialogModule>();
            if (null != dm)
                dm.SendUrlToUser(
                    new UUID(avatar_id), m_host.Name, m_host.UUID, m_host.OwnerID, false, message, url);

            ScriptSleep(10000);
        }

2. Another way is to modify currency.php.
In buy_currency() function, it returns URL as errorURI.
This is comparatively easy. But it is not cool.

OK, I will try to modify Money Module.
投票数:88 平均点:6.25

なし Re: LoadUrl Money

msg# 1.1.1.1.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2012-2-19 18:43
milo  Not too shy to talk   投稿数: 30
Thank you Iseki,

I try already with currency.php:
user_alert($agentid,"Follow this link: http://localhost/purchase-".$token);
Not good because send chat message not beautifull

and also try:
$response_xml = xmlrpc_encode(array(
        'success'	  => False,
	'errorMessage'=> "\n\nTransactions failed.\n\nPlease clic here",
	'errorURI'	  => "http://localhost/purchase-".$token));
Not good (error message before).

I try also create new function User_loadUrl (php function helpers.php) but not work also ^^

Because The probleme is : if system send message with user_alert for others raison, the avatar receveid also llLoadUrl (not good)

I think Ideal is New php function to Helpers and New command on Moneymodule.cs only for load url.

After i can use lot payment system

Ty for your time
投票数:77 平均点:5.19

なし Re: LoadUrl Money

msg# 1.1.1.1.1.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2012-2-19 19:23
iseki  Home away from home   投稿数: 1581
Hi

引用:

Not good because send chat message not beautifull
To be sure, it is not beautiful.

I tried to modify MoneyModule.cs, and I success to work test code.
I modified AddBankerMoneyHandler() function.
    if (requestParam.Contains("amount"))
    {
        Scene scene = (Scene)client.Scene;
        int amount  = (int)requestParam["amount"];
        ret = AddBankerMoney(bankerUUID, amount, scene.RegionInfo.RegionHandle);

        //  I added following 4 lines.
        IDialogModule dlg = scene.RequestModuleInterface<IDialogModule>();
        if (dlg!=null) {
            dlg.SendUrlToUser(bankerUUID, "TEST1", UUID.Zero, UUID.Zero, false, "TEST2", "http://www.yahoo.com/");
        }
    }

SendUrlToUser() function is a correct answer.

Next problem is that where is this used?
I do not understand your payment system well yet.
Example, banker avatar does not need this URL. Is it correct?
Other all avatars get this URL, and goto WEB site. and operate WEB.
So, you send money to operated avatar (automatically?). Is it OK?

Thanks
投票数:64 平均点:4.22
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2012-2-19 19:34
milo  Not too shy to talk   投稿数: 30
Yes this is for all avatar.
I agree to all avatars and I made ​​the verification process it myself

To my website each avatar complete form for registration, if avatar active Money on account then the money system work ingame.

Ex: $transactionPermit = true or false;

If true

i add new function on opensim.mysql

$back = opensim_set_avatar_session($avname,$agentid,$token,$amount,$cost);
$back = true if session has been add on table "sessionmoney"

great, all information is recorded, I can work from the table "sessionmoney" and use any payment system, because then just call send_money pay for the avatar from any system confirming that the payment is validated and accepted
投票数:75 平均点:5.60
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2012-2-19 19:39
milo  Not too shy to talk   投稿数: 30
My function

function opensim_set_avatar_session($name, $uuid,$token,$amount,$cost, &$db=null)
{
global $OpenSimVersion;

if (!isGUID($uuid)) return null;

if (!is_object($db)) $db = & opensim_new_db();
if ($OpenSimVersion==null) opensim_get_db_version($db);

if ($db->exist_table('sessionmoney')) {
$db->query("INSERT INTO sessionmoney SET avname='$name',avkey='$uuid',token='$token',virtual='$amount',real='$cost'");
$errno = $db->Errno;
}

return $errno;
}
投票数:60 平均点:5.17

なし Re: LoadUrl Money

msg# 1.3.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2012-2-20 1:33 | 最終変更
iseki  Home away from home   投稿数: 1581
Hi milo,

At once, I modified Money Module and Money Server.
You can update svn ripository.

And please add [Economy] section in OpenSim.ini
Ex)
    SettlementByWeb   = true
    SettlementURL     = "http://www.google.com"
    SettlementMessage = "Please take the necessary procedure for money purchase at the following web site."

Banker Avatar can buy money from system without web verification.
If you want all the users to carry out verification, Please delete banker avatar UUID from MoneyServer.ini


at currency.php, "settle"=true is returned.
    if ($transactionPermit) {
        $res = add_money($agentid, $amount, $sessionid);
        if ($res["success"]) $ret = true;
        if ($ret && $res["settle"]) {
            WEB verification code...
            ......
        }
    }

As my wife say me "Sleep in a hurry!!"
I go to bed.

Thanks.
投票数:77 平均点:4.42

なし Re: LoadUrl Money

msg# 1.3.1.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2012-2-20 16:25
milo  Not too shy to talk   投稿数: 30
Hey thank you iseki ,

Ok i explain my install:
svn update done.

i try MoneyServer.ini
BankerAvatar = "00000000-0000-0000-0000-000000000000"
AND
BankerAvatar = ""
Not Loadurl

OpenSim.ini
SellEnabled = "true"
UserServer = "http://my_ip:8002"
CurrencyServer = "https://my_ip:8008"  
EconomyModule  = DTLNSLMoneyModule
SettlementByWeb = true 
SettlementURL = "http://www.google.com"
SettlementMessage = "Please take the necessary procedure for money purchase at the following web site."

currency.php in your code
$res = add_money($agentid, $amount, $sessionid); 
user_alert($agentid,"response settle: ".$res["settle"]);
Not answer, settle empty

Answer on grid
[23:20]  Buy the Money L$100.
[23:20]  MonyServer: response settle: 

The bank pay directly without Load url

Not work
投票数:92 平均点:4.13

なし Re: LoadUrl Money

msg# 1.3.1.1.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2012-2-20 17:43
milo  Not too shy to talk   投稿数: 30
Complement of information

in currency.php $res return

$res = add_money($agentid, $amount, $sessionid);
user_alert($agentid,"response settle: ".print_r($res,true));

Array
(
[success] => 1
)
投票数:74 平均点:4.46
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2012-2-20 18:28
milo  Not too shy to talk   投稿数: 30
Okey now is work (I was not on the main area of test)

i changed just one thing

dlg.SendUrlToUser(bankerUUID, "SYSTEM", UUID.Zero, UUID.Zero, false, m_settle_message, m_settle_url+(string)requestParam["clientSessionID"]);
I have need token, then i use URL + (string)requestParam["clientSessionID"]

SettlementURL = "http://www.mysite.com/purchase-"

$token = sha1($sessionid.":".uniqid(time()));

i save on my table token

and after i get this token for the treatment, get amount, avatar, etc

because if i use sessionid only, then problem, sessionid is all time same

you say WEB verification code... how verification code? because the loadurl is send before and just one url without variable and is not good

Ty for all

Milo
投票数:79 平均点:4.81

なし Re: LoadUrl Money

msg# 1.4.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2012-2-20 21:48
iseki  Home away from home   投稿数: 1581
Hi

引用:

you say WEB verification code... how verification code? because the loadurl is send before and just one url without variable and is not good

I have no idea now, but it is interesting problem.
It includes problem of security and DB structure.

I have the plan of version up of XoopenSim and Modlos now.
I want to add this function to those Web Interface.

Thanks.
投票数:108 平均点:3.98
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2012-2-20 21:54
milo  Not too shy to talk   投稿数: 30
Great, Thank you for all Iseki

My system now work perfectly, i can use lot payment system.

Ty Ty
投票数:74 平均点:6.08

なし Re: LoadUrl Money

msg# 1.5.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2012-2-21 15:44
milo  Not too shy to talk   投稿数: 30
Hi Guy,

Here are the changes I make to be able to work with a key to security for the payment module.

sorry for the tag code, but it would nl2br() power that can be read ^^

First create table mysql:

CREATE TABLE IF NOT EXISTS `openmoney` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`avname` varchar(255) NOT NULL,
`avkey` char(36) NOT NULL,
`token` char(40) NOT NULL,
`virtualm` int(11) NOT NULL,
`realm` double NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=67 ;


Next modify opensim.mysql.php
add this function:

function opensim_set_avatar_session($name, $uuid,$token,$amount,$cout, &$db=null)
{
global $OpenSimVersion;

if (!isGUID($uuid)) return null;

if (!is_object($db)) $db = & opensim_new_db();
if ($OpenSimVersion==null) opensim_get_db_version($db);

$firstname = null;
$lastname = null;
$fullname = null;

if ($db->exist_table('openmoney')) {
$db->query("INSERT INTO openmoney SET avname='$name',avkey='$uuid',token='$token',virtualm='$amount',realm='$cout'");
$errno = $db->Errno;
}

return $errno;
}

On helper.php
edit this function "add_money":

function add_money($agentID, $amount, $prix, $avname, $secureID=null)
{
if (!isGUID($agentID)) return false;

//
if (!USE_CURRENCY_SERVER) {
env_set_money_transaction(null, $agentID, $amount, 5010, 0, "Buy Money", 0, 0, "");
$res["success"] = true;
return $res;
}

//
// XML RPC to Region Server
//
if (!isGUID($secureID, true)) return false;

$results = opensim_get_server_info($agentID);
$serverip = $results["serverIP"];
$httpport = $results["serverHttpPort"];
$serveruri = $results["serverURI"];
if ($serverip=="") return false;

$results = opensim_get_avatar_session($agentID);

$sessionID = $results["sessionID"];
$token = sha1($sessionID.":".uniqid(time()));
$retour = opensim_set_avatar_session($avname,$agentID,$token,$amount,$prix); //// <------------------------ ADD THIS LINE
if($retour) return false; //// <------------------------ ADD THIS LINE

if ($secureID==null) $secureID = $results["secureID"];

$req = array('clientUUID'=>$agentID,
'clientSessionID'=>$sessionID,
'clientSecureSessionID'=>$secureID,
'amount'=>$amount,
'clientTokenID'=>$token); //// <------------------------ ADD THIS LINE
$params = array($req);
$request = xmlrpc_encode_request('AddBankerMoney', $params);

$response = do_call($serverip, $httpport, $serveruri, $request);
//file_put_contents("log.txt", print_r($response,true));
return $response;
}

On Currency.php
section buy_currency

if($transactionPermit){
$res = add_money($agentid, $amount,$cost,$avname, $sessionid);
if ($res["success"])
$ret = true;
if ($ret && $res["settle"])
{
}
}

svn update
On MoneyModule.cs
i have edit this section:

public XmlRpcResponse AddBankerMoneyHandler(XmlRpcRequest request, IPEndPoint remoteClient)

search :

if (dlg!=null) {
dlg.SendUrlToUser(bankerUUID, "SYSTEM", UUID.Zero, UUID.Zero, false, m_settle_message, m_settle_url);
}

replace by:

if (dlg!=null) {
dlg.SendUrlToUser(bankerUUID, "SYSTEM", UUID.Zero, UUID.Zero, false, m_settle_message, m_settle_url+(string)requestParam["clientTokenID"]);
}

after:
./runprebuild.sh && nant clean && nant
cd opensim.currency
./build.sh

On OpenSim.ini
SettlementURL = "http://www.mywebsite.com/?token="
each avatar clicking that buy the L$, will receive a LoadURL with a unique key for each transaction.

Personally I adapt this system for multiple payment system.

Enjoy !

Milo
投票数:125 平均点:4.72

  条件検索へ


サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 4月翌月
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
<今日>

オンライン状況

142 人のユーザが現在オンラインです。 (4 人のユーザが Forum を参照しています。)

登録ユーザ: 0
ゲスト: 142

もっと...

アクセスカウンタ

今日 : 1879718797187971879718797
昨日 : 1795517955179551795517955
総計 : 2337777423377774233777742337777423377774233777742337777423377774
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com