Skip to content

Commit

Permalink
Don't return CVV if not collected
Browse files Browse the repository at this point in the history
  • Loading branch information
arskinner committed May 10, 2017
1 parent 9e5b63a commit 2e7c2f7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions iphone/Classes/ComLikelysoftCardioModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,24 @@ - (void)userDidCancelPaymentViewController:(CardIOPaymentViewController *)scanVi

- (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)info inPaymentViewController:(CardIOPaymentViewController *)scanViewController {
// The full card number is available as info.cardNumber, but don't log that!
NSLog(@"Received card info. Number: %@, expiry: %02i/%i, cvv: %@.", info.redactedCardNumber, info.expiryMonth, info.expiryYear, info.cvv);

if (collectCVV) {
NSLog(@"Received card info. Number: %@, expiry: %02i/%i, cvv: %@.", info.redactedCardNumber, info.expiryMonth, info.expiryYear, info.cvv);
}
else {
NSLog(@"Received card info. Number: %@, expiry: %02i/%i.", info.redactedCardNumber, info.expiryMonth, info.expiryYear);
}

NSMutableDictionary *event = [NSMutableDictionary dictionary];
[event setObject:info.cardNumber forKey:@"cardNumber"];
[event setObject:info.redactedCardNumber forKey:@"redactedCardNumber"];
[event setObject:[NSString stringWithFormat:@"%lu",(unsigned long)info.expiryMonth] forKey:@"expiryMonth"];
[event setObject:[NSString stringWithFormat:@"%lu",(unsigned long)info.expiryYear] forKey:@"expiryYear"];
[event setObject:info.cvv forKey:@"cvv"];

if (collectCVV) {
[event setObject:info.cvv forKey:@"cvv"];
}

[event setObject:@"true" forKey:@"success"];
[self _fireEventToListener:@"completed" withObject:event listener:self._callback thisObject:nil];

Expand Down

0 comments on commit 2e7c2f7

Please sign in to comment.