Sha256: 273c853050530835534be269f91e1a2155ea04f08b037c9c041de2f68bf9a5b9

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

# coding: utf-8

# 4.2.13 商户余额查询

module ChanPay
  module Api
    module QueryBalance

      SERVICE_NAME = 'cjt_dsf'

      # 商户余额查询
      #
      # @param flow_id [String] 订单号(需要保证唯一)
      #
      # @return [Hash] 返回结果集
      #
      def query_balance(flow_id)
        params = {
          :TransCode => 'C00005',
          :OutTradeNo => flow_id,
        }

        response = Http.post(@partner_id, @private_key, @public_key, @server_uri, SERVICE_NAME, params)

        {
          result: response[:AcceptStatus],
          balance: response[:RecBalance].to_f,
        }
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chan_pay-0.3.0 lib/chan_pay/api/query_balance.rb
chan_pay-0.2.0 lib/chan_pay/api/query_balance.rb