Sha256: 80946f17adecc88bdcf86dff721fd5d49e74c0aaa454ff49863e7db569dcfef4

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

class Hws::Connectors::PayoutsController < Hws::Connectors::WebhooksController
  HYPTO_META_RESPONSES = %w(id txn_time created_at txn_type charges_gst settled_amount connected_banking udf1 udf2 udf3 initiated_account_ifsc
va_closing_balance hypto_va_id va_wallet_amount va_settler_id)

  def callback
    Hws::Connectors.logger.debug "===== Hws::Connectors::PayoutsController.callback - Payload: #{params.inspect} ====="
    beneficiary = Hws::Connectors::Dto::AccountDetail
                    .new(name: params['beneficiary_name'], account_number: params['account_number'],
                         account_ifsc: params['account_ifsc'], note: params['note'])
    response = Hws::Connectors::Dto::PayoutResponse
                 .new(reference_number: params['reference_number'], beneficiary: beneficiary, account_holder: params['account_holder'],
                      amount: params['amount'].to_f, payment_type: params['payment_type'], status: params['status'],
                      bank_ref_num: params['bank_ref_num'], txn_time: Time.strptime(params['txn_time'], '%Y-%m-%d %H:%M:%S'),
                      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/payouts_controller.rb
hws-connectors-0.1.0 app/controllers/hws/connectors/payouts_controller.rb