Class: ODDB::State::PayPal::Return

Inherits:
Global show all
Defined in:
src/state/paypal/return.rb

Defined Under Namespace

Classes: InvoiceWrapper, ItemWrapper

Constant Summary

VIEW =
View::PayPal::Return

Constants inherited from Global

DIRECT_EVENT, GLOBAL_MAP, HOME_STATE, LIMITED, PRINT_STATES, READONLY_STATES, RESOLVE_STATES, REVERSE_MAP, VIEW, ZONE_NAVIGATION

Constants included from UmlautSort

FILTER_PAIRS

Instance Method Summary (collapse)

Methods inherited from Global

#_search_drugs, #_search_drugs_state, #_trigger, #add_to_interaction_basket, #allowed?, #atc_chooser, #checkout, #clear_interaction_basket, #creditable?, #direct_request_path, #doctorlist, #download, #export_csv, #extend, #fachinfo, #feedbacks, #help_navigation, #home_navigation, #home_state, #hospitallist, #interaction_basket, #limit_state, #limited?, #logout, #navigation, #notify, #password_reset, #powerlink, #print, #proceed_download, #proceed_poweruser, #resolve, #resolve_state, #rss, #search, #show, #snapback_event, #sort, #sponsorlink, #suggest_address, #switch, #unique_email, #user_input, #user_navigation, #ywesee_contact, #zone_navigation, #zones

Methods included from Admin::LoginMethods

#autologin, #login

Methods included from UmlautSort

#sort_model, #umlaut_filter

Instance Method Details

- (Object) back



32
33
34
# File 'src/state/paypal/return.rb', line 32

def back
  @previous.previous if(@previous.respond_to?(:previous))
end

- (Object) init



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'src/state/paypal/return.rb', line 19

def init
  if(@model)
    invoice = @model
    @model = InvoiceWrapper.new(invoice)
    @model.items = invoice.items.values.collect { |item|
      wrap = ItemWrapper.new(item)
      wrap. = invoice.yus_name
      wrap.oid = invoice.oid
      wrap
    }
  end
  super
end

- (Object) paypal_return



35
36
37
38
39
40
41
42
# File 'src/state/paypal/return.rb', line 35

def paypal_return
  if(@model && @model.types.all? { |type| type  == :poweruser } \
    && @model.payment_received? && (des = @session.desired_state))
    des
  else
    self
  end
end