Class: CmbPay::RefundOrderMessage
- Inherits:
-
Object
- Object
- CmbPay::RefundOrderMessage
- Defined in:
- lib/cmb_pay/message/refund_order_message.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#bank_seq_no ⇒ Object
readonly
Returns the value of attribute bank_seq_no.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#raw_http_response ⇒ Object
readonly
Returns the value of attribute raw_http_response.
-
#refund_no ⇒ Object
readonly
Returns the value of attribute refund_no.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(http_response) ⇒ RefundOrderMessage
constructor
A new instance of RefundOrderMessage.
- #succeed? ⇒ Boolean
Constructor Details
#initialize(http_response) ⇒ RefundOrderMessage
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 12 def initialize(http_response) @raw_http_response = http_response return unless http_response.code == 200 document_root = REXML::Document.new(http_response.body.to_s).root head = document_root.elements['Head'] @code = head.elements['Code'].text = head.elements['ErrMsg'].text return unless succeed? body = document_root.elements['Body'] @refund_no = body.elements['RefundNo'].text @bank_seq_no = body.elements['BankSeqNo'].text @amount = body.elements['Amount'].text @date = body.elements['Date'].text @time = body.elements['Time'].text end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
5 6 7 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 5 def amount @amount end |
#bank_seq_no ⇒ Object (readonly)
Returns the value of attribute bank_seq_no.
5 6 7 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 5 def bank_seq_no @bank_seq_no end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 5 def code @code end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
5 6 7 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 5 def date @date end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
5 6 7 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 5 def end |
#raw_http_response ⇒ Object (readonly)
Returns the value of attribute raw_http_response.
5 6 7 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 5 def raw_http_response @raw_http_response end |
#refund_no ⇒ Object (readonly)
Returns the value of attribute refund_no.
5 6 7 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 5 def refund_no @refund_no end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
5 6 7 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 5 def time @time end |
Instance Method Details
#succeed? ⇒ Boolean
30 31 32 |
# File 'lib/cmb_pay/message/refund_order_message.rb', line 30 def succeed? code.nil? && .nil? end |