Created
September 16, 2015 10:18
-
-
Save yazinsai/3330e97370f283250f20 to your computer and use it in GitHub Desktop.
This file contains 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
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
manager.responseSerializer = [AFJSONResponseSerializer serializer]; | |
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/json"]; | |
NSDictionary *params = @{@"amount":@"1000", | |
@"currency":@"aed", | |
@"email":@"ahmed@example.com",@"card[name]":@"Abdullah Ahmed", | |
@"card[number]":@"4242424242424242", | |
@"card[exp_month]":@"11", | |
@"card[exp_year]":@"2016", | |
@"card[cvc]":@"123", | |
@"description":@"Two widgets (test@example.com"}; | |
[manager.requestSerializer setAuthorizationHeaderFieldWithUsername:@"your_secret_key" password:@""]; | |
[manager POST:@"https://api.start.payfort.com/charges/" parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) | |
{ | |
NSLog(@"JSON: %@", responseObject); | |
} | |
failure:^(AFHTTPRequestOperation operation, NSError error) | |
{ | |
NSLog(@"Error: %@", error); | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment