Skip to content

Instantly share code, notes, and snippets.

@dutchand
Created November 12, 2014 19:01
Show Gist options
  • Save dutchand/0bb51c62dc6085d79df7 to your computer and use it in GitHub Desktop.
Save dutchand/0bb51c62dc6085d79df7 to your computer and use it in GitHub Desktop.
Paypal Integration Function
public var period:int=1; //various also by service
public var charge:Number = 599.00;// varies by product
public function gopaypalpay():void{
if(sipay.selected == true)
charge = 1598.00
var p:Number;
p = 0;
var url:String = "https://www.paypal.com/cgi-bin/webscr";
var request:URLRequest = new URLRequest(url);
var variables:URLVariables = new URLVariables();
variables.cmd="_xclick";
variables.currency_code="USD";
variables.business="example@email.com";
variables.item_number = code;
variables.item_name = "Registration with example.com"; //can be dinamic values
variables.amount= charge;
variables.quantity = period;
variables.tax = p;
request.data = variables;
request.method = URLRequestMethod.POST;
navigateToURL(request,"_parent"); //also can be blank or self
}
private function all():void
{
insertItemcredit();
gopaypalpay();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment