class Portmone::Responses::MobilePay

Constants

CREATED_STATUS
SUCCESS_STATUS

Attributes

response[R]

Public Class Methods

new(faraday_response, currency:, timezone:) click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 7
def initialize(faraday_response, currency:, timezone:)
  @response = faraday_response
  @response_body = JSON.parse(@response.body)
  @currency = currency
  @timezone = timezone
end

Public Instance Methods

acs_url() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 38
def acs_url
  result['actionMPI'] if required_3ds?
end
created?() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 22
def created?
  result['status'] == CREATED_STATUS
end
error_code() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 26
def error_code
  result['errorCode']
end
error_description() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 30
def error_description
  result['error']
end
http_status() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 14
def http_status
  response.status
end
md() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 42
def md
  result['md'] if required_3ds?
end
pa_req() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 46
def pa_req
  result['pareq'] if required_3ds?
end
required_3ds?() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 34
def required_3ds?
  created? && result['isNeed3DS'] == 'Y'
end
shop_bill_id() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 50
def shop_bill_id
  result['shopBillId']
end
success?() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 18
def success?
  result['status'] == SUCCESS_STATUS
end

Private Instance Methods

result() click to toggle source
# File lib/portmone/responses/mobile_pay.rb, line 56
def result
  @result ||= @response_body['result']
end