Class: DefraRubyGovpay::Payment

Inherits:
Object
  • Object
show all
Defined in:
lib/defra_ruby_govpay/payment.rb

Overview

The Payment class represents a payment object in the Govpay Integration. It contains methods to check refund status and details about the payment.

Instance Method Summary collapse

Methods inherited from Object

#initialize, #nil_value?, #string_reader, #to_ostruct

Constructor Details

This class inherits a constructor from DefraRubyGovpay::Object

Instance Method Details

#refundObject



13
14
15
# File 'lib/defra_ruby_govpay/payment.rb', line 13

def refund
  refund_summary
end

#refundable?(amount_requested = 0) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
# File 'lib/defra_ruby_govpay/payment.rb', line 7

def refundable?(amount_requested = 0)
  refund.status == "available" &&
    refund.amount_available > refund. &&
    amount_requested <= refund.amount_available
end