我是新來的CCAvenue集成,我想通過所有的客戶數據到webview,但我不知道如何通過它。誰能幫我解決?如何在iOS中的CCAvenue集成中將數據傳遞給webview?
-1
A
回答
2
請嘗試以下代碼viewDidLoad
CCAvenue
webview控制器,在這裏您還可以通過帳單地址,如果您需要在您的應用程序。
//Getting RSA Key
NSString *rsaKeyDataStr = [NSString stringWithFormat:@"access_code=%@&order_id=%@",accessCode,orderId];
NSData *requestData = [NSData dataWithBytes: [rsaKeyDataStr UTF8String] length: [rsaKeyDataStr length]];
NSMutableURLRequest *rsaRequest = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: rsaKeyUrl]];
[rsaRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
[rsaRequest setHTTPMethod: @"POST"];
[rsaRequest setHTTPBody: requestData];
NSData *rsaKeyData = [NSURLConnection sendSynchronousRequest: rsaRequest returningResponse: nil error: nil];
NSString *rsaKey = [[NSString alloc] initWithData:rsaKeyData encoding:NSASCIIStringEncoding];
rsaKey = [rsaKey stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
rsaKey = [NSString stringWithFormat:@"-----BEGIN PUBLIC KEY-----\n%@\n-----END PUBLIC KEY-----\n",rsaKey];
NSLog(@"%@",rsaKey);
//Encrypting Card Details
NSString *myRequestString = [NSString stringWithFormat:@"amount=%@¤cy=%@",amount,currency];
CCTool *ccTool = [[CCTool alloc] init];
NSString *encVal = [ccTool encryptRSA:myRequestString key:rsaKey];
encVal = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL,
(CFStringRef)encVal,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8));
//Preparing for a webview call
NSString *urlAsString = [NSString stringWithFormat:@"https://secure.ccavenue.com/transaction/initTrans"];
NSString *Name=[NSString stringWithFormat:@"%@ %@",billing_Fname,billing_Lname];
NSString *encryptedStr = [NSString stringWithFormat:@"merchant_id=%@&order_id=%@&redirect_url=%@&cancel_url=%@&enc_val=%@&access_code=%@&billing_name=%@&billing_address=%@&billing_city=%@&billing_state=%@&billing_zip=%@&billing_country=India&billing_tel=%@&billing_email=%@&delivery_name=%@&delivery_address=%@&delivery_city=%@&delivery_state=%@&delivery_zip=%@&delivery_country=India&delivery_tel=%@",merchantId,orderId,redirectUrl,cancelUrl,encVal,accessCode,Name,billing_address,billing_city,billing_state,billing_zip,billing_tel,billing_email,Name,billing_address,billing_city,billing_state,billing_zip,billing_tel];
NSData *myRequestData = [NSData dataWithBytes: [encryptedStr UTF8String] length: [encryptedStr length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: urlAsString]];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
[request setValue:urlAsString forHTTPHeaderField:@"Referer"];
[request setHTTPMethod: @"POST"];
[request setHTTPBody: myRequestData];
[_viewWeb loadRequest:request];
相關問題
- 1. 如何將此憑據傳遞給WebView
- 2. iOS:如何將數據傳遞給applicationDidFinishLaunching:?
- 3. 將數據傳遞給本地的HTML的iOS的WebView
- 4. 如何將數據傳遞給ios中的父類?
- 5. 如何在webview中將參數傳遞給javascript
- 6. 如何將類中的數據傳遞給其他成員?
- 7. 將CCAvenue與php集成
- 8. 將數據集中的數據傳遞給字典
- 9. CCAvenue集成
- 10. CCAvenue集成1.6.2
- 11. iOS:將數據傳遞給前端SWRevealViewController
- 12. 將數據傳遞給Singleton iOS
- 13. iOS:將數據從ChildViewController傳遞給GrandParentViewController?
- 14. OkHTTPClient將Cookie傳遞給Webview
- 15. 將Cookie傳遞給Android WebView
- 16. 將參數值傳遞給SSRS 2008中的數據集參數
- 17. 在AngularUI中將數據傳遞給$ modal
- 18. 將Android Activity中的值數組傳遞給WebView中的JavaScript
- 19. 將主參數傳遞給JasperStudio中的子數據集
- 20. CCAvenue iOS套件集成套件
- 21. 如何將Java中的值傳遞給Javascript嵌入Android WebView
- 22. 如何將JSON傳遞給Android webview中的AngularJS?
- 23. 如何將傳遞給main(在argv中)的參數傳遞給我的函數?
- 24. 如何將命令行參數傳遞給iOS中的FFMpeg
- 25. 關於將數據傳遞給iOS中的代表的問題
- 26. 如何將多個數據集傳遞給我在sailsjs中的視圖?
- 27. 在android中集成ccavenue支付網關
- 28. 將數據傳遞給MVC中的@section
- 29. 的java將數據傳遞給jsp中
- 30. 將數據傳遞給Modular中的AngularJS
請先閱讀[我如何問一個很好的問題(http://stackoverflow.com/help/how-to-ask)和[如何創建一個最小的,完整的,並且可驗證的示例]( http://stackoverflow.com/help/mcve)來改善你的問題。這不是「浪費時間」。 –