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

Hello Iseki,
I would create an instant payment system, I would like dealing from this place:
in currency.php
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:
Thanks for your answer.
Milo.
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.
投票数:105
平均点:5.33
iseki
投稿数: 1581

Hi,
Ummm....
I am thinking now ..........
Ummm....
I am thinking now ..........
投票数:156
平均点:7.31
milo
投稿数: 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 :)
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 :)
投票数:76
平均点:4.61
iseki
投稿数: 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.
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.
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.
投票数:98
平均点:6.22
milo
投稿数: 30

Thank you Iseki,
I try already with currency.php:
Not good because send chat message not beautifull
and also try:
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
I try already with currency.php:
user_alert($agentid,"Follow this link: http://localhost/purchase-".$token);
and also try:
$response_xml = xmlrpc_encode(array(
'success' => False,
'errorMessage'=> "\n\nTransactions failed.\n\nPlease clic here",
'errorURI' => "http://localhost/purchase-".$token));
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

投票数:87
平均点:5.52
iseki
投稿数: 1581

Hi
引用:To be sure, it is not beautiful. 
I tried to modify MoneyModule.cs, and I success to work test code.
I modified AddBankerMoneyHandler() function.
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
引用:
Not good because send chat message not beautifull

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
投票数:69
平均点:4.35
milo
投稿数: 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
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

投票数:100
平均点:6.50
milo
投稿数: 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;
}
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;
}
投票数:68
平均点:5.15
iseki
投稿数: 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
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.
As my wife say me "Sleep in a hurry!!"
I go to bed.
Thanks.
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.
投票数:89
平均点:4.27
milo
投稿数: 30

Hey thank you iseki
,
Ok i explain my install:
svn update done.
i try MoneyServer.ini
AND
Not Loadurl
OpenSim.ini
currency.php in your code
Not answer, settle empty
Answer on grid
The bank pay directly without Load url
Not work

Ok i explain my install:
svn update done.
i try MoneyServer.ini
BankerAvatar = "00000000-0000-0000-0000-000000000000"
BankerAvatar = ""
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"]);
Answer on grid
[23:20] Buy the Money L$100.
[23:20] MonyServer: response settle:
The bank pay directly without Load url
Not work

投票数:126
平均点:3.33
milo
投稿数: 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
)
in currency.php $res return
$res = add_money($agentid, $amount, $sessionid);
user_alert($agentid,"response settle: ".print_r($res,true));
Array
(
[success] => 1
)
投票数:88
平均点:4.32
milo
投稿数: 30

Okey now is work (I was not on the main area of test)
i changed just one thing
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
i changed just one thing
dlg.SendUrlToUser(bankerUUID, "SYSTEM", UUID.Zero, UUID.Zero, false, m_settle_message, m_settle_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
投票数:84
平均点:4.88
iseki
投稿数: 1581

Hi
引用:
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.
引用:
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.
投票数:128
平均点:3.67
milo
投稿数: 30

Great, Thank you for all Iseki
My system now work perfectly, i can use lot payment system.
Ty Ty
My system now work perfectly, i can use lot payment system.
Ty Ty

投票数:125
平均点:7.44
milo
投稿数: 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:
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:
On OpenSim.ini
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
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="
Personally I adapt this system for multiple payment system.
Enjoy !
Milo
投票数:136
平均点:4.85