Reputation: 1734
I am trying to use ActiveMerchant with Braintree Dropin UI and I am unable to find the correct methods to create the client token to pass to the JavaScript SDK. My current setup is:
# config/environments/development.rb
# ActiveMerchant configuration.
ActiveMerchant::Billing::Base.mode = :test
config.gateway = ActiveMerchant::Billing::BraintreeGateway.new(
merchant_id: '',
public_key: '',
private_key: ''
)
And I have a controller that needs to send back a client token as part of an API request:
# app/controllers/v1/orders_controller.rb
def token
@client_token = ...GENERATE CLIENT TOKEN...
respond_with @client_token
end
I just don't know how to generate this token through the ActiveMerchant API.
Upvotes: 3
Views: 175
Reputation: 176780
I work at Braintree. If you have more questions, I suggest you email our support team.
ActiveMerchant currently isn't compatible with v.zero. To use the Drop-In UI or any other v.zero features, you'll need to use the Braintree ruby client library directly. See the Braintree "Getting Started" Guide for instructions.
Upvotes: 1