-
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
Ashish Kumar2
committed
Dec 12, 2016
1 parent
84ec7d2
commit 033992b
Showing
40 changed files
with
1,205 additions
and
529 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
Empty file modified
0
PayUNonSeamlessTestApp/PayU/CB/iOSCustomBrowser/CBWKConnection.h
100644 → 100755
Empty file.
Empty file modified
0
PayUNonSeamlessTestApp/PayU/CB/iOSCustomBrowser/PUCBAllPaymentOption.xib
100644 → 100755
Empty file.
Empty file modified
0
PayUNonSeamlessTestApp/PayU/CB/iOSCustomBrowser/PUCBApproveView.xib
100644 → 100755
Empty file.
Empty file modified
0
PayUNonSeamlessTestApp/PayU/CB/iOSCustomBrowser/PUCBBankPageLoading.xib
100644 → 100755
Empty file.
Empty file modified
0
PayUNonSeamlessTestApp/PayU/CB/iOSCustomBrowser/PUCBLoader.xib
100644 → 100755
Empty file.
Empty file modified
0
PayUNonSeamlessTestApp/PayU/CB/iOSCustomBrowser/PUCBRegenerateOTPView.xib
100644 → 100755
Empty file.
Empty file modified
0
PayUNonSeamlessTestApp/PayU/CB/iOSCustomBrowser/PayUCBInfo.plist
100644 → 100755
Empty file.
Empty file.
Empty file modified
0
PayUNonSeamlessTestApp/PayU/SDK/PayU_iOS_CoreSDK/CoreTelephony.h
100644 → 100755
Empty file.
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
Empty file modified
0
PayUNonSeamlessTestApp/PayU/SDK/PayU_iOS_CoreSDK/PayUFileManager.h
100644 → 100755
Empty file.
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
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
Empty file modified
0
PayUNonSeamlessTestApp/PayU/SDK/PayU_iOS_CoreSDK/PayUReachability.h
100644 → 100755
Empty file.
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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
<plist version="1.0"> | ||
<dict> | ||
<key>sdkVersion</key> | ||
<string>3.7.5</string> | ||
<string>3.8</string> | ||
</dict> | ||
</plist> |
Empty file modified
0
PayUNonSeamlessTestApp/PayU/SDK/PayU_iOS_CoreSDK/PayUWSManager.h
100644 → 100755
Empty file.
Binary file not shown.
18 changes: 18 additions & 0 deletions
18
PayUNonSeamlessTestApp/PayU/SDKUI/CustomViews/PUUIEMITopView.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,18 @@ | ||
// | ||
// PUUIEMITopView.h | ||
// PayUNonSeamlessTestApp | ||
// | ||
// Created by Umang Arya on 9/29/16. | ||
// Copyright © 2016 PayU. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "PUUICCDCVC.h" | ||
|
||
@interface PUUIEMITopView : UIView | ||
|
||
@property (weak, nonatomic) IBOutlet UIView *vwBottom; | ||
-(instancetype)initWithPaymentType:(NSString *) paymentType parentVC:(PUUICCDCVC *) parentVC; | ||
- (void)showSubViewOnView:(UIView *)view; | ||
|
||
@end |
167 changes: 167 additions & 0 deletions
167
PayUNonSeamlessTestApp/PayU/SDKUI/CustomViews/PUUIEMITopView.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,167 @@ | ||
// | ||
// PUUIEMITopView.m | ||
// PayUNonSeamlessTestApp | ||
// | ||
// Created by Umang Arya on 9/29/16. | ||
// Copyright © 2016 PayU. All rights reserved. | ||
// | ||
|
||
#import "PUUIEMITopView.h" | ||
#import "PayUConstants.h" | ||
#import "PUUICardOptionVC.h" | ||
#import "PUUIConstants.h" | ||
|
||
@interface PUUIEMITopView () <CardOptionDelegate> | ||
{ | ||
PUUICardOptionVC *_cardOptionVC; | ||
NSArray *_arrEMI, *_arrbankName, *_arrDuration; | ||
NSDictionary *_emiDict; | ||
NSString *_selectedBankName, *_selectedEMIDuration; | ||
} | ||
@property (weak, nonatomic) IBOutlet UIButton *btnSelectBank; | ||
@property (weak, nonatomic) IBOutlet UIButton *btnSelectDuration; | ||
@property (weak, nonatomic) IBOutlet UIView *vwTop; | ||
@property (weak, nonatomic) PUUICCDCVC *parentVC; | ||
@property (nonatomic, weak) NSString *paymentType; | ||
@end | ||
|
||
|
||
@implementation PUUIEMITopView | ||
|
||
-(instancetype)initWithPaymentType:(NSString *) paymentType parentVC:(PUUICCDCVC *) parentVC{ | ||
self = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([PUUIEMITopView class]) owner:self options:nil] firstObject]; | ||
if (self) { | ||
self.parentVC = parentVC; | ||
self.paymentType = paymentType; | ||
|
||
if ([paymentType isEqual:PAYMENT_PG_NO_COST_EMI]) { | ||
PayUSDKLog(@"No Cost EMI EMI Top view created"); | ||
_arrEMI = parentVC.paymentRelatedDetail.NoCostEMIArray; | ||
_emiDict = [PayUModelEMI getEligibleNoCostEMIDictFromEMIModelArray:_arrEMI WRTToAmount:self.parentVC.paymentParam.amount]; | ||
} | ||
else if ([paymentType isEqual:PAYMENT_PG_EMI]){ | ||
PayUSDKLog(@"EMI Top view created"); | ||
_arrEMI = parentVC.paymentRelatedDetail.EMIArray; | ||
_emiDict = [PayUModelEMI getEMIDictFromEMIModelArray:_arrEMI]; | ||
[self.vwTop removeFromSuperview]; | ||
[self.vwBottom setNeedsLayout]; | ||
[self.vwBottom layoutIfNeeded]; | ||
} | ||
|
||
[self.btnSelectBank.layer setBorderColor:[UIColor payUViewBorderColor].CGColor]; | ||
[self.btnSelectDuration.layer setBorderColor:[UIColor payUViewBorderColor].CGColor]; | ||
|
||
} | ||
return self; | ||
} | ||
|
||
-(void)addConstraint{ | ||
PayUSDKLog(@"Constraint Added"); | ||
[self setTranslatesAutoresizingMaskIntoConstraints:NO]; | ||
|
||
NSLayoutConstraint *leftConstraint, *rigthConstraint, *bottomConstraint, *topConstraint; | ||
|
||
leftConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.superview attribute:NSLayoutAttributeLeading multiplier:1 constant:0]; | ||
leftConstraint.active = YES; | ||
|
||
rigthConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.superview attribute:NSLayoutAttributeTrailing multiplier:1 constant:0]; | ||
rigthConstraint.active = YES; | ||
|
||
bottomConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.superview attribute:NSLayoutAttributeBottom multiplier:1 constant:0]; | ||
bottomConstraint.active = YES; | ||
|
||
topConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.superview attribute:NSLayoutAttributeTop multiplier:1 constant:0]; | ||
topConstraint.active = YES; | ||
|
||
// NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeHeight multiplier:1 constant:40]; | ||
// heightConstraint.active = YES; | ||
} | ||
|
||
- (void)showSubViewOnView:(UIView *)view { | ||
PayUSDKLog(@"showSubViewOnView method called"); | ||
[view addSubview:self]; | ||
[self addConstraint]; | ||
} | ||
|
||
|
||
- (IBAction)btnClickedSelectDuration:(id)sender { | ||
PayUSDKLog(@"btnClickedSelectDuration called"); | ||
UINavigationController *navigationCtrlr = [self getNavigationControllerInstance]; | ||
_cardOptionVC = (PUUICardOptionVC *)[navigationCtrlr topViewController]; | ||
_cardOptionVC.arrStoredCards = (NSMutableArray *)_arrDuration; | ||
_cardOptionVC.delegate = self; | ||
if (!_selectedEMIDuration) { | ||
_cardOptionVC.cardIndex = -1; | ||
} | ||
else{ | ||
_cardOptionVC.cardIndex = [_arrDuration indexOfObject:_selectedEMIDuration]; | ||
} | ||
_cardOptionVC.tableViewType = TableViewTypeEMIDuration; | ||
|
||
[self.parentVC presentViewController:navigationCtrlr animated:YES completion:nil]; | ||
} | ||
|
||
|
||
- (IBAction)btnClickedSelectBank:(id)sender { | ||
PayUSDKLog(@"btnClickedSelectBank called"); | ||
UINavigationController *navigationCtrlr = [self getNavigationControllerInstance]; | ||
_cardOptionVC = (PUUICardOptionVC *)[navigationCtrlr topViewController]; | ||
_arrbankName = [[_emiDict allKeys] sortedArrayUsingSelector:@selector(localizedStandardCompare:)]; | ||
_cardOptionVC.arrStoredCards = (NSMutableArray *)_arrbankName; | ||
_cardOptionVC.delegate = self; | ||
if (!_selectedBankName) { | ||
_cardOptionVC.cardIndex = -1; | ||
} | ||
else{ | ||
_cardOptionVC.cardIndex = [_arrbankName indexOfObject:_selectedBankName]; | ||
} | ||
_cardOptionVC.tableViewType = TableViewTypeEMIBank; | ||
|
||
[self.parentVC presentViewController:navigationCtrlr animated:YES completion:nil]; | ||
} | ||
|
||
|
||
- (void) cardOptionSelectedWithIndex:(NSInteger)cardIndex{ | ||
if (cardIndex >=0) { | ||
if (_cardOptionVC.tableViewType == TableViewTypeEMIBank){ | ||
PayUSDKLog(@"cardOptionSelectedWithIndex for EMIBank method called"); | ||
NSString *bankName = [_arrbankName objectAtIndex:cardIndex]; | ||
if (![bankName isEqualToString:_selectedBankName]) { | ||
_selectedBankName = bankName; | ||
_arrDuration = [[[_emiDict valueForKey:_selectedBankName] allKeys] sortedArrayUsingSelector:@selector(localizedStandardCompare:)]; | ||
[self setEMIDurationRelatedObjects:0]; | ||
} | ||
[self.btnSelectBank setTitle:_selectedBankName forState:UIControlStateNormal]; | ||
} | ||
else if (_cardOptionVC.tableViewType == TableViewTypeEMIDuration) { | ||
[self setEMIDurationRelatedObjects:cardIndex]; | ||
} | ||
} | ||
else{ | ||
if (_cardOptionVC.tableViewType == TableViewTypeEMIBank){ | ||
// [self setEMIDurationParamToDefault]; | ||
} | ||
} | ||
} | ||
|
||
-(UINavigationController *)getNavigationControllerInstance{ | ||
UIStoryboard *stryBrd = [UIStoryboard storyboardWithName:@"PUUIMainStoryBoard" bundle:nil]; | ||
UINavigationController *navigationCtrlr = [stryBrd instantiateViewControllerWithIdentifier:@"NavSC"]; | ||
return navigationCtrlr; | ||
} | ||
|
||
//-(void)setEMIDurationParamToDefault{ | ||
// _arrDuration = nil; | ||
// _selectedEMIDuration = nil; | ||
// self.parentVC.paymentParam.bankCode = nil; | ||
// [self.btnSelectDuration setTitle:self.defaultSelectDurationTitile forState:UIControlStateNormal]; | ||
//} | ||
// | ||
-(void)setEMIDurationRelatedObjects:(NSInteger) cardIndex{ | ||
_selectedEMIDuration = [_arrDuration objectAtIndex:cardIndex]; | ||
[self.btnSelectDuration setTitle:_selectedEMIDuration forState:UIControlStateNormal]; | ||
self.parentVC.paymentParam.bankCode = [(PayUModelEMI *)[[_emiDict valueForKey:_selectedBankName] valueForKey:_selectedEMIDuration] bankCode]; | ||
|
||
} | ||
|
||
@end |
Oops, something went wrong.