Created
January 27, 2013 14:15
-
-
Save xtrasmal/4648493 to your computer and use it in GitHub Desktop.
AS3 iDeal Basic ING
Setup iDeal through the iDeal Dashboard. Create a productlist. You need to use deeplinking to handle errors/ cancel / succes !
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
/* Xander Smalbil | |
www.videofunk.nl | |
*/ | |
///////////iDeal | |
if(paymenttext.text=="iDeal"){ | |
var idealData:String; | |
var itemNumber:String; // = 1,2,3,4,5,6; | |
var itemNumber2:String = "33"; | |
var itemPrice:String = "2990"; | |
var itemNumberText:TextField = new TextField(); | |
var itemPriceText:TextField = new TextField(); | |
var itemDescription:String = ""; | |
var url2:String = "https://ideal.secure-ing.com/ideal/mpiPayInitIng.do"; | |
var request2:URLRequest = new URLRequest(url2); | |
var requestVars:URLVariables = new URLVariables(); | |
requestVars.hashKey = "YOU_HASH_KEY"; | |
requestVars.merchantID = "YOUR_ID"; | |
requestVars.subID = "0"; | |
if (phonetext.text=="iPhone 3G(s)"){ | |
itemNumber = "21"; | |
itemDescription = "ITEM DESCRIPTION"; | |
} else if(phonetext.text=="iPhone4"){ | |
itemNumber = "22"; | |
itemDescription = "ITEM DESCRIPTION"; | |
} else if(phonetext.text=="BlackBerry Bold 9700"){ | |
itemNumber = "23"; | |
itemDescription="ITEMDESCRIPTION"; | |
requestVars.amount = "3440"; | |
requestVars.purchaseID = "13234342"; | |
requestVars.language = "nl"; | |
requestVars.currency = "EUR"; | |
requestVars.description = "Produktlijst"; | |
requestVars.paymentType = "ideal"; | |
requestVars.validUntil = "2020-10-22T12:00:00:000Z"; | |
requestVars.aquirer = "ING Bank"; | |
requestVars.itemNumber1 = itemNumber; | |
requestVars.itemDescription1 = itemDescription; | |
requestVars.itemQuantity1 = "1"; | |
requestVars.itemPrice1 = "3440"; | |
} | |
// Finish request | |
request2.data = requestVars; | |
request2.method = URLRequestMethod.POST; | |
mainclip.shop.notifyTxt.text = "Order placed through iDeal"; | |
// Go to iDeal | |
navigateToURL(request2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment