简体   繁体   English

我遇到了 TAP 付款问题

[英]I am getting issue with TAP Payment

I have integrated tap payment method in my swift code but it not working please guide if i miss something我在我的 swift 代码中集成了水龙头付款方式,但它不起作用,如果我错过了什么,请指导

here is my code这是我的代码

**AppDelegate didFinishLaunchingWithOptions ** **AppDelegate didFinishLaunchingWithOptions **

    let secretKey = SecretKey(sandbox: "my key", production: "my key")
    GoSellSDK.secretKey = secretKey

After Click on button it nothing happens not showing tap payment view controller View Controller单击按钮后,没有任何反应没有显示点击支付视图控制器视图控制器

let session = Session()
session.dataSource = self
session.delegate = self


@IBAction func btnCheckout(_ sender: UIButton) {

         SVProgressHUD.show()
         session.start()

    }

Session Delegate Methods会话委托方法

    //TAP Payment

internal func paymentSucceed(_ charge: Charge, on session: SessionProtocol) {

    // payment succeed, saving the customer for reuse.

    if (charge.receiptSettings?.identifier) != nil {

        print(charge.transactionDetails.authorizationID!)
        print(charge.receiptSettings!.identifier!)


    }
}

internal func paymentFailed(with charge: Charge?, error: TapSDKError?, on session: SessionProtocol) {


    print("Error :: ",error?.localizedDescription)

}

internal func authorizationSucceed(_ authorize: Authorize, on session: SessionProtocol) {

    // authorization succeed, saving the customer for reuse.

    if let customerID = authorize.customer.identifier {



    }
}
func authorizationFailed(with authorize: Authorize?, error: TapSDKError?, on session: SessionProtocol)

{
    SVProgressHUD.dismiss()
    print("Error authorizationFailed:: ",error?.localizedDescription)

}


func sessionIsStarting(_ session: SessionProtocol)
{

    print("sessionIsStarting")

}


func sessionHasStarted(_ session: SessionProtocol)
{
    print("sessionHasStarted")

}

func sessionHasFailedToStart(_ session: SessionProtocol)
{
    print("sessionHasFailedToStart")
    SVProgressHUD.dismiss()

}

func sessionCancelled(_ session: SessionProtocol)
{
    print("sessionCancelled")
    SVProgressHUD.dismiss()
}

Session DataSource会话数据源

// MARK: - SessionDataSource // 标记:- SessionDataSource

extension PaymentMethodsVC: SessionDataSource {


var currency: Currency? {

    return .with(isoCode: "KWD")
}


var amount: Decimal {

    let amount = 5.99

    return Decimal(amount)
}

var mode: TransactionMode {

    return .purchase
}

var customer: Customer? {

    //        if customerIDIsKnown {
    //
    //            return self.identifiedCustomer
    //        }
    //        else {

    return self.newCustomer
    //        }
}

/// Creating a customer with raw information.
var newCustomer: Customer? {

    let emailAddress = try! EmailAddress(emailAddressString: "customer@mail.com")
    let phoneNumber = try! PhoneNumber(isdNumber: "965", phoneNumber: "96512345")

    return try? Customer(emailAddress:  emailAddress,
                         phoneNumber:   phoneNumber,
                         firstName:     "Steve",
                         middleName:    nil,
                         lastName:      "Jobs")
}


var postURL: URL? {

    return URL(string: "https://tap.company/post")
}

var paymentDescription: String? {

    return "Awesome payment description will be here.";
}

}

If you want to test in sandbox environment add this in **AppDelegate didFinishLaunchingWithOptions **如果你想在沙箱环境中测试,在 **AppDelegate didFinishLaunchingWithOptions **

let secretKey = SecretKey(sandbox: "my key", production: "my key")
GoSellSDK.secretKey = secretKey
GoSellSDK.mode = .sandbox

I got same issue , i wrote following code.我遇到了同样的问题,我写了以下代码。

let secretKey = SecretKey(sandbox: "my key", production: "my key")
GoSellSDK.secretKey = secretKey
GoSellSDK.mode = .production

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Swift Package Manager时出现问题 - I am getting an issue while using swift package manager 在React Native for iOS中,我遇到了ART Lib问题 - In react native for ios i am getting ART Lib issue 当我在IOS中集成CCAvenue付款门方式时,我得到Exe_Bad_Access(code = 1 address = 0X38) - I am getting Exe_Bad_Access(code=1 address=0X38) when I am integrating the CCAvenue Payment Gate way in IOS 当我从iOS 10中的BrainTree付款页面点击Paypal时打开空白页面 - Blank page open when I tap on Paypal from BrainTree payment page in iOS 10 我正在尝试为 Apple Pay 支付处理创建一个基类 - I am trying to create a base class for Apple Pay payment processing 比较速度值问题(我从CLLocationManager得到的信息) - Comparing speed values issue(what ever i am getting from CLLocationManager) 每次我重新点击文本字段时,视图都会发生变化 - View is getting shifted every time I re-tap textfield 为什么我会收到NSUnkownKeyException? - Why am I getting NSUnkownKeyException? 我有内存泄漏吗? - Am I getting memory leak ? UITableViewCell中的UIButton是Tappable(获取适当的事件),但问题是点击效果不可见 - UIButton within UITableViewCell is Tappable(Getting proper event) But the issue is tap effect is not visible
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM