Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #45 from venmo/daz/no_signed_request
Browse files Browse the repository at this point in the history
If no signed request is returned, create an incomplete transaction error
  • Loading branch information
ayanonagon committed Sep 4, 2014
2 parents e111d50 + c0210f2 commit 1062baa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions venmo-sdk/Supporting Files/VENErrors.h
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions venmo-sdk/URL Handling/VENURLProtocol.m
Expand Up @@ -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);
Expand Down

0 comments on commit 1062baa

Please sign in to comment.