integer PAYPAL_RESPONSE = 450003; integer PAYPAL_PREPARED = 450002; integer PAYPAL_PREPARE = 450001; default { touch_start(integer Dummy) { llSay(0, "Preparing payment... Please wait"); llMessageLinked(LINK_THIS, PAYPAL_PREPARE, llList2CSV(["paypalsandboxbusiness@kubwa.de", 1.50, "EUR", "Testartikel", "https://paypal.kubwa.de/DefaultLogo.png", llStringToBase64("Testdaten um weiteres zu machen das ganz toll ist!")]), llDetectedKey(0)); } link_message(integer Sender, integer Num, string Str, key ID) { if (Num == PAYPAL_PREPARED) { llDialog(ID, Str, ["Ok"], -22546); } if (Num == PAYPAL_RESPONSE) { list Tmp = llCSV2List(Str); if (ID == "error") { if (llList2String(Tmp, 0) == "no_scriptid") {llSay(0, "ERROR! - API Script ID has not been submitted");} else if (llList2String(Tmp, 0) == "no_scripturl") {llSay(0, "ERROR! - API Script has not submitted an script URL");} else if (llList2String(Tmp, 0) == "no_receiver") {llSay(0, "ERROR! - No receiver mail submitted");} else if (llList2String(Tmp, 0) == "no_price") {llSay(0, "ERROR! - No price submitted");} else if (llList2String(Tmp, 0) == "no_currency") {llSay(0, "ERROR! - No currency submitted");} else if (llList2String(Tmp, 0) == "no_custom") {llSay(0, "ERROR! - No custom data submitted");} else if (llList2String(Tmp, 0) == "no_article") {llSay(0, "ERROR! - No article description submitted");} else if (llList2String(Tmp, 0) == "no_script_avail") {llSay(0, "ERROR! - API Script is not reachable");} else if (llList2String(Tmp, 0) == "no_cmd") {llSay(0, "ERROR! - No command specified");} else {llSay(0, "ERROR! - Unknown error");} } else if (ID == "refund") { key AvatarID = llList2Key(Tmp, 0); string CustomData = llBase64ToString(llList2String(Tmp, 1)); /* Payment has been refunded */ llInstantMessage(AvatarID, ID + ": " + CustomData); } else if (ID == "complete") { key AvatarID = llList2Key(Tmp, 0); string CustomData = llBase64ToString(llList2String(Tmp, 1)); /* Payment has been completed */ llInstantMessage(AvatarID, ID + ": " + CustomData); } else if (ID == "denied") { key AvatarID = llList2Key(Tmp, 0); string CustomData = llBase64ToString(llList2String(Tmp, 1)); /* Payment has been denied */ llInstantMessage(AvatarID, ID + ": " + CustomData); } else if (ID == "failed") { key AvatarID = llList2Key(Tmp, 0); string CustomData = llBase64ToString(llList2String(Tmp, 1)); /* Payment has been failed */ llInstantMessage(AvatarID, ID + ": " + CustomData); } else if (ID == "pending") { key AvatarID = llList2Key(Tmp, 0); string CustomData = llBase64ToString(llList2String(Tmp, 1)); /* Payment is pending */ llInstantMessage(AvatarID, ID + ": " + CustomData); } } } }