Class: App42::Shopping::PaymentStatus

Inherits:
App42Response show all
Defined in:
lib/shopping/PaymentStatus.rb

Constant Summary collapse

DECLINED =
"DECLINED"
AUTHORIZED =
"AUTHORIZED"
PENDING =
"PENDING"

Instance Attribute Summary

Attributes inherited from App42Response

#isResponseSuccess, #strResponse, #totalRecords

Instance Method Summary collapse

Instance Method Details

#enum(string) ⇒ Object

Sets the value of the PaymentStatus. DECLINED or AUTHORIZED or PENDING.

PENDING.

Parameters:

  • string
    • the string of PaymentStatus either DECLINED or AUTHORIZED or



34
35
36
# File 'lib/shopping/PaymentStatus.rb', line 34

def enum(string)
  return PaymentStatus.const_get(string)
end

#isAvailable(string) ⇒ Object

Returns the value of the PaymentStatus. DECLINED or AUTHORIZED or PENDING.

Returns:

  • the value of PaymentStatus.



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/shopping/PaymentStatus.rb', line 46

def isAvailable(string)
  if(string == "DECLINED")
    return "DECLINED"
  elsif(string == "AUTHORIZED")
    return "AUTHORIZED"
  elsif(string == "PENDING")
    return "PENDING";
  else
    return nil
  end
end