Class: Spree::Api::V1::BraintreeClientTokenController
- Inherits:
-
BaseController
- Object
- BaseController
- Spree::Api::V1::BraintreeClientTokenController
- Defined in:
- app/controllers/spree/api/v1/braintree_client_token_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/spree/api/v1/braintree_client_token_controller.rb', line 9 def create gateway = if params[:payment_method_id] Spree::Gateway::BraintreeVzeroBase.find(params[:payment_method_id]) else Spree::Gateway::BraintreeVzeroBase.active.first end render json: { client_token: gateway.client_token(@order, @current_api_user), payment_method_id: gateway.id } end |