PDA

View Full Version : LoadVars and mime type - worldpay


LaRue
10-16-2003, 01:03 PM
I have to deal with worldpay for credit card processing on a musician site. I'm sending the parameters from a swf using LoadVars and everything works fine, ONLY ON MSIE WINDOWS it doesn't work!?!! and their debug page is telling me the data wasn't sent in the correct mime type although flash sends stuff in application/x-www-form-urlencoded -- ANY IDEA what is wrong here?

on (release) {
amount = "15";
myParam = new LoadVars();
myParam.amount = amount*quantity;
myParam.instId = "565623";
myParam.cartId ="cartID " + (100000+random(899999));
myParam.currency = "GBP";
myParam.desc = quan + " x Cinamatic Soul T-Shirt - Size " +size;
myParam.testMode = "100";
trace(myParam+ " contentType "+myParam.contentType);

if(size != "none" && quantity != "0" && quantity != "" && amount != "NaN"){
myParam.send("https://secure.worldpay.com/payments/debug", "_blank", "POST");
} else{
amount = "15";
nogo.gotoAndPlay(2);
}
}

Server response:
"ERROR:From data was sent using 'POST', but the contents were not correclty typed (should be type application/x-www-form-urlencoded) "

I have also tried the oldschool way of sending data with getURL -- same problem! -- works fine for sending stuff to paypal...

online version here: http://www.barryadamson.com/test.html

many thanks
LR

freddycodes
10-16-2003, 02:10 PM
Did you explicitly assign ther content type to the laodvars object.


myParam.contentType = "application/x-www-form-urlencoded";

LaRue
10-16-2003, 02:46 PM
yeah fred I did that, didn't help though

BUT I just figured something else, I accidently opened the html document containing the swf OUTSIDE the frameset and there IT WORKED!

Seams bizzare to me! I'm on mac with only basic knowledge of windows and MSIE/WIN, can anybody please tell me what the problem is???

I mean it works in the frameset for paypal secure payment integration, so supposively worldpays (http://www.worldpay.co.uk) SSL-Server is the problem.