Skip to content

Commit

Permalink
Added UPI UI
Browse files Browse the repository at this point in the history
  • Loading branch information
umangarya336 committed Aug 27, 2020
1 parent 24969a9 commit 4be3266
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 6 deletions.
6 changes: 6 additions & 0 deletions PayUNonSeamlessTestApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
DD11F8351CE99E140025D1F0 /* UIColor+PUUIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = DD11F80C1CE99E140025D1F0 /* UIColor+PUUIColor.m */; };
DD14F92224F78405009308A4 /* PayUBizCoreSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD14F92024F783FB009308A4 /* PayUBizCoreSDK.framework */; };
DD14F92324F78405009308A4 /* PayUBizCoreSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DD14F92024F783FB009308A4 /* PayUBizCoreSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
DD14F92624F78D65009308A4 /* PUUIPayUUPIVC.m in Sources */ = {isa = PBXBuildFile; fileRef = DD14F92524F78D64009308A4 /* PUUIPayUUPIVC.m */; };
DD284EC71CE30684008CDE79 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD284E2A1CE30684008CDE79 /* AppDelegate.m */; };
DD284ED21CE30684008CDE79 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DD284E391CE30684008CDE79 /* LaunchScreen.storyboard */; };
DD284EDB1CE30684008CDE79 /* PUVAConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = DD284E501CE30684008CDE79 /* PUVAConfiguration.m */; };
Expand Down Expand Up @@ -123,6 +124,8 @@
DD11F80B1CE99E140025D1F0 /* UIColor+PUUIColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+PUUIColor.h"; sourceTree = "<group>"; };
DD11F80C1CE99E140025D1F0 /* UIColor+PUUIColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+PUUIColor.m"; sourceTree = "<group>"; };
DD14F92024F783FB009308A4 /* PayUBizCoreSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = PayUBizCoreSDK.framework; sourceTree = "<group>"; };
DD14F92424F78D64009308A4 /* PUUIPayUUPIVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PUUIPayUUPIVC.h; sourceTree = "<group>"; };
DD14F92524F78D64009308A4 /* PUUIPayUUPIVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PUUIPayUUPIVC.m; sourceTree = "<group>"; };
DD284E291CE30684008CDE79 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
DD284E2A1CE30684008CDE79 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
DD284E3A1CE30684008CDE79 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -280,6 +283,8 @@
DD11F7E11CE99E140025D1F0 /* Presentation Layer */ = {
isa = PBXGroup;
children = (
DD14F92424F78D64009308A4 /* PUUIPayUUPIVC.h */,
DD14F92524F78D64009308A4 /* PUUIPayUUPIVC.m */,
DD11F7E21CE99E140025D1F0 /* Base ViewController */,
DD11F7E71CE99E140025D1F0 /* PUUICardOptionVC.h */,
DD11F7E81CE99E140025D1F0 /* PUUICardOptionVC.m */,
Expand Down Expand Up @@ -625,6 +630,7 @@
DD11F8301CE99E140025D1F0 /* KHTabScrollView.m in Sources */,
DD44D4D31CE4876900088C84 /* PUSAWSManager.m in Sources */,
DD11F8281CE99E140025D1F0 /* PUUIPayUMoneyVC.m in Sources */,
DD14F92624F78D65009308A4 /* PUUIPayUUPIVC.m in Sources */,
DD44D4D21CE4876900088C84 /* PUSAHelperClass.m in Sources */,
DD11F8221CE99E140025D1F0 /* PUUIBaseVC.m in Sources */,
DD44D4D81CE4878300088C84 /* PUSAStartScreenVC.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ - (void) cardOptionSelectedWithIndex:(NSInteger)cardIndex
PayUModelNetBanking *modelNetBanking = [self.paymentRelatedDetail.netBankingArray objectAtIndex:indexCard];
[self.btnBankName setTitle:modelNetBanking.netBankingTitle forState:UIControlStateNormal];
self.paymentParam.bankCode = modelNetBanking.bankCode;
[self enableDisablePayNowWithUserInfo:nil];
}
}

Expand All @@ -133,4 +134,4 @@ -(void)enableDisablePayNowWithUserInfo:(NSDictionary *) dict{
}


@end
@end
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "PUUIStoredCardCarouselVC.h"
#import "PUUIPayUMoneyVC.h"
#import "iOSDefaultActivityIndicator.h"
#import "PUUIPayUUPIVC.h"

#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)

Expand Down Expand Up @@ -235,7 +236,11 @@ - (UIViewController *)viewControllerForIndex:(NSInteger)index {

return lazyPay;
}

else if ([[actualPaymentOption objectAtIndex:index] isEqual:PAYMENT_PG_UPI]) {
PUUIPayUUPIVC *upi = [self.storyboard instantiateViewControllerWithIdentifier:VC_IDENTIFIER_PAYU_UPI];
upi.paymentParam = [self.paymentParam copy];
return upi;
}
else{
UIViewController *vc = [PUUIBaseVC new];
[[vc view] setBackgroundColor:[UIColor whiteColor]];
Expand Down Expand Up @@ -539,11 +544,12 @@ -(NSArray *)paymentOption{
PAYMENT_PG_STOREDCARD,
PAYMENT_PG_CCDC,
PAYMENT_PG_NET_BANKING,
PAYMENT_PG_UPI,
PAYMENT_PG_PAYU_MONEY,
PAYMENT_PG_EMI,
PAYMENT_PG_NO_COST_EMI,

PAYMENT_PG_LAZYPAY, nil]];
PAYMENT_PG_LAZYPAY,
nil]];
NSArray *arr;
if ([_paymentOption count]) {
NSMutableOrderedSet *setGivenPaymentOption = [[NSMutableOrderedSet alloc] initWithArray:_paymentOption];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -839,6 +839,72 @@
</objects>
<point key="canvasLocation" x="3320" y="-3231"/>
</scene>
<!--PayUUPIVC-->
<scene sceneID="a21-TI-pDp">
<objects>
<viewController storyboardIdentifier="PUUIPayUUPIVC" id="xYp-w4-hDA" customClass="PUUIPayUUPIVC" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="2R0-dL-DgB"/>
<viewControllerLayoutGuide type="bottom" id="Cue-gv-BKj"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="vCK-kZ-LYG">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Please Enter VPA" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l5h-xM-XXT">
<rect key="frame" x="38" y="20" width="125" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wK3-rC-pnO">
<rect key="frame" x="36" y="60" width="303" height="45"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" tag="105" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="address@example" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="gVh-25-fTZ">
<rect key="frame" x="8" y="8" width="287" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="xYp-w4-hDA" id="4Zg-bD-ame"/>
</connections>
</textField>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="8mR-2N-T1G"/>
<constraint firstItem="gVh-25-fTZ" firstAttribute="top" secondItem="wK3-rC-pnO" secondAttribute="top" constant="8" id="8tc-dn-NaG"/>
<constraint firstItem="gVh-25-fTZ" firstAttribute="centerY" secondItem="wK3-rC-pnO" secondAttribute="centerY" id="DcT-io-Q8d"/>
<constraint firstAttribute="bottom" secondItem="gVh-25-fTZ" secondAttribute="bottom" constant="8" id="Xhr-Ra-Yd8"/>
<constraint firstAttribute="trailing" secondItem="gVh-25-fTZ" secondAttribute="trailing" constant="8" id="f1c-eO-KTD"/>
<constraint firstItem="gVh-25-fTZ" firstAttribute="leading" secondItem="wK3-rC-pnO" secondAttribute="leading" constant="8" id="lnz-oT-8xF"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="7"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="wK3-rC-pnO" secondAttribute="trailing" constant="20" id="7Lw-og-I4X"/>
<constraint firstItem="wK3-rC-pnO" firstAttribute="leading" secondItem="vCK-kZ-LYG" secondAttribute="leadingMargin" constant="20" id="96b-qn-GAp"/>
<constraint firstItem="wK3-rC-pnO" firstAttribute="top" secondItem="l5h-xM-XXT" secondAttribute="bottom" constant="20" id="Bdq-sP-dF4"/>
<constraint firstItem="l5h-xM-XXT" firstAttribute="top" secondItem="2R0-dL-DgB" secondAttribute="bottom" constant="20" id="MQW-Bg-xNG"/>
<constraint firstItem="l5h-xM-XXT" firstAttribute="leading" secondItem="vCK-kZ-LYG" secondAttribute="leadingMargin" constant="22" id="gcj-N6-nH8"/>
</constraints>
</view>
<connections>
<outlet property="textView" destination="wK3-rC-pnO" id="8ah-rw-Ink"/>
<outlet property="txtFldUPI" destination="gVh-25-fTZ" id="Gsl-Jn-lBv"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="lMR-b3-N4I" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1612" y="-793"/>
</scene>
</scenes>
<resources>
<image name="Card" width="30" height="30"/>
Expand Down
1 change: 1 addition & 0 deletions PayUNonSeamlessTestApp/PayU/SDKUI/Utility/PUUIConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ typedef NS_ENUM(NSInteger, TableViewType) {
#define VC_IDENTIFIER_CASHCARD @"PUUICashCardVC"
#define VC_IDENTIFIER_EMI @"PUUI_EMI_VC"
#define VC_IDENTIFIER_PAYU_MONEY @"PUUIPayUMoneyVC"
#define VC_IDENTIFIER_PAYU_UPI @"PUUIPayUUPIVC"


//#define NAVIGATION_CONTROLLER_IDENTIFIER @"PayUNavigationController"
Expand Down

0 comments on commit 4be3266

Please sign in to comment.