ios - Braintree vault not storing payment methods -
my sandbox account doesn't store payment methods customer in vault. creating customer object using:
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
and storing customer_id
in database later use.
when creating client_token sending same customer_id
api. here code creating client_token:
def client_token token = braintree::clienttoken.generate( :customer_id => params[:customer_id] ) render :json => {"token" => token} end
i work @ braintree. if have more questions integration, can get in touch our support team
you need create payment method nonce receive client:
result = braintree::paymentmethod.create( :customer_id => "131866", :payment_method_nonce => nonce_from_the_client )
Comments
Post a Comment