Class: PaymentRecipes::PayPal::REST::Action::VoidAuthorization

Inherits:
Utils::Action
  • Object
show all
Defined in:
lib/payment_recipes/paypal/rest/action/void_authorization.rb

Instance Method Summary collapse

Methods inherited from Utils::Action

#debug, debug, #ensure_presence, #execute, #failure?, #get, #initialize, #make_instance_variables_available, prepare, rules, #set, #store, #stored_variables, #success?, variable

Constructor Details

This class inherits a constructor from PaymentRecipes::Utils::Action

Instance Method Details

#performObject


8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/payment_recipes/paypal/rest/action/void_authorization.rb', line 8

def perform
  if @authorization.can_be_captured?
    @authorization.raw_authorization.void()

    @authorization.reload!
    @authorization.reload_payment!
  else
    raise Exception, "Authorization can't be voided"
  end

  @authorization  
end