Created
February 26, 2014 22:05
-
-
Save rconnelly/9239594 to your computer and use it in GitHub Desktop.
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
-(void) fetchCustomerForPayment | |
{ | |
// Retrieve Customer associated with a self.ppsPayment | |
[MMProgressHUD showWithTitle:@"Looking for customer information..."]; | |
[self.ppsPayment getCustomerWithCompletion:^(BOOL success, PPSCustomer *customer, NSError *error) { | |
self.customer = customer; | |
if (success) { | |
DDLogInfo(@"getCustomerWithCompletion returned with success"); | |
[MMProgressHUD showWithTitle:@"Looking for customer information...."]; | |
[self.customer findContactsWithCompletion:^(BOOL success, NSArray *contacts, NSError *error) { | |
[MMProgressHUD dismiss]; | |
if (success) { | |
[[PPSDataManager sharedInstance] addContacts:contacts]; | |
} else { | |
DDLogInfo(@"findContactsWithCompletion returned with error: %@", error.localizedDescription); | |
} | |
}]; | |
} else { | |
[MMProgressHUD dismiss]; | |
DDLogInfo(@"getCustomerWithCompletion returned with error: %@", error.localizedDescription); | |
// I guess it is not a big deal we were not able to "pre-fill" table with known destination recipients, | |
// more manual typing for customer, but no need to bombard users with error message. | |
} | |
[self.tableView reloadData]; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment