Tag: braintree

我想在我的spree扩展中添加新的javascript文件

我是铁杆新手。 我正在尝试构建Spree扩展以使用Braintree的插入式UI。 我正在尝试将新的braintree.js添加到我的扩展程序中。 这些是我到目前为止所做的步骤。 将/app/assets/javascripts/spree/frontend/添加到/app/assets/javascripts/spree/frontend/ 添加了//= require spree/frontend/braintree到app/assets/javascripts/spree/frontend/.js 。 在/config/initializers/创建了braintree.rb 。 该文件的内容: Braintree::Configuration.environment = :sandbox Braintree::Configuration.merchant_id = “merchant_id” Braintree::Configuration.public_key = “public_key” Braintree::Configuration.private_key = “private_key” 从我的狂欢商店我运行bundle install ,这是成功的。 Ran rails g :install ,它给出了以下错误: append vendor/assets/javascripts/spree/frontend/all.js append vendor/assets/javascripts/spree/backend/all.js insert vendor/assets/stylesheets/spree/frontend/all.css insert vendor/assets/stylesheets/spree/backend/all.css run bundle exec rake railties:install:migrations FROM=spree_hello_ext from “.” Would you like to run the migrations […]

在Spree Store中添加Braintree Drop-in UI时,选择付款方式时出现问题

当客户选择Braintree作为付款方式时,我正在尝试实施扩展以适应braintree的插入式UI。 如果我将braintree js代码添加到_gateway.html.erb中,那么所有其他付款方式都会停止工作。 如果我选择除braintree之外的任何其他方法并单击“保存并继续”,则没有任何反应。 “保存并继续”按钮被禁用。 我已经覆盖了spree / frontend / app / views / spree / checkout / _gateway.html.erb。 ‘credit-card-image’, :class => ‘pull-right’, :width => ‘170’, :height => ’28’ %> * ‘form-control required’} %> * ‘off’} : {} %> ‘card_number’, :class => ‘form-control required cardNumber’, :size => 19, :maxlength => 19, :autocomplete => “off”) %>   […]

这个braintree测试多次购买错误我应该担心什么?

我正在试图弄清楚如何使用braintree进行测试,而我遇到的是带宽错误。 response = ::Braintree::Customer.create(payment_method_nonce: Braintree::Test::Nonce::Transactable) token = response.customer.credit_card.first.token #so far so good response = ::Braintree::Transaction.sale(payment_method_token: token, amount: “1.00”) #still good response = ::Braintree::Transaction.sale(payment_method_token: token, amount: “1.00”) #response is failure # => Braintree::ErrorResult … status: “gateway_rejected” 所有这一切都没有停顿。 如果我再等一下并再次运行销售线,它再次起作用.. 这当然会给测试脚本带来问题。 我可以把与BT的实际连接分开,但我有点担心这个。 我可以做?

paypal v.zero测试nonce失败,没有错误消息

我正在尝试测试paypal v.zero与Braintree ruby​​ gem中提供的测试nonce的集成。 注意 – 遵循paypal集成指南 。 我可以通过手动完成结账流程(输入测试paypal信息,提交订单)生成支付nonce来运行成功的授权,但Braintree提供的测试nonce失败,错误结果不包括任何错误消息“处理器拒绝“。 测试代码: braintree_gateway = Braintree::Gateway.new( access_token: Figaro.env.BRAINTREE_ACCESS_TOKEN ) result = braintree_gateway.transaction.sale( amount: “10.00”, payment_method_nonce: Braintree::Test::Nonce::PayPalOneTimePayment ) 结果: #<Braintree::ErrorResult params:{…} errors: transaction: #<Braintree::Transaction id: "ddz5mc", type: "sale", amount: "10.0", status: "processor_declined", created_at: 2016-04-15 02:55:13 UTC, credit_card_details: #, customer_details: #, subscription_details: #, updated_at: 2016-04-15 02:55:14 UTC>> Braintree测试nonce不应该用于paypal集成方法吗? 如果是这样,有没有人知道另一种方法来生成paypal支付nonces用于测试目的(除了手动完成结账过程)? 提前致谢。

即使在braintree中出错,result.credit_card_verification仍返回nil

我正在使用braintree进行支付处理,我正在尝试使用Ruby从Braintree获取处理器响应代码 。 这是我的代码: verification = result.credit_card_verification response_code = verification.try(:processor_response_code) 即使出现错误,我也会将validation结果为零。 还有其他东西可以获得处理器响应代码吗? 我从这里得到了这个代码 这是我的result.erros: :errors: !ruby/object:Braintree::Errors errors: !ruby/object:Braintree::ValidationErrorCollection errors: [] nested: :customer: !ruby/object:Braintree::ValidationErrorCollection errors: [] nested: :credit_card: !ruby/object:Braintree::ValidationErrorCollection errors: – !ruby/object:Braintree::ValidationError code: ‘81707’ attribute: cvv message: CVV must be 4 digits for American Express and 3 digits for other card types. – !ruby/object:Braintree::ValidationError code: ‘81713’ attribute: […]

检索Braintree客户的订阅

我想收集所有Braintree客户的订阅。 当我浏览网关中的客户页面时,我可以看到他们的订阅,但似乎不存在Braintree::Customer subscriptions方法,或者我可以通过customer_id搜索Braintree::Subscriptions 。 我可以通过迂回的方式访问所有客户的订阅,但它们非常慢。 例如,我可以检索所有客户的事务,并为每个事务获取subscription_id (如果存在),然后检索具有该ID的订阅。 这涉及与Braintree API的大量沟通,我希望有一个更有效的解决方案。 哦,我正在使用rails编程,但问题似乎并不是特定于Rails的。