From c0210f28a7290b8a7fe1ba91d2ca735b27f1cfad Mon Sep 17 00:00:00 2001 From: Dasmer Singh Date: Tue, 2 Sep 2014 13:48:44 -0400 Subject: [PATCH] If no signed request is returned, create incomplete transaction error --- venmo-sdk/Supporting Files/VENErrors.h | 2 ++ venmo-sdk/URL Handling/VENURLProtocol.m | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/venmo-sdk/Supporting Files/VENErrors.h b/venmo-sdk/Supporting Files/VENErrors.h index 5db3cd1..689691b 100644 --- a/venmo-sdk/Supporting Files/VENErrors.h +++ b/venmo-sdk/Supporting Files/VENErrors.h @@ -7,6 +7,8 @@ typedef enum VENSDKErrorCode { VENSDKErrorTransactionValidationError = 1, // Venmo server failed to complete transaction VENSDKErrorTransactionFailed, + // Client did not return a signed request + VENSDKErrorTransactionIncomplete, // Non-success HTTP status code was returned VENSDKErrorHTTPError, // An error occurred related to Venmo OAuth diff --git a/venmo-sdk/URL Handling/VENURLProtocol.m b/venmo-sdk/URL Handling/VENURLProtocol.m index 32d9c63..73c9bb2 100644 --- a/venmo-sdk/URL Handling/VENURLProtocol.m +++ b/venmo-sdk/URL Handling/VENURLProtocol.m @@ -115,6 +115,12 @@ - (void)startLoading { description:@"Failed to validate the transaction." recoverySuggestion:@"Please contact us."]; } + else if (!transaction) { + error = [NSError errorWithDomain:VenmoSDKDomain + code:VENSDKErrorTransactionIncomplete + description:@"The transaction was incomplete." + recoverySuggestion:@"Please try again."]; + } if ([Venmo sharedInstance].transactionCompletionHandler) { [Venmo sharedInstance].transactionCompletionHandler(transaction, transaction.status, error);