- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
截至 2019 年 7 月的 Braintree SDK 开发人员文档提供了该标准:
let braintreeClient = BTAPIClient(authorization: "<#CLIENT_AUTHORIZATION#>")!
let cardClient = BTCardClient(apiClient: braintreeClient)
let card = BTCard(number: "4111111111111111", expirationMonth: "12", expirationYear: "2018", cvv: nil)
cardClient.tokenizeCard(card) { (tokenizedCard, error) in
// Communicate the tokenizedCard.nonce to your server, or handle error
}
但是当初始化中需要邮政编码时,该类接受 NSDictionary 参数。问题是 key 与 Braintree SDK 属性不匹配
我用过:
let cardParameters: [String: Any] = [number:"4111111111111111",expirationMonth: "12", expirationYear: "2018", cvv: "111", postalCode: "94107"]
let card = BTCard.init(parameters: cardParameters)
The errors say : "Must provide postal code" or "cvv must be provided"
最佳答案
技巧是使用内置属性初始化 BTCard 对象并匹配它们,而不是使用 NSDictionary。所以这有效:
let braintreeClient = BTAPIClient(authorization: "<#CLIENT_AUTHORIZATION#>")!
let cardClient = BTCardClient(apiClient: braintreeClient)
let card = BTCard.init()
card.number = "4111111111111111"
card.expirationMonth = "12"
card.expirationYear = "2018"
card.cvv = "111"
card.postalCode = "94107"
cardClient.tokenizeCard(card) { (tokenizedCard, error) in
// Communicate the tokenizedCard.nonce to your server, or handle error
}
这样 BTCard 对象就会返回可接受的 key ...我花了几个小时尝试不同的方法才得到这个答案。 Braintree 和他们的文档没有提供此示例,但这是对我有用的唯一方法。
(您的每个后端可能会在将数据发送到 Braintree 之前对其进行整理,但这在您集成时会有所帮助)
关于swift - 如何在 BTCard 中设置信用卡可选数据,以便 Braintree 后端在 swift 4 中提供有效 token ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56927610/
我想获得 Braintree 信用卡交易的费用金额。有没有办法得到这个? $fee = $charge->transaction->serviceFeeAmount; 我在看: https://dev
有什么方法可以更改 Braintree javascript 生成的托管字段中的占位符文本颜色?我不认为它是 the options 之一你可以传入构造函数。我们的设计在深色背景上,占位符值不可见。
我目前有兴趣使用 Braintree 从一个服务器使用我目前持有的信用卡凭据向另一个支付服务器付款。 目前,当客户输入他的信用卡详细信息时,Braintree Client SDK 会生成支付随机数。
在进行销售交易之前,如何在保险库中重新验证付款方式 [信用卡]。 注:启用 CVV 和 AVS 规则。 场景是: Braintree 保险库中的客户使用保险库中的付款方式 [信用卡] 进行销售交易。
我没找到refund网络 Hook webhooks list . 是 支付网络 Hook 在这种情况下有什么可以帮助我的https://developers.braintreepayments.co
我正在将 Braintree Drop-in v3 集成到一个带有包的角度应用程序中npm i -save braintree-web-drop-in。 然后我找到了包@types/braintree
脑树的默认api速率限制是多少? 因为在一段时间内的非常多的请求之后,我收到了 403(请求过多)异常。 最佳答案 当与您的帐户关联的请求达到不安全级别时引发。如果事件有对其他商家造成负面影响的风险,
我正在将 braintree 与 python 和 swift 一起使用。谁能告诉我如何在 braintree 中重置重试。我收到这个错误 SSLError: HTTPSConnectionPool(
这一定是简单的事情,但我却抓狂了。当我调用这个时 $data = [ 'amount' => '50.00', 'paymentMethodNonce' => 'fak
这一定是简单的事情,但我却抓狂了。当我调用这个时 $data = [ 'amount' => '50.00', 'paymentMethodNonce' => 'fak
每当我通过 Braintree API 或通过他们的沙箱创建交易时,它都会经历许多状态,例如授权、提交结算、已结算......所有这一切大约需要 24 小时。我想问一下,有没有一种方法可以让我在沙箱/
Closed. This question needs to be more focused 。它目前不接受答案。 想改善这个问题吗?更新问题,使其仅通过 editing this post 关注一个
我们正在经营一家与 Braintree 相连的英国 Magento 商店。几个月来,一切都在顺利运行,但突然之间,我们无法在任何连接到 Braintree Sandbox 的临时或本地测试环境中完成订
是否可以从 Braintree dropin UI 中隐藏 Paypal 按钮?我正在考虑为 Paypal 定制 Paypal 按钮(基于客户需求和设计),并希望使用由 Braintree dropi
我正在从 ActiveMerchant 中实现的网关切换到 Braintree 网关。我注意到 ActiveMerchant 中有一个 braintree 网关,还有 braintree 的 brai
调用 [Braintree braintreeWithClientToken 时出现以下错误。 ViewController.m:21:27: Use of undeclared identifier
我正在使用 ASP.NET MVC 4、.NET Braintree Payments API 和 Braintree.js。 这是我为 Braintree 构建的一个简单包装器: public cl
我正在为一个应用程序开发一个迁移项目,该应用程序使用 PayPal Payments Pro API(具有循环计费)处理计费。对于通知,目前正在使用 PayPal IPN。 该服务目前提供通过 Pay
有一种方法可以获取所有卡片的列表: gateway.creditCard.expiringBetween(year1900, year2100, function (err, result) {...
我正在尝试决定如何处理用户订阅了整个月的情况,假设他们订阅了 6/1,直到 6/31。在月中,他们决定取消订阅 (6/15),但在 6/20,他们决定再次重新开始订阅。如果有的话,这在 Braintr
我是一名优秀的程序员,十分优秀!