Skip to content

Commit

Permalink
clearCachedCustomer in retryLoading
Browse files Browse the repository at this point in the history
  • Loading branch information
bg-stripe committed Dec 15, 2017
1 parent 2e105e2 commit 6264e9e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Stripe/STPPaymentContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ - (instancetype)initWithAPIAdapter:(id<STPBackendAPIAdapter>)apiAdapter
}

- (void)retryLoading {
// Clear any cached customer object before refetching
if ([self.apiAdapter isKindOfClass:[STPCustomerContext class]]) {
STPCustomerContext *customerContext = (STPCustomerContext *)self.apiAdapter;
[customerContext clearCachedCustomer];
}
WEAK(self);
self.loadingPromise = [[[STPPromise<STPPaymentMethodTuple *> new] onSuccess:^(STPPaymentMethodTuple *tuple) {
STRONG(self);
Expand Down

0 comments on commit 6264e9e

Please sign in to comment.