add new funtion bool MoveMoney(UUID fromUser, UUID toUser, int amount, MoneyTransactionType type, string text). this should be called async allowing time for money module to process it. If returns true, the transation did sucess, so if its use was to pay something, the payed item/service must be provided without fail, otherwise another method is needed so a refund is possible
parent
a91ceae826
commit
0bbe7bab7b
|
@ -41,6 +41,7 @@ namespace OpenSim.Framework
|
||||||
void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData = "");
|
void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData = "");
|
||||||
void ApplyUploadCharge(UUID agentID, int amount, string text);
|
void ApplyUploadCharge(UUID agentID, int amount, string text);
|
||||||
void MoveMoney(UUID fromUser, UUID toUser, int amount, string text);
|
void MoveMoney(UUID fromUser, UUID toUser, int amount, string text);
|
||||||
|
bool MoveMoney(UUID fromUser, UUID toUser, int amount, MoneyTransactionType type, string text);
|
||||||
|
|
||||||
int UploadCharge { get; }
|
int UploadCharge { get; }
|
||||||
int GroupCreationCharge { get; }
|
int GroupCreationCharge { get; }
|
||||||
|
|
|
@ -617,12 +617,15 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost, String.Format("Parcel '{0}' pass sell",ldata.Name));
|
string regionName = m_scene.RegionInfo.RegionName;
|
||||||
// lets try older method
|
string payDescription = String.Format("Parcel '{0}' at region '{1} {2:0.###} hours access pass", ldata.Name, regionName, ldata.PassHours);
|
||||||
// EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(remote_client.AgentId, ldata.OwnerID,
|
|
||||||
// cost,(int)MoneyTransactionType.LandPassSale , String.Format("Parcel '{0}' pass sell",ldata.Name));
|
if(!mm.MoveMoney(remote_client.AgentId, ldata.OwnerID, cost,MoneyTransactionType.LandPassSale, payDescription))
|
||||||
|
{
|
||||||
|
remote_client.SendAgentAlertMessage("Sorry pass payment processing failed, please try again later", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// m_scene.EventManager.TriggerMoneyTransfer(this, args);
|
|
||||||
if (idx != -1)
|
if (idx != -1)
|
||||||
ldata.ParcelAccessList.RemoveAt(idx);
|
ldata.ParcelAccessList.RemoveAt(idx);
|
||||||
ldata.ParcelAccessList.Add(entry);
|
ldata.ParcelAccessList.Add(entry);
|
||||||
|
|
|
@ -844,9 +844,14 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
||||||
module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice);
|
module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveMoney(UUID fromAgentID, UUID toAgentID, int amount, string text)
|
public void MoveMoney(UUID fromUser, UUID toUser, int amount, string text)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool MoveMoney(UUID fromUser, UUID toUser, int amount, MoneyTransactionType type, string text)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum TransactionType : int
|
public enum TransactionType : int
|
||||||
|
|
Loading…
Reference in New Issue