class SolidusPaypalBraintree::CheckoutsController

Constants

PERMITTED_PAYMENT_PARAMS

Public Instance Methods

payment_params() click to toggle source
# File lib/controllers/frontend/solidus_paypal_braintree/checkouts_controller.rb, line 23
def payment_params
  params.
    require(:order).
    require(:payments_attributes).
    first.
    permit(PERMITTED_PAYMENT_PARAMS)
end
update() click to toggle source
# File lib/controllers/frontend/solidus_paypal_braintree/checkouts_controller.rb, line 13
def update
  @payment = ::Spree::PaymentCreate.new(@order, payment_params).build

  if @payment.save
    render plain: "ok"
  else
    render plain: "not-ok"
  end
end