Created
November 11, 2013 04:39
Revisions
-
Philo Kezzar revised this gist
Nov 11, 2013 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,5 @@ + (NSDictionary*)getParamFromURL:(NSString*)str { NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; NSString *url=str; NSArray *comp1 = [url componentsSeparatedByString:@"?"]; -
Philo Kezzar created this gist
Nov 11, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ + (NSDictionary*)getParamFromURL:(NSString*)str { // NSString *str = @"http://103.13.128.149:81/SisticWebApp/mobile_securecode_response.jsp?vpc_3DSECI=05&vpc_3DSXID=prdWs3qHUCo1fb8fu8Fz52vJvnY%3D&vpc_3DSenrolled=Y&vpc_3DSstatus=Y&vpc_Amount=129800&vpc_BatchNo=0&vpc_Command=pay&vpc_Locale=en&vpc_MerchTxnRef=20130527101537mtr&vpc_Merchant=DBS90000011A&vpc_Message=Approved&vpc_OrderInfo=20130527101537oi&vpc_SecureHash=D4555323FC2025A0101B2A667416D953&vpc_TransactionNo=0&vpc_TxnResponseCode=0&vpc_VerSecurityLevel=05&vpc_VerStatus=Y&vpc_VerToken=AAABBjGWZEZyFjE3EJZkAAAAAAA%3D&vpc_VerType=3DS&vpc_Version=1"; NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; NSString *url=str; NSArray *comp1 = [url componentsSeparatedByString:@"?"]; NSString *query = [comp1 lastObject]; NSArray *queryElements = [query componentsSeparatedByString:@"&"]; for (NSString *element in queryElements) { NSArray *keyVal = [element componentsSeparatedByString:@"="]; if (keyVal.count > 0) { NSString *variableKey = [keyVal objectAtIndex:0]; NSString *value = (keyVal.count == 2) ? [keyVal lastObject] : nil; NSLog(@"%@ -> %@",variableKey,value); [params setValue:value forKey:variableKey]; } } return [params copy]; }