Module: Spree::Admin::OrdersHelper

Defined in:
app/helpers/spree/admin/orders_helper.rb

Instance Method Summary collapse

Instance Method Details

#avs_response_codeHash

Addresss Verification System response code

Returns:

  • (Hash)

    codes as keys, descriptions as values

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'app/helpers/spree/admin/orders_helper.rb', line 30

def avs_response_code
  {
    "A" => "Street address matches, but 5-digit and 9-digit postal code do not match.",
    "B" => "Street address matches, but postal code not verified.",
    "C" => "Street address and postal code do not match.",
    "D" => "Street address and postal code match. ",
    "E" => "AVS data is invalid or AVS is not allowed for this card type.",
    "F" => "Card member's name does not match, but billing postal code matches.",
    "G" => "Non-U.S. issuing bank does not support AVS.",
    "H" => "Card member's name does not match. Street address and postal code match.",
    "I" => "Address not verified.",
    "J" => "Card member's name, billing address, and postal code match.",
    "K" => "Card member's name matches but billing address and billing postal code do not match.",
    "L" => "Card member's name and billing postal code match, but billing address does not match.",
    "M" => "Street address and postal code match. ",
    "N" => "Street address and postal code do not match.",
    "O" => "Card member's name and billing address match, but billing postal code does not match.",
    "P" => "Postal code matches, but street address not verified.",
    "Q" => "Card member's name, billing address, and postal code match.",
    "R" => "System unavailable.",
    "S" => "Bank does not support AVS.",
    "T" => "Card member's name does not match, but street address matches.",
    "U" => "Address information unavailable. Returned if the U.S. bank does not support non-U.S. AVS or if the AVS in a U.S. bank is not functioning properly.",
    "V" => "Card member's name, billing address, and billing postal code match.",
    "W" => "Street address does not match, but 9-digit postal code matches.",
    "X" => "Street address and 9-digit postal code match.",
    "Y" => "Street address and 5-digit postal code match.",
    "Z" => "Street address does not match, but 5-digit postal code matches."
  }
end

#cvv_response_codeHash

Addresss Verification System response code



68
69
70
71
72
73
74
75
76
77
# File 'app/helpers/spree/admin/orders_helper.rb', line 68

def cvv_response_code
  {
    "M" => "CVV2 Match",
    "N" => "CVV2 No Match",
    "P" => "Not Processed",
    "S" => "Issuer indicates that CVV2 data should be present on the card, but the merchant has indicated data is not present on the card",
    "U" => "Issuer has not certified for CVV2 or Issuer has not provided Visa with the CVV2 encryption keys",
    ""  => "Transaction failed because wrong CVV2 number was entered or no CVV2 number was entered"
  }
end

Renders all the extension partials that may have been specified in the extensions

Returns:

  • (ActiveSupport::SafeBuffer)

    the string returned is already html-safe



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/helpers/spree/admin/orders_helper.rb', line 9

def event_links
  links = []
  @order_events.sort.each do |event|
    next unless @order.send("can_#{event}?")

    translated_event = t(event, scope: [:spree, :admin, :order, :events])
    links << button_to(
      translated_event,
      [event.to_sym, :admin, @order],
      method: :put,
      data: { confirm: t(:order_sure_want_to, event: translated_event, scope: :spree) }
    )
  end
  safe_join(links, "&nbsp;".html_safe)
end