Sha256: 4df01776969a0cac5275594ed23413c23978ab58c89f78d43ce9c750e985305f

Contents?: true

Size: 776 Bytes

Versions: 3

Compression:

Stored size: 776 Bytes

Contents

class Ipizza::PaymentResponse < Ipizza::Response

  def success?
    %w(1111).include?(@params['VK_SERVICE'])
  end
  
  def valid?
    @valid
  end
  
  def automatic_message?
    @params['VK_AUTO'] == 'Y'
  end
  
  def payment_info
    @payment_info ||= Ipizza::Payment.new(
      provider: @params['VK_SND_ID'],
      stamp: @params['VK_STAMP'],
      amount: @params['VK_AMOUNT'],
      currency: @params['VK_CURR'],
      refnum: @params['VK_REF'],
      message: @params['VK_MSG'],
      transaction_id: @params['VK_T_NO'],
      receiver_account: @params['VK_REC_ACC'],
      receiver_name: @params['VK_REC_NAME'],
      sender_account: @params['VK_SND_ACC'],
      sender_name: @params['VK_SND_NAME'],
      transaction_time: @params['VK_T_DATETIME']
    )
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ipizza-2.1.0 lib/ipizza/payment_response.rb
ipizza-2.0.1 lib/ipizza/payment_response.rb
ipizza-2.0.0 lib/ipizza/payment_response.rb