Skip to content

Commit 0e6cc8b

Browse files
committed
call beforeValidateCompletion when PIN is requested
- [chore] error should be about charging card, not creating token
1 parent 38c3206 commit 0e6cc8b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Paystack/PSTCKAPIClient.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ - (void)setOperationQueue:(NSOperationQueue *)operationQueue {
147147
#pragma clang diagnostic ignored "-Wunused-variable"
148148
+ (void)validateKey:(NSString *)publicKey {
149149
NSCAssert(publicKey != nil && ![publicKey isEqualToString:@""],
150-
@"You must use a valid public key to create a token.");
150+
@"You must use a valid public key to charge a card.");
151151
BOOL secretKey = [publicKey hasPrefix:@"sk_"];
152152
NSCAssert(!secretKey,
153-
@"You are using a secret key to create a token, instead of the public one.");
153+
@"You are using a secret key to charge the card, instead of the public one.");
154154
#ifndef DEBUG
155155
if ([publicKey.lowercaseString hasPrefix:@"pk_test"]) {
156156
FAUXPAS_IGNORED_IN_METHOD(NSLogUsed);
@@ -346,6 +346,9 @@ - (void) makeChargeRequest:(NSData *)data
346346
}
347347

348348
- (void) requestPin{
349+
[self.operationQueue addOperationWithBlock:^{
350+
self.beforeValidateCompletion(self.serverTransaction.reference);
351+
}];
349352
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Enter CARD PIN"
350353
message:@"To confirm that you are the owner of this card please enter your card PIN"
351354
preferredStyle:UIAlertControllerStyleAlert];

0 commit comments

Comments
 (0)