Created
January 27, 2013 14:19
-
-
Save xtrasmal/4648513 to your computer and use it in GitHub Desktop.
AS3 PayPal Donate and Buynow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Listeners | |
btDonate.addEventListener(MouseEvent.CLICK, donate); | |
btBuynow.addEventListener(MouseEvent.CLICK, buynow); | |
//Functions | |
function donate (event:MouseEvent):void{ | |
var url:String = "https://www.paypal.com/cgi-bin/webscr"; | |
var request:URLRequest = new URLRequest(url); | |
var paypal_donate:URLVariables = new URLVariables(); | |
paypal_donate.cmd="_s-xclick"; | |
paypal_donate.hosted_button_id="123456"; | |
request.data = paypal_donate; | |
navigateToURL(request); | |
trace(paypal_donate) | |
} | |
function buynow (event:MouseEvent):void{ | |
var url:String = "https://www.paypal.com/cgi-bin/webscr"; | |
var request:URLRequest = new URLRequest(url); | |
var paypal_buynow:URLVariables = new URLVariables(); | |
paypal_buynow.cmd="_s-xclick"; | |
paypal_buynow.hosted_button_id="4901978"; | |
request.data = paypal_buynow; | |
navigateToURL(request); | |
trace(paypal_buynow) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment