Class: MPower::Checkout::Core

Inherits:
Object
  • Object
show all
Includes:
Utilities
Defined in:
lib/mpower/checkout.rb

Direct Known Subclasses

Invoice, DirectCard, DirectMobile, DirectPay

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utilities

#hash_to_json, #http_get_request, #http_json_request, #json_to_hash

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/mpower/checkout.rb', line 5

def description
  @description
end

#invoice_tokenObject

Returns the value of attribute invoice_token.



5
6
7
# File 'lib/mpower/checkout.rb', line 5

def invoice_token
  @invoice_token
end

#response_codeObject

Returns the value of attribute response_code.



5
6
7
# File 'lib/mpower/checkout.rb', line 5

def response_code
  @response_code
end

#response_textObject

Returns the value of attribute response_text.



5
6
7
# File 'lib/mpower/checkout.rb', line 5

def response_text
  @response_text
end

#resultObject

Returns the value of attribute result.



5
6
7
# File 'lib/mpower/checkout.rb', line 5

def result
  @result
end

#statusObject

Returns the value of attribute status.



5
6
7
# File 'lib/mpower/checkout.rb', line 5

def status
  @status
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/mpower/checkout.rb', line 5

def token
  @token
end

#transaction_idObject

Returns the value of attribute transaction_id.



5
6
7
# File 'lib/mpower/checkout.rb', line 5

def transaction_id
  @transaction_id
end

Instance Method Details

#push_results(result = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/mpower/checkout.rb', line 7

def push_results(result={})
  @result = result
  @transaction_id = result["transaction_id"]
  @description = result["description"]
  @response_code = result["response_code"]
  @response_text = result["response_text"]
  @token = result["token"]
  @response_code == "00" ? @status = MPower::SUCCESS : @status = MPower::FAIL
end