Skip to content

Instantly share code, notes, and snippets.

@jamie
Created June 2, 2014 19:08
Show Gist options
  • Select an option

  • Save jamie/549eee23a033eb20f02c to your computer and use it in GitHub Desktop.

Select an option

Save jamie/549eee23a033eb20f02c to your computer and use it in GitHub Desktop.
--- a/app/presenters/transaction_presenter.rb
+++ b/app/presenters/transaction_presenter.rb
@@ -35,7 +35,10 @@ class TransactionPresenter
:prefix => true, :allow_nil => true
def capture_response
- @capture_response ||= CreditCardGatewayRequest.from_transaction_token(token)
+ @capture_response ||= CreditCardGatewayRequest.where(
+ :transaction_token => token,
+ :method => 'capture'
+ ).order_by('amount desc').first
end
delegate :authorization_token, :gateway_token, :to => :capture_response,
:allow_nil => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment