【问题标题】:Braintree vault not storing payment methodsBraintree 保险库不存储付款方式
【发布时间】:2015-09-16 06:01:23
【问题描述】:

我的沙盒帐户没有将客户的付款方式存储在他们的保险库中。我正在使用以下方法创建客户对象:

def create_customer
  result = Braintree::Customer.create(
    :first_name => params[:first_name],
    :last_name => params[:last_name],
    :email => params[:email],
    :phone => params[:phone]
    )
  if result.success?
    render :json => {'result' => result.customer.id}
  else
    render :json => {'errors' => result.errors}, :status => 400
  end
end

然后将customer_id 存储在我的数据库中以供以后使用。

创建 client_token 时,我将相同的 customer_id 发送到 API。下面是创建client_token的代码:

def client_token
  token = Braintree::ClientToken.generate(
    :customer_id => params[:customer_id]
    )
  render :json => {"token" => token}
end

【问题讨论】:

    标签: ios ruby payment-gateway payment braintree


    【解决方案1】:

    我在布伦特里工作。如果您对集成有更多疑问,可以随时get in touch with our support team

    你需要create a payment method从你的客户那里收到的随机数:

    result = Braintree::PaymentMethod.create(
      :customer_id => "131866",
      :payment_method_nonce => nonce_from_the_client
    )
    

    【讨论】:

      猜你喜欢
      • 2018-05-20
      • 2018-05-12
      • 2016-12-17
      • 2018-03-05
      • 1970-01-01
      • 2014-07-11
      • 2017-04-19
      • 2018-05-31
      • 2017-08-17
      相关资源
      最近更新 更多