Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
superMonsterc committed Jun 28, 2019
1 parent d8ac518 commit e7cfd9d
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 47 deletions.
21 changes: 2 additions & 19 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,47 +1,30 @@
PODS:
- Alamofire (4.8.0)
- BigInt (3.1.0):
- SipHash (~> 1.2)
- CryptoSwift (0.10.0)
- SipHash (1.2.2)
- SwiftLint (0.28.1)
- SwiftProtobuf (1.2.0)
- SwiftyRSA (1.5.0):
- SwiftyRSA/ObjC (= 1.5.0)
- SwiftyRSA/ObjC (1.5.0)
- TTCPay (0.0.4):
- Alamofire
- CryptoSwift (= 0.10.0)
- SwiftProtobuf (= 1.2.0)
- SwiftyRSA

DEPENDENCIES:
- BigInt (~> 3.0)
- SwiftLint (= 0.28.1)
- SwiftyRSA
- TTCPay

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Alamofire
- BigInt
- CryptoSwift
- SipHash
- SwiftLint
- SwiftProtobuf
- SwiftyRSA
- TTCPay

SPEC CHECKSUMS:
Alamofire: 3ec537f71edc9804815215393ae2b1a8ea33a844
BigInt: 76b5dfdfa3e2e478d4ffdf161aeede5502e2742f
CryptoSwift: 6c778d69282bed3b4e975ff97a79d074f20bb011
SipHash: fad90a4683e420c52ef28063063dbbce248ea6d4
SwiftLint: 7f5f7de0da74a649b16616cb5246ae323489656e
SwiftProtobuf: 91a9856079044ef4ec762b2344c763cd9e5a73c1
SwiftyRSA: 6e528fb1b1a87d5111c48081083b141d6d65f1cf
TTCPay: f4fea98126ef1282e46d69170ccbaaeb468aa01d

PODFILE CHECKSUM: 9ddb82b2127ae92d1e21ae7ba4d33a67c5bdc0f6
PODFILE CHECKSUM: 996c2127406329eada2e24737bc3e4ec39fe6b78

COCOAPODS: 1.6.0.beta.2
COCOAPODS: 1.7.1
2 changes: 1 addition & 1 deletion TTCPay.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'TTCPay'
s.version = '0.0.4'
s.version = '0.1.0'
s.summary = 'TTCPay'
s.homepage = 'https://github.com/TTCECO'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
Binary file modified TTCPay/TTCPay.framework/TTCPay
Binary file not shown.
29 changes: 7 additions & 22 deletions TTCPayDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 51;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -35,7 +35,7 @@
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
4269E88D21C0B7190021DCDE /* Embed Frameworks */ = {
427BEF4B22B9E828005D4607 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
Expand Down Expand Up @@ -217,8 +217,8 @@
42859EAF21BF9A9400354AAF /* Sources */,
42859EB021BF9A9400354AAF /* Frameworks */,
42859EB121BF9A9400354AAF /* Resources */,
4269E88D21C0B7190021DCDE /* Embed Frameworks */,
8B7DED8FD412AECA4BD912BA /* [CP] Embed Pods Frameworks */,
427BEF4B22B9E828005D4607 /* Embed Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -304,28 +304,11 @@
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-TTCPayDemo/Pods-TTCPayDemo-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/BigInt/BigInt.framework",
"${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework",
"${BUILT_PRODUCTS_DIR}/SipHash/SipHash.framework",
"${BUILT_PRODUCTS_DIR}/SwiftProtobuf/SwiftProtobuf.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyRSA/SwiftyRSA.framework",
"${PODS_ROOT}/TTCPay/TTCPay/TTCPay.framework",
"${PODS_ROOT}/Target Support Files/Pods-TTCPayDemo/Pods-TTCPayDemo-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BigInt.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SipHash.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftProtobuf.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyRSA.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TTCPay.framework",
"${PODS_ROOT}/Target Support Files/Pods-TTCPayDemo/Pods-TTCPayDemo-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -519,6 +502,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "";
PRODUCT_BUNDLE_IDENTIFIER = eco.ttc.sdk.payDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
Expand All @@ -544,6 +528,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "";
PRODUCT_BUNDLE_IDENTIFIER = eco.ttc.sdk.payDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
Expand Down
21 changes: 21 additions & 0 deletions TTCPayDemo/Assets.xcassets/ACN.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "pay_acn_unchecked.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions TTCPayDemo/Assets.xcassets/ACN_Checked.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "pay_acn_checked.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion TTCPayDemo/TTC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TTC: NSObject {
var TTCPrice: Double = 0

func fetchPrice() {
TTCPay.shared.fetchPrice(currencyType: 2) { (success, price, error) in
TTCPay.shared.fetchPrice(currencyType: 2, currencyID: 0) { (success, price, error) in
if success {
self.TTCPrice = Double(price!) ?? 0
}
Expand Down
2 changes: 1 addition & 1 deletion TTCPayDemo/modules/view/TTCCheckoutTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TTCCheckoutTableViewCell: UITableViewCell {
}

switch payment?.name {
case "TTC Pay":
case "TTC Pay", "ACN Pay":
selectView.backgroundColor = UIColor.appBlue
// case "Mastercard":
// selectView.backgroundColor = UIColor.appGray
Expand Down
30 changes: 28 additions & 2 deletions TTCPayDemo/modules/viewController/TTCCheckoutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class TTCCheckoutViewController: TTCBaseViewController {
return [
TTCPayment(name: "Paypal", imageName: "Paypal"),
TTCPayment(name: "TTC Pay", imageName: "TTC"),
TTCPayment(name: "ACN Pay", imageName: "ACN"),
TTCPayment(name: "Apple Pay", imageName: "ApplePay"),
TTCPayment(name: "Mastercard", imageName: "MasterCard")]
}
Expand Down Expand Up @@ -92,7 +93,7 @@ class TTCCheckoutViewController: TTCBaseViewController {
extension TTCCheckoutViewController {

func fetchTTCPrice() {
TTCPay.shared.fetchPrice(currencyType: 2) { (success, price, error) in
TTCPay.shared.fetchPrice(currencyType: 2, currencyID: 0) { (success, price, error) in
if success, let ttcprice = price, let ttcDouble = Double(ttcprice) {
TTC.shared.TTCPrice = ttcDouble
self.TTCPrice = ttcDouble
Expand All @@ -106,14 +107,20 @@ extension TTCCheckoutViewController {

@objc func payment() {

if currentPay?.name == "TTC Pay", let order = order {
if (currentPay?.name == "TTC Pay" || currentPay?.name == "ACN Pay"), let order = order {

let createOrder = TTCCreateOrder()
createOrder.appId = TTCPay.shared.appId
createOrder.createTime = order.createTime
createOrder.expireTime = order.expireTime // 15分钟
createOrder.description_p = order.description_p
createOrder.outTradeNo = order.outTradeNo
if currentPay?.name == "TTC Pay" {
createOrder.payType = 0
} else {
createOrder.payType = 1
}

let total = Double(order.totalFee)/TTCPrice/100000
createOrder.totalFee = EtherNumberFormatter.shared.number(from: "\(total)")?.description ?? ""

Expand Down Expand Up @@ -208,7 +215,26 @@ extension TTCCheckoutViewController: UITableViewDelegate {
}
paymentButton.setTitle(text, for: .normal)
}
case "ACN Pay":
paymentButton.backgroundColor = UIColor.appBlue

if let order = order, TTCPrice != 0 {

let total = Double(order.totalFee)/TTCPrice/100000
let numberFormatter = NumberFormatter()
numberFormatter.maximumFractionDigits = 6
numberFormatter.minimumIntegerDigits = 1

let totalString = numberFormatter.string(from: NSNumber(value: total))
var text = ""

if let string = totalString {
text = "Pay \(string) ACN"
} else {
text = "Pay \(total) ACN"
}
paymentButton.setTitle(text, for: .normal)
}
default:

paymentButton.backgroundColor = UIColor.appRed
Expand Down
2 changes: 1 addition & 1 deletion TTCPayDemo/util/TTCSign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import SwiftyRSA
import TTCPay

let TTCPrivateKey_dev = "MIICXgIBAAKBgQCze4k/GOz+AjN053HzLQ9K9bMestBUoBF4Z7uVLxMhj+bo+keCI7X+LI9cPjI0IWmOQM+gY5/qgBnb5Eq4q9NARPh/YtyNQGiuLVtkdl+3lBTHGYY7enaBXG/psC5tFu+/R9GcnTQL8qF1PzKp7Mum19LXZK/hNTQA0ehA+h8JkQIDAQABAoGBAKsvOWD3+hnuqXtnwBQqtvpMy7GM5QzBusf3UD9ircGGCbvN8mQagVtSzs0w+RslfxLRl/Ym7wBve7pxzB7Eq295BJm6kM9iuZ6hY1uVAI1kVxugpHO5i+106NRnVGnXAE2ydfVpw/gsSM/cJl+L8RnlE3fyqagioPMorbFE0zMNAkEA3OyhnGzUTiudfvNI75pK8m0uZriAQ72/OiLhflDMSatBIgpC8Bgl0ikojCh5iPnjnVQCCVf+QeRabOVdxAtZLwJBAM/6hdGQ3iwqdSlH+VoONnjzfbfSAnfOLZGjE/spjwvD0f4R213jKeUMOt8jvxbuXuIGsuV5qczSJacbEV2pmT8CQQDGhVDYKqdAs0qsiFtzC3frjpbSsVp5BOnwiOWOR3a7gEtgFk5+R4S87EVGZRyJLNwPRS0rTkno1hU3o4h1oSj7AkAq7wOa/HXw1h7zk6kU/yQdmd5VCSR7SPO9QdYJHk4qVpVOBq+rVQ67+udYUw/KkxDBRjK+DnyQDL27HmpaVH2PAkEAxIYQAh4zalwTbttZA9wkvGkD9nrWpGNotgysquNCK4taYGxjG6CaybKjFz9U3drquJOtub553BO10jhD0+ZTxA=="
let TTCPrivateKey_dev = "MIICXAIBAAKBgQDm+UWKrZ1+gO3+8UMz4ELR+vsKxRxfH61hBlhIdsTqpCeyxrgyKOfadEITa2qNK5uCXR6Z/8TxMKnqhojE0FgnG9n36J2yz3aAJlG9cQ6kY+1D8dQJoAcTBHIjIOj+6EYcCsfd7P8ChkKjRTF5737azFopmei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xuRT7N8RMibFM2rotZNh9fL27vR5bBbOwNDAkEA09RfOFiajJ1Iy2CSay+ieapqsmMrNQ+kscN57Ym1+SaonctDUWziypDRHGvo+oORIv7b/QUqKT+/acr3Gx1xhwJAZ/zRLJvyU0P875U73CB24L5qxxwHa4UVOhFqSP5raSJCz4KovF+YF5rTYiHEOe7QNbJk5uN2ukSKGsp3GS8s8QJAQa6LK+yFV255oN476FJn3bPSy6dmQVitZ5VGHDpkG3I6PFtHb1sE42yN+nMXVX4wJZrC2aydSxcCIiqV/mldxwJAehcSwqTn4pCy2Qy+xA0JMXQqThKglDioUZJ7pqoZ2cSoje6GTh/vowKNIDXFhL6yff7qFKwikuRwJeGmXy5BnQ=="

Expand Down

0 comments on commit e7cfd9d

Please sign in to comment.