Sha256: a064aae613e45ec4b321851cc3d81449bf65a0fe8111b2bb34d09d259fe1f058

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

class Hws::Connectors::VirtualAccountsController < Hws::Connectors::WebhooksController
  HYPTO_META_RESPONSES = %w(id va_closing_balance va_settler_id charges_gst settled_amount txn_time created_at hypto_va_id va_wallet_amount va_lien_amount)

  def notify
    Hws::Connectors.logger.debug "===== Hws::Connectors::VirtualAccountsController.notify - Payload: #{params.inspect} ====="
    beneficiary = Hws::Connectors::Dto::AccountDetail.new(account_number: params['bene_account_no'], account_ifsc: params['bene_account_ifsc'])
    remitter = Hws::Connectors::Dto::AccountDetail.new(account_number: params['rmtr_account_no'], account_ifsc: params['rmtr_account_ifsc'],
                                                       note: params['rmtr_to_bene_note'], name: params['rmtr_full_name'])

    response = Hws::Connectors::Dto::CreditVirtualAccountResponse
                 .new(credit_time: Time.strptime(params['credited_at'], '%Y-%m-%d %H:%M:%S'), beneficiary: beneficiary, remitter: remitter, amount: params['amount'].to_f,
                      payment_type: params['payment_type'], bank_ref_num: params['bank_ref_num'], meta: params.as_json.slice(*HYPTO_META_RESPONSES))
    render_response(response)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hws-connectors-0.1.1 app/controllers/hws/connectors/virtual_accounts_controller.rb
hws-connectors-0.1.0 app/controllers/hws/connectors/virtual_accounts_controller.rb