Exception: OnlinePayments::SDK::DeclinedPaymentException

Inherits:
DeclinedTransactionException show all
Defined in:
lib/onlinepayments/sdk/declined_payment_exception.rb

Overview

Represents an error response from a create payment call.

Instance Attribute Summary

Attributes inherited from ApiException

#error_id, #errors, #response_body, #status_code

Instance Method Summary collapse

Methods inherited from ApiException

#to_s

Constructor Details

#initialize(status_code, response_body, response) ⇒ DeclinedPaymentException

Create a new DeclinedPaymentException.



13
14
15
16
# File 'lib/onlinepayments/sdk/declined_payment_exception.rb', line 13

def initialize(status_code, response_body, response)
  super(status_code, response_body, response&.error_id, response&.errors, build_message(response))
  @response = response
end

Instance Method Details

#payment_resultOnlinePayments::SDK::Domain::CreatePaymentResponse?

The result of creating a payment



20
21
22
# File 'lib/onlinepayments/sdk/declined_payment_exception.rb', line 20

def payment_result
  @response&.payment_result
end