Powered by Blogger.

Tuesday, October 21, 2008

Tag: , , ,

Flash ActionScript3 and PayPal

This is the most simply way to implement a paypal cart, this cart only have 1 item, it can be a total price of cart and one description or 1 item and quantity of items to add to cart.

You can find more info about the parameters to send to paypal in his web
myButton.addEventListener(MouseEvent.CLICK,sendToPaypal);

myButton.buttonMode=true;

function sendToPaypal(e:Event){
var paypalRequest:URLRequest = new URLRequest("https://www.paypal.com/es/cgi-bin/webscr");var variables:URLVariables = new URLVariables();

variables.cmd="_xclick";

variables.business="your-mail@business.com";

variables.item_name="Description";

variables.quantity=number-itmes-to-buy;

variables.currency_code="EUR";

variables.amount=price-item;

paypalRequest.data= variables

paypalRequest.method="POST";

try{
errorBox.htmlText="Send data to Paypal";navigateToURL(paypalRequest);

}catch (e:Error) {
errorBox.htmlText="ERROR";errorBox.htmlText=e;

}

}

About David Millán Escrivá

David completed his studies in Universidad Politecnica de Valencia in IT with a Master's degree in artificial intelligence, computer graphics, and pattern recognition, focusing on pattern recognition and Computer Vision. David has more than 15 years of experience in IT, with more than ten years of experience in Computer Vision, computer graphics, and pattern recognition, working on different projects and start-ups, applying his knowledge of Computer Vision, optical character recognition, and augmented reality. Co-Author of two OpenCV books and reviewer of few more.

0 comments:

Post a Comment