Skip to content

Commit

Permalink
Sample App
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham Garg committed Aug 10, 2021
1 parent 0db5d31 commit c7ae3b5
Show file tree
Hide file tree
Showing 907 changed files with 56,713 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// AppDelegate.swift
// PayUNativeOtpAssistSwiftSample
//
// Created by Shubham Garg on 14/06/21.
//

import UIKit
import PayUNativeOtpAssist
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
PayUOtpAssist.start()
return true
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"images" : [
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "ipad_settings29x29.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "1x",
"size" : "57x57"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "57x57"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "[email protected]",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "ipad_notification20x20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "Icon-40.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "ipad_settings29x29-1.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "ipad_app76x76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "[email protected]",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "iTunesArtwork.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "AKR.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Constants.swift
// PayUNativeOtpAssistSwiftSample
//
// Created by Amit Salaria on 25/06/21.
//

import Foundation

@objc class SampleAppConstants: NSObject {
@objc static let key = "key"
@objc static let salt = "salt"
@objc static let amount = "amount"
@objc static let email = "email"
@objc static let cardNumber = "cardNumber"
@objc static let cardExpiryMonth = "cardExpiryMonth"
@objc static let cardExpiryYear = "cardExpiryYear"
@objc static let saveCard = "saveCard"
@objc static let cardName = "cardName"
@objc static let cvv = "cvv"
@objc static let cardToken = "cardToken"
@objc static let userCredential = "userCredential"
@objc static let cardHash = "card_hash"
@objc static let bankcode = "bankcode"

}

let kCardDetailsViewController = "CardDetailsViewController"
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// Loader.swift
// PayUNativeOtpAssistSwiftSample
//
// Created by Amit Salaria on 25/06/21.
//

import Foundation
import UIKit

class Loader: UIView {

static let shared: Loader = {
let instance = Loader()
return instance
}()

private let loader = UIActivityIndicatorView()

private override init(frame: CGRect) {
super.init(frame: frame)
prepared()
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func prepared() {
self.backgroundColor = UIColor.white.withAlphaComponent(0.5)
self.frame = UIScreen.main.bounds
loader.frame = UIScreen.main.bounds
loader.style = .whiteLarge
loader.center = self.center
loader.color = .gray
self.addSubview(loader)

}

func show() {
let application = UIApplication.shared.delegate as! AppDelegate
application.window?.addSubview(self)

loader.startAnimating()
loader.bringSubviewToFront((application.window?.rootViewController?.view)!)
}

func hide() {
self.removeFromSuperview()
loader.stopAnimating()
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// SavedCards.swift
// PayUNativeOtpAssistSwiftSample
//
// Created by Amit Salaria on 25/06/21.
//

import Foundation
import PayUBizCoreKit

struct StoredCard {
var name: String!
var number: String!
var month: String!
var year: String!
var cvv: String?
var token: String!
var bin: String!
var cardType: String!
var customObj: Any?
}

class SavedCardsAPI {

class func fetchAll(paymentParam: PayUModelPaymentParams, completion: @escaping (([StoredCard])->())) {

PayUWebServiceResponse().getPayUPaymentRelatedDetail(forMobileSDK: paymentParam) { (paymentRelatedDetails, error, extraParam) in

var paymentOptions = [StoredCard]()
if let paymentRelatedDetails = paymentRelatedDetails {

if (paymentRelatedDetails.availablePaymentOptionsArray.contains(PAYMENT_PG_STOREDCARD)) {
for eachStoredCard in paymentRelatedDetails.storedCardArray {
if let eachStoredCard = eachStoredCard as? PayUModelStoredCard {
var savedCard = StoredCard()
savedCard.number = eachStoredCard.cardNo
savedCard.month = eachStoredCard.expiryMonth
savedCard.year = eachStoredCard.expiryYear
savedCard.name = eachStoredCard.nameOnCard
savedCard.customObj = eachStoredCard
savedCard.token = eachStoredCard.cardToken
savedCard.bin = eachStoredCard.cardBin
savedCard.cardType = eachStoredCard.cardType
paymentOptions.append(savedCard)
}
}
}
}

completion(paymentOptions)
}
}

class func saveCard(paymentParam: PayUModelPaymentParams) {
PayUWebServiceResponse().saveUserCard(paymentParam) { (storedCard, errorMessage, otherInfo) in
print(storedCard, errorMessage, otherInfo)
}
}

}
Loading

0 comments on commit c7ae3b5

Please sign in to comment.