-
Notifications
You must be signed in to change notification settings - Fork 141
Capturing payment through spree admin fails (works on paypal) #54
Comments
I am getting this too # in spree app/models/spree/payment/processing.rb
def capture!
protect_from_connection_error do
check_environment
if payment_method.payment_profiles_supported?
# Gateways supporting payment profiles will need access to creditcard object because this stores the payment profile information
# so supply the authorization itself as well as the creditcard, rather than just the authorization code
response = payment_method.capture(self, source, gateway_options)
else
# Standard ActiveMerchant capture usage
#HERE
response = payment_method.capture((amount * 100).round,
response_code,
gateway_options)
end
handle_response(response, :complete, :failure)
end
end # in spree_paypal_express/app/models/spree/paypal_account.rb
def capture(payment)
authorization = find_authorization(payment)
ppx_response = payment.payment_method.provider.capture(amount_in_cents(payment.amount), authorization.params["transaction_id"], :currency => payment.payment_method.preferred_currency)
if ppx_response.success?
record_log payment, ppx_response
payment.complete
else
gateway_error(ppx_response.message)
end
end thanks |
Same issue here, I think: A ArgumentError occurred in payments#fire: wrong number of arguments (3 for 1) |
Same issue for me too. |
Same issue here. @pferdefleisch looks like the paypalaccount#capture is never called by payment_method.capture... I'm investigating now.. |
Same issue. Any news on the PR? |
using code from branch custom '7417b80'. I get following error when capturing a payment |
hi @msevestre, can you be more precise please?
|
I have a lot of customization happening in my site. I will create a new spree site and use the custom branch of the paypal extension to tes that issue again. I'll get back to you asap to let you know if the issue is still present. |
I just created a new site using spree 1.1.1 and commit 7417b80.
ArgumentError in Spree/checkout#paypal_confirm
comparison of Fixnum with nil failed
<div class="row" data-hook="checkout_header">
<h1 class="columns three alpha" data-hook="checkout_title"><%= t(:checkout) %></h1>
<div class="columns thirteen omega" data-hook="checkout_progress"><%= checkout_progress %></div>
</div>
<p> Would be happy to help more but I am not sure how... |
I investigated a bit more to understand what is going on: In spree core we have following code # in spree app/models/spree/payment/processing.rb
def capture!
protect_from_connection_error do
check_environment
if payment_method.payment_profiles_supported?
# ....
response = payment_method.capture(self, source, gateway_options)
else
# Standard ActiveMerchant capture usage
response = payment_method.capture((amount * 100).round,
response_code,
gateway_options)
end
#....
It's all really confusing. One thing is sure. The code from the official extension cannot work. The class PaypalAccount is not used when capturing a payment. I think your implementation using ``Spree::BillingIntegration::PaypalExpressBase` goes in the good direction. |
@msevestre, sorry for the late response and thanks for investigating! I've tested with review checked and it is working for me, but would definitely help to you to find what's wrong with 'comparison of Fixnum with nil failed' |
Same issue for me too. |
I don't know the answer to this one sorry. If someone else can investigate and submit a patch, I can review. |
I'm taking a look at this PR, it appears to be a little more broken by some recent changes in spree but overall has some decent improvements. |
I am getting the same error when capturing the payment from the admin with both Spree::BillingIntegration::PaypalExpress and Spree::BillingIntegration::PaypalExpressUk |
+1 for this. We are running into the original problem up top with the confusion between capture for a Spree::Creditcard object and capture in ActiveSupport. This has gotta be a show-stopper for anyone using 1.1.1. |
The problem at the very top of this list is that capture didn't exist in Creditcard, but does exist in CreditCard. How did it used to work? Anyone using on older gateway, how did you complete payments? |
I've just pushed fixes to 1-1-stable and master, and everything is working for me with a 1.1.2 based stored. I've also fixed the majority of broken specs. Please test and open tickets for anything specific thats still broken. Thanks! |
Thanks for this. |
I am not getting an exception anymore. Thanks! |
Void is still broken, but that is probably a different issue... |
@pferdefleisch Please create a new issue and provide steps to reproduce the issue you're seeing regarding void. Thanks! |
@radar Yeah, sorry about that. I will debug it a bit, later today. |
I thought I should leave a note here for anyone that runs into an issue with "Transaction ID is invalid" after upgrading. It used to be that the authorization was pulled from the log_entries associated with the payment. Later, it was updated to pass the response_code field from the payment itself. The problem occurs if you have older orders that were authorized under the old scheme. The value of response_code will be something like "Success" instead of the auth id. You can fix this by grabbing the authorization from logs. Here's a snippet:
|
Processing my first test orders, using both providors:
Spree::BillingIntegration::PaypalExpress
Spree::BillingIntegration::PaypalExpressUk
Order processes fine, customer returned to spree confirmation page.
Using the 'capture' button in spree admin, error displayed:
However, the payment can be accepted through the paypal interface and solving this is probably beyond my coding ability right now.
If it's working for others, perhaps this is to do with the currency being in GBP but the Sandbox dev account is USD (I don't recall the option to change). When accepting the payment through paypal I had to decide whether to keep in GBP or currency convert to USD.
The text was updated successfully, but these errors were encountered: