Skip to content

Commit

Permalink
Statement Tap 1.2.0 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
torresejay102 committed Dec 3, 2021
1 parent b62b357 commit ad302e1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 39 deletions.
14 changes: 7 additions & 7 deletions TestApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
8E06A5C6256DEAFC009004DD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8E06A5C4256DEAFC009004DD /* Main.storyboard */; };
8E06A5C8256DEAFC009004DD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8E06A5C7256DEAFC009004DD /* Assets.xcassets */; };
8E06A5CB256DEAFC009004DD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8E06A5C9256DEAFC009004DD /* LaunchScreen.storyboard */; };
8E9AD975274E5C4900816B89 /* DirectTap in Frameworks */ = {isa = PBXBuildFile; productRef = 8E9AD974274E5C4900816B89 /* DirectTap */; };
8E9031BB2759E1F200A639DC /* StatementTap in Frameworks */ = {isa = PBXBuildFile; productRef = 8E9031BA2759E1F200A639DC /* StatementTap */; };
8EE1C1512583070C00FCB79C /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EE1C1502583070C00FCB79C /* Constants.swift */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -47,7 +47,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8E9AD975274E5C4900816B89 /* DirectTap in Frameworks */,
8E9031BB2759E1F200A639DC /* StatementTap in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -111,7 +111,7 @@
);
name = TestApp;
packageProductDependencies = (
8E9AD974274E5C4900816B89 /* DirectTap */,
8E9031BA2759E1F200A639DC /* StatementTap */,
);
productName = TestApp;
productReference = 8E06A5BB256DEAFC009004DD /* TestApp.app */;
Expand Down Expand Up @@ -340,7 +340,7 @@
"$(inherited)",
"$(PROJECT_DIR)/TestApp/lib",
);
PRODUCT_BUNDLE_IDENTIFIER = com.brankas.DirectTestApp;
PRODUCT_BUNDLE_IDENTIFIER = com.brankas.StatementTestApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_INCLUDE_PATHS = "$(inherited) $(PROJECT_DIR)/TestApp/lib";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -374,7 +374,7 @@
"$(inherited)",
"$(PROJECT_DIR)/TestApp/lib",
);
PRODUCT_BUNDLE_IDENTIFIER = com.brankas.DirectTestApp;
PRODUCT_BUNDLE_IDENTIFIER = com.brankas.StatementTestApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_INCLUDE_PATHS = "$(inherited) $(PROJECT_DIR)/TestApp/lib";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -418,10 +418,10 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
8E9AD974274E5C4900816B89 /* DirectTap */ = {
8E9031BA2759E1F200A639DC /* StatementTap */ = {
isa = XCSwiftPackageProductDependency;
package = 8E75BCFE274E50120033DE37 /* XCRemoteSwiftPackageReference "core-sdk-ios" */;
productName = DirectTap;
productName = StatementTap;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
1 change: 0 additions & 1 deletion TestApp/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ import Foundation

struct Constants {
static let API_KEY = ""
static let DESTINATION_ACCOUNT_ID = ""
}
37 changes: 6 additions & 31 deletions TestApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import UIKit
import DirectTapFramework
import StatementTapFramework

class ViewController: UIViewController, CoreDelegate, CheckDelegate {
typealias T = String
Expand All @@ -20,49 +20,24 @@ class ViewController: UIViewController, CoreDelegate, CheckDelegate {
return
}

DirectTapSF.shared.initialize(apiKey: Constants.API_KEY, certPath: nil, isDebug: false)
StatementTapSF.shared.initialize(apiKey: Constants.API_KEY, certPath: nil, isDebug: false)

let account = Account(country: Country.PH)
let amount = Amount(currency: Currency.php, numInCents: "10000")
let customer = Customer(firstName: "First", lastName: "Last", email: "hello@gmail.com", mobileNumber: "63")
var client = Client()
client.displayName = "Display Name"
client.returnUrl = "https://www.google.com.ph"

var components = DateComponents()
components.hour = 16
components.minute = 00
components.month = 12
components.day = 6
components.year = 2021

let date = Calendar.current.date(from: components)

var request = DirectTapRequest(sourceAccount: account, destinationAccountId: Constants.DESTINATION_ACCOUNT_ID, amount: amount, memo: "Bank Transfer", customer: customer, referenceId: "sample-reference754878", client: client, dismissAlert: DismissAlert(message: "Do you want to close the application?", confirmButtonText: "Yes", cancelButtonText: "Cancel"), expiryDate: date)

request.browserMode = DirectTapRequest.BrowserMode.WebView
request.useRememberMe = true
let request = StatementTapRequest(country: Country.PH, bankCodes: [BankCode.BDO], externalId: "External ID", successURL: "https://google.com", failURL: "https://hello.com", organizationName: "Organization Name", redirectDuration: 60, browserMode: StatementTapRequest.BrowserMode.WebView, dismissAlert: nil, useRememberMe: true)

do {
try DirectTapSF.shared.checkout(tapRequest: request, vc: self, delegate: self, showBackButton: false)
try StatementTapSF.shared.checkout(statementTapRequest: request, vc: self, delegate: self, showBackButton: false)
} catch {
print("Error: \(error)")
}
}

func onResult(data: String?, error: String?, errorCode: String?) {
print("RESULT: \(data) \(error) \(errorCode)")
if let str = data {
print("TRANSACTION ID: \(str)")
print("STATEMENT ID: \(str)")
}

if let err = error {
if let errCode = errorCode {
print("Error Logs: \(err) \(errCode)")
}
else {
print("Error Logs: \(err)")
}
print("Error Logs: \(err)")
}
}

Expand Down

0 comments on commit ad302e1

Please sign in to comment.