diff --git a/app/controllers/solidus_paypal_braintree/checkouts_controller.rb b/app/controllers/solidus_paypal_braintree/checkouts_controller.rb index 80717ad0..fb0c9ef9 100644 --- a/app/controllers/solidus_paypal_braintree/checkouts_controller.rb +++ b/app/controllers/solidus_paypal_braintree/checkouts_controller.rb @@ -11,9 +11,13 @@ class SolidusPaypalBraintree::CheckoutsController < Spree::CheckoutController ].freeze def update - @order.payments.create!(payment_params) + @payment = Spree::PaymentCreate.new(@order, payment_params).build - render text: 'ok' + if @payment.save + render text: "ok" + else + render text: "not-ok" + end end def order_params