-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24969a9
commit 4be3266
Showing
7 changed files
with
174 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
PayUNonSeamlessTestApp/PayU/SDKUI/Presentation Layer/PUUIPayUUPIVC.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// PUUIPayUUPIVC.h | ||
// DoubleConversion | ||
// | ||
// Created by Ashish Jain on 03/02/20. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "PUUIBaseVC.h" | ||
|
||
@interface PUUIPayUUPIVC : PUUIBaseVC | ||
|
||
@property (weak, nonatomic) IBOutlet UITextField *txtFldUPI; | ||
@property (weak, nonatomic) IBOutlet UIView *textView; | ||
|
||
@end |
72 changes: 72 additions & 0 deletions
72
PayUNonSeamlessTestApp/PayU/SDKUI/Presentation Layer/PUUIPayUUPIVC.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// | ||
// PUUIPayUUPIVC.m | ||
// DoubleConversion | ||
// | ||
// Created by Ashish Jain on 03/02/20. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "PUUIPayUUPIVC.h" | ||
#import <PayUBizCoreSDK/PayUBizCoreSDK.h> | ||
|
||
@interface PUUIPayUUPIVC () | ||
|
||
@end | ||
|
||
@implementation PUUIPayUUPIVC | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
self.txtFieldActive = self.txtFldUPI; | ||
self.textView.layer.borderColor = [UIColor blackColor].CGColor; | ||
[self dismissKeyboardOnTapOutsideTextField]; | ||
} | ||
|
||
-(void)viewDidAppear:(BOOL)animated{ | ||
[super viewDidAppear:animated]; | ||
[self enableDisablePayNowButton]; | ||
} | ||
|
||
-(void)enableDisablePayNowButton{ | ||
self.paymentParam.bankCode = @"UPI"; | ||
if ([[[PayUValidations alloc] init] isValidVPA:self.txtFldUPI.text]) { | ||
[[NSNotificationCenter defaultCenter] postNotificationName:kPUUINotiEnablePayNow object:self.paymentParam]; | ||
} else { | ||
[[NSNotificationCenter defaultCenter] postNotificationName:kPUUINotiEnablePayNow object:nil]; | ||
} | ||
} | ||
|
||
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { | ||
[self enableDisablePayNowButton]; | ||
return true; | ||
} | ||
|
||
- (void)textFieldDidEndEditing:(UITextField *)textField { | ||
self.paymentParam.vpa = self.txtFldUPI.text; | ||
[self enableDisablePayNowButton]; | ||
} | ||
|
||
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { | ||
self.txtFieldActive = textField; | ||
textField.inputAccessoryView = [self addDoneBtnOnKeyboard]; | ||
return YES; | ||
} | ||
|
||
-(UIToolbar *)addDoneBtnOnKeyboard{ | ||
UIToolbar *toolbar = [UIToolbar new]; | ||
//setting Toolbar properties | ||
toolbar.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), 30); | ||
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(doneBarButtonTapped)]; | ||
UIBarButtonItem *fixedSpaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; | ||
fixedSpaceButton.width = 10.0; | ||
UIBarButtonItem *flexibleSpaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; | ||
toolbar.items = [NSArray arrayWithObjects:flexibleSpaceButton, doneButton, fixedSpaceButton, nil]; | ||
[toolbar sizeToFit]; | ||
return toolbar; | ||
} | ||
|
||
-(void)doneBarButtonTapped{ | ||
[self dismissKeyboard]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters