Created
February 24, 2014 20:02
-
-
Save zaneclaes/9195871 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
- (void)choosePaymentInstrument:(BBPaymentInstrument*)instrument { | |
NSAssert(instrument.paymentInstrumentId, @"instrument must have an ID"); | |
NSString *endpoint = [NSString stringWithFormat:@"/trip_invoices/%d",(int)self.tripInvoice.tripInvoiceId.integerValue]; | |
NSDictionary *params = @{@"op":@"add",@"path":@"/payment_instrument_id",@"value":instrument.paymentInstrumentId}; | |
[self showLoadingView:NO blocking:NO]; | |
[[BBAPI V2] patch:endpoint withParams:params onSuccess:^(id object) { | |
[self dismissLoadingView]; | |
[self.tableView triggerPullToRefresh]; | |
} onFailure:^(NSError *e) { | |
[[BBAlertManager sharedManager] showAlertWithError:e]; | |
[self dismissLoadingView]; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment