Module: Spree::Admin::OrdersHelper

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

Instance Method Summary collapse

Instance Method Details

#avs_response_code ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/helpers/spree/admin/orders_helper.rb', line 9

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_code ⇒ Object



40
41
42
43
44
45
46
47
48
49
# File 'app/helpers/spree/admin/orders_helper.rb', line 40

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

#line_item_shipment_price(line_item, quantity) ⇒ Object

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



5
6
7
# File 'app/helpers/spree/admin/orders_helper.rb', line 5

def line_item_shipment_price(line_item, quantity)
  Spree::Money.new(line_item.price * quantity, currency: line_item.currency)
end