BrainTree DropIn 信用卡示例
BrainTree DropIn credit card example
我正在尝试使用 DropIn UI.
将 BrainTree 与 ios 集成
我成功显示了UI和我使用测试卡的时候
号码:4111111111111111
截止日期:09/2020
它显示消息
"Please review your information and try again"
let request = BTDropInRequest()
request.amount = "100"
request.paypalDisabled = true
request.shouldMaskSecurityCode = true
let dropIn = BTDropInController(authorization: tokenizationKey, request: request)
{ (controller, result, error) in
if (error != nil) {
print("ERROR = \(error?.localizedDescription ?? "")")
} else if (result?.isCancelled == true) {
print("CANCELLED")
} else if let result = result {
print("Payment Description = \(result.paymentDescription)")
print("paymentOptionType = \(result.paymentOptionType)")
print("paymentMethod = \(result.paymentMethod?.type ?? "")")
print("isCancelled = \(result.isCancelled)")
// Use the BTDropInResult properties to update your UI
// result.paymentOptionType = .
}
controller.dismiss(animated: true, completion: nil)
}
viewController.present(dropIn!, animated: true, completion: nil)
这是我点击添加卡时的日志
-canOpenURL: failed for URL: "com.venmo.touch.v2://x-callback-url/vzero/auth" - error: "This app is not allowed to query for scheme com.venmo.touch.v2"
TIC TCP Conn Failed [25:0x28008b3c0]: 12:8 Err(-65554)
Task .<2> HTTP load failed (error code: -1003 [12:8])
Task .<2> finished with error - code: -1003
TIC TCP Conn Failed [26:0x2800889c0]: 12:8 Err(-65554)
Task <650E9BB8-3AF6-4076-A6C4-977D0435B161>.<5> HTTP load failed (error code: -1003 [12:8])
Task <650E9BB8-3AF6-4076-A6C4-977D0435B161>.<5> finished with error - code: -1003
[BraintreeSDK] WARNING Failed to flush analytics events: A server with the specified hostname could not be found.
当我切换到模拟器时,沙盒似乎无法在真实设备上运行,添加信用卡详细信息后请求成功。
切换到生产环境后仍然存在同样的问题,经过几次尝试,我将 iPhone 设备中的连接从 Wifi 更改为 LTE,并且成功了!看来我的 ISP 没有用于生产 Braintree 后端的 DNS
我正在尝试使用 DropIn UI.
将 BrainTree 与 ios 集成我成功显示了UI和我使用测试卡的时候
号码:4111111111111111
截止日期:09/2020
它显示消息
"Please review your information and try again"
let request = BTDropInRequest()
request.amount = "100"
request.paypalDisabled = true
request.shouldMaskSecurityCode = true
let dropIn = BTDropInController(authorization: tokenizationKey, request: request)
{ (controller, result, error) in
if (error != nil) {
print("ERROR = \(error?.localizedDescription ?? "")")
} else if (result?.isCancelled == true) {
print("CANCELLED")
} else if let result = result {
print("Payment Description = \(result.paymentDescription)")
print("paymentOptionType = \(result.paymentOptionType)")
print("paymentMethod = \(result.paymentMethod?.type ?? "")")
print("isCancelled = \(result.isCancelled)")
// Use the BTDropInResult properties to update your UI
// result.paymentOptionType = .
}
controller.dismiss(animated: true, completion: nil)
}
viewController.present(dropIn!, animated: true, completion: nil)
这是我点击添加卡时的日志
-canOpenURL: failed for URL: "com.venmo.touch.v2://x-callback-url/vzero/auth" - error: "This app is not allowed to query for scheme com.venmo.touch.v2"
TIC TCP Conn Failed [25:0x28008b3c0]: 12:8 Err(-65554)
Task .<2> HTTP load failed (error code: -1003 [12:8])
Task .<2> finished with error - code: -1003
TIC TCP Conn Failed [26:0x2800889c0]: 12:8 Err(-65554)
Task <650E9BB8-3AF6-4076-A6C4-977D0435B161>.<5> HTTP load failed (error code: -1003 [12:8])
Task <650E9BB8-3AF6-4076-A6C4-977D0435B161>.<5> finished with error - code: -1003
[BraintreeSDK] WARNING Failed to flush analytics events: A server with the specified hostname could not be found.
当我切换到模拟器时,沙盒似乎无法在真实设备上运行,添加信用卡详细信息后请求成功。
切换到生产环境后仍然存在同样的问题,经过几次尝试,我将 iPhone 设备中的连接从 Wifi 更改为 LTE,并且成功了!看来我的 ISP 没有用于生产 Braintree 后端的 DNS