-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error When Trying to Cancel Order in Dev Mode #91
Comments
Getting the same error as well. The issue is in
From here on I'm confused on how to add a customized |
There's already a method on the gateway called We should probably alias the |
It appears this issue was never fixed. Due to updates in spree it now raises a NotImplementedError for cancel. I couldn't find where the refund method is actually used. Could we just rework it into a cancel method? |
👍 |
We would appreciate a fix for this issue because canceling orders paid via PayPal is impossible like this :-( |
👍 |
+1 The site I'm running into this issue w/ is pretty low volume and PayPal is our only PaymentMethod, so I just modified the controller to display an error telling the user to cancel the payment manually in PayPal and added an empty Part of the problem is that PayPalExpress stores the transaction ID in the payment.source and the response code is nil on the payment. I can fix this, but don't have the time right now unless someone wanted to hire me for an hour or 2. My hack: Spree::Gateway::PayPalExpress.class_eval do
def credit(credit_cents, response_code, gateway_options)
# TODO: this should use the `refund` method, but it needs some work.
# Doing nothing for now to prevent an error and allow orders to be cancelled.
OpenStruct.new(success?:true,warning:'PayPal credit method not implemented, make sure payments are cancelled manually')
end
end orders_controller_decorator.rb Spree::Admin::OrdersController.class_eval do
def cancel
@order.cancel!
flash[:error] = 'Order cancelled - You must cancel the payment in PayPal manually!'
redirect_to :back
end
end |
As it appears this still hasn't been fixed I'm taking a stab at my own implementation. I'll update if it works. if seeing this post revitalized reminds anyone of a proper fix for this that they've seen in the interim, please post it here. |
Thanks @imme5150, your solution was exactly what I needed to address my use case! |
I'm receiving an error when I click the "Cancel" button on a completed order, made through a Paypal sandbox account. I've tried removing
gem 'spree_gateway'
andgem 'activemerchant'
just in case there was a weird conflict withgem 'spree_paypal_express'
.Error:
Gemfile:
Trace:
The text was updated successfully, but these errors were encountered: