Friday, March 26, 2010

AS3 addtoCart button (PayPal) would...

Hello Everybody

I am struggling with the following situation.?An addToCart button adds an item to the PayPal cart with the code below, which does work, but has the result that the visitor is directed to the PayPal site during the shopping process.?The transfer of the data should however happen in the background and the visitor should only be directed to the PayPal site when the view cart option is clicked.?Is there any other way to transfer the data than having to navigate to the PayPal Site?

function AddToCartHandler179(event:MouseEvent):void {

?var url:String = ''https://www.paypal.com/cgi-bin/webscr'';
?var payPal:URLRequest = new URLRequest(url);
?var variables:URLVariables = new URLVariables();
?variables.cmd = ''_cart'';
?variables.add = ''1'';
?variables.business = ''merchantEmailOrNumber'';
?variables.item_name = ''ItemName'';
?variables.item_number = '''';
?variables.amount = ''price'';
?variables.no_note = ''1'';
?variables.no_shipping = ''2'';
?variables.currency_code = ''GBP'';
?variables.lc = ''GB'';
payPal.data = variables;
payPal.method = URLRequestMethod.POST;
navigateToURL(payPal, ''_self'');
}

Hoping for some helpful ideas

Pastoni

AS3 addtoCart button (PayPal) would...

You use navigatToURL and it does what it is supposed to do - redirect to another url.

Try to use URLLoader:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLLoader.ht ml

AS3 addtoCart button (PayPal) would...

just learnt from PayPal forum that the only way around this is building a shopping cart

No comments:

Post a Comment