Handling credit cards and IOS

Posted by Susan Jackie on Stack Overflow See other posts from Stack Overflow or by Susan Jackie
Published on 2013-10-20T21:51:30Z Indexed on 2013/10/20 21:53 UTC
Read the original article Hit count: 157

Filed under:
|

I am using NSUrlConnection asyncronous request to transmit credit card information to a secure third party server.

I do the following:

  1. I get the credit card number, cvv, etc from the uitextfields.
  2. Encode the credit card information into a json format. Set as httpd body of the nsurlconnection request as follows:

    NSURL * url = [[NSURL URLWithString: "https://www.example.com"];

    NSMutableURLRequest * request = [[NSMutableURLRequest alloc] initWithURL: url];

    [request setHTTPMethod: @"POST"]; [request setValue:@"application/json" forHTTPHeaderField:@"Accept"]; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

    [request setHTTPBody: [NSJSONSerialization dataWithJSONObject: params options: kNilOptions error: &parseError]];

  3. Send this information via asynchronous request to a secure third party server:

    [NSURLConnection sendAsynchronousRequest:request queue: queue completionHandler:^(NSURLResponse *response, NSData *data, NSError * requestError) {

What should I be considering to send user credit card information to a third party server using nsurlconnection asynchronous request?

© Stack Overflow or respective owner

Related posts about ios

Related posts about objective-c