Class: Newebpay::Response
- Inherits:
-
Object
- Object
- Newebpay::Response
- Defined in:
- lib/newebpay/response.rb
Instance Attribute Summary collapse
-
#atm_pay_bank_code ⇒ Object
readonly
Returns the value of attribute atm_pay_bank_code.
-
#atm_payer_account_last_five_code ⇒ Object
readonly
Returns the value of attribute atm_payer_account_last_five_code.
-
#auth_bank ⇒ Object
readonly
Returns the value of attribute auth_bank.
-
#card_number_first_six_code ⇒ Object
readonly
Returns the value of attribute card_number_first_six_code.
-
#card_number_last_four_code ⇒ Object
readonly
Returns the value of attribute card_number_last_four_code.
-
#escrow_bank ⇒ Object
readonly
Returns the value of attribute escrow_bank.
-
#inst ⇒ Object
readonly
Returns the value of attribute inst.
-
#inst_each_price ⇒ Object
readonly
Returns the value of attribute inst_each_price.
-
#inst_first_price ⇒ Object
readonly
Returns the value of attribute inst_first_price.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#paid_at ⇒ Object
readonly
Returns the value of attribute paid_at.
-
#pay_way ⇒ Object
readonly
Returns the value of attribute pay_way.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#trade_number ⇒ Object
readonly
Returns the value of attribute trade_number.
Instance Method Summary collapse
-
#initialize(data) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Response
Returns a new instance of Response.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/newebpay/response.rb', line 13 def initialize(data) response = AES::Cryptographic.new(data['TradeInfo']).decrypt @status = response['Status'] @message = response['Message'] @result = response['Result'] @order_number = @result['MerchantOrderNo'] @trade_number = @result['TradeNo'] @ip = @result['IP'] @card_number_first_six_code = @result['Card6No'] @card_number_last_four_code = @result['Card4No'] @escrow_bank = @result['EscrowBank'] @auth_bank = @result['AuthBank'] @pay_way = @result['PaymentType'] @inst = @result['Inst'] @inst_first_price = @result['InstFirst'] @inst_each_price = @result['InstEach'] @atm_pay_bank_code = @result['PayBankCode'] @atm_payer_account_last_five_code = @result['PayerAccount5Code'] @paid_at = @result['PayTime'] end |
Instance Attribute Details
#atm_pay_bank_code ⇒ Object (readonly)
Returns the value of attribute atm_pay_bank_code.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def atm_pay_bank_code @atm_pay_bank_code end |
#atm_payer_account_last_five_code ⇒ Object (readonly)
Returns the value of attribute atm_payer_account_last_five_code.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def atm_payer_account_last_five_code @atm_payer_account_last_five_code end |
#auth_bank ⇒ Object (readonly)
Returns the value of attribute auth_bank.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def auth_bank @auth_bank end |
#card_number_first_six_code ⇒ Object (readonly)
Returns the value of attribute card_number_first_six_code.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def card_number_first_six_code @card_number_first_six_code end |
#card_number_last_four_code ⇒ Object (readonly)
Returns the value of attribute card_number_last_four_code.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def card_number_last_four_code @card_number_last_four_code end |
#escrow_bank ⇒ Object (readonly)
Returns the value of attribute escrow_bank.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def escrow_bank @escrow_bank end |
#inst ⇒ Object (readonly)
Returns the value of attribute inst.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def inst @inst end |
#inst_each_price ⇒ Object (readonly)
Returns the value of attribute inst_each_price.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def inst_each_price @inst_each_price end |
#inst_first_price ⇒ Object (readonly)
Returns the value of attribute inst_first_price.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def inst_first_price @inst_first_price end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def ip @ip end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def @message end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def order_number @order_number end |
#paid_at ⇒ Object (readonly)
Returns the value of attribute paid_at.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def paid_at @paid_at end |
#pay_way ⇒ Object (readonly)
Returns the value of attribute pay_way.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def pay_way @pay_way end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def result @result end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def status @status end |
#trade_number ⇒ Object (readonly)
Returns the value of attribute trade_number.
9 10 11 |
# File 'lib/newebpay/response.rb', line 9 def trade_number @trade_number end |
Instance Method Details
#success? ⇒ Boolean
35 36 37 |
# File 'lib/newebpay/response.rb', line 35 def success? status === 'SUCCESS' end |