Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

question re: amt_paid != price in money event

Rhian Svenska
Registered User
Join date: 18 Jan 2008
Posts: 17
04-03-2009 00:56
If one hides the payment field and shows a single fast-pay button, is there any possible reason that the money event would be called with the amount_paid != fastpay_amount other than somebody using a bugged client (or one intentionally rigged to attempt theft)?

In scripting terms, why do this:

//-----------------------------
integer price = 100;

default {
state_entry() {
llSetPayPrice(PAY_HIDE,[price,PAY_HIDE,PAY_HIDE,PAY_HIDE]);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
run_time_permissions(integer perm) {
if(perm & PERMISSION_DEBIT) state active;
}
}

state active {
money(key customer, integer amt_paid) {
if(amt_paid != price) {
llGiveMoney(customer,amt_paid);
llInstantMessage(customer,"You paid the wrong amount.";);
}else{
llGiveInventory(customer,"stuff";);
llInstantMessage(customer,"Thanks for your purchase!";);
}
}
}
//-----------------------------------

....instead of simply this.....

//~~~~~~~~~~~~~~~~~~~~~
integer price = 100;

default {
state_entry() {
llSetPayPrice(PAY_HIDE,[price,PAY_HIDE,PAY_HIDE,PAY_HIDE]);
}
money(key customer, integer amt_paid) {
if(amt_paid != price) {
llInstantMessage(customer,"Take your hacked client elsewhere. And thanks for the donation. Kthxbi.";);
llTeleportAgentHome(customer);
}else{
llGiveInventory(customer,"stuff";);
llInstantMessage(customer,"Thanks for your purchase!";);
}
}
}

//~~~~~~~~~~~~~~~~~~~


Thoughts?
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
04-03-2009 02:11
I have been wondering the same thing and I prefer the version without the 'PERMISSION_DEBIT',
but not with that wording:) In fact I do not check the amount. If some one exploits me I will not see it until I look in the transactions history.
It would be nice to know more about how safe the 'single fast-pay button' method is.
_____________________
From Studio Dora
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
04-03-2009 02:23
ALWAYS check the amount. Consider the fast-pay thing a way of 'suggesting' a price, but keep in mind that agents can pay any amount they want to, including 0.
_____________________
Salvador Nakamura
http://www.sl-index.com
Join date: 16 Jan 2007
Posts: 557
04-03-2009 05:01
From: Day Oh
ALWAYS check the amount. Consider the fast-pay thing a way of 'suggesting' a price, but keep in mind that agents can pay any amount they want to, including 0.


QFT

This warning is also on-top of the llSetPayPrice wiki



.
_____________________
SL-Index , providing an easy and affordable start in secondlife
Rentals, Easy Setup Scripts, Freebies & Value Boxes

www: http://sl-index.com

HQ: http://slurl.com/secondlife/Immintel/212/14/100
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
04-03-2009 08:02
I prefer logic such as:

CODE

logError(string message)
{
// Or e-mail, HTTP, whatever
llInstantMessage(llGetOwner(), message);
}

...

money(key id, integer amount)
{
string payer = llKey2Name(id)+" ("+id+")";
if (amount < PRICE)
{
llWhisper(
"Sorry, that is not enough. Please contact the vendor owner for a "+
"refund.");
logError(
payer+" paid "+(string)amount+" for "+PRODUCT+" which costs "+
(string)PRICE+". Please check your transaction history and "+
"consider giving a refund.");
} else
{
if (amount > PRICE)
{
llWhisper(
"You have overpaid by "+(integer)(PRICE-amount)+
". Please contact the vendor owner for change.");
logError(
payer+" paid "+(string)amount+" for "+PRODUCT+" which only costs "+
(string)PRICE+". Please check your transaction history and "+
"consider giving change.");
}

givePurchasedProductTo(id);
}
}
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
04-03-2009 08:25
Has anybody ever experienced a different payment than that set by fast pay?
when set to one price only: llSetPayPrice(PAY_HIDE,[payment,PAY_HIDE,PAY_HIDE,PAY_HIDE]);
_____________________
From Studio Dora
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
04-03-2009 09:01
No, but I could design a viewer modification to do it so I prefer the paranoid approach. :)
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
04-03-2009 13:04
Well, in my vendors, I use something like this in the "money" event...


From: someone

llInstantMessage(owner, "I just sold a(n) " + ItemName + " to " + llKey2Name(id) + ", for " + amount_paid + "L$.";);



It was originally added to help me keep track of how much L$ I make per week, etc., but I realized it could also be a helpful feature for detecting theft.

If you get this message:
From: someone

Vendor: I just sold a(n) Object to Joe Shmoe, for 0L$.

You know something's up. :P
_____________________
Life is a highway... And I just missed my exit.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-03-2009 13:46
also beware of comparing the price paid, to a variable based on the currently showing item... if someone pulls a pay dialog, and someone else(or even that specific buyer) then changes the displayed product, all sorts of oddness will ensue, the buyer could get the wrong item, or end up paying more/less, or a combination of those.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Salvador Nakamura
http://www.sl-index.com
Join date: 16 Jan 2007
Posts: 557
04-03-2009 13:50
From: Cypher Ragu
Well, in my vendors, I use something like this in the "money" event...





It was originally added to help me keep track of how much L$ I make per week, etc., but I realized it could also be a helpful feature for detecting theft.

If you get this message:

You know something's up. :P



but then its too late ;)


.
_____________________
SL-Index , providing an easy and affordable start in secondlife
Rentals, Easy Setup Scripts, Freebies & Value Boxes

www: http://sl-index.com

HQ: http://slurl.com/secondlife/Immintel/212/14/100