Class: Renren2::Interface::Pay

Inherits:
Base
  • Object
show all
Defined in:
lib/renren2/interface/pay.rb

Overview

Pay Interface

Instance Method Summary collapse

Methods inherited from Base

#check_scope, #get, #initialize, #post, #request

Constructor Details

This class inherits a constructor from Renren2::Interface::Base

Instance Method Details

#is_completed(order_id) ⇒ Object

查询某个用户在一个应用中一次消费是否完成

Parameters:

  • order_id (int64)

    用户消费校内豆订单号

See Also:



15
16
17
# File 'lib/renren2/interface/pay.rb', line 15

def is_completed(order_id)
  post 'pay.isCompleted', :body => {:order_id => order_id}
end

#query_orders(order_numbers) ⇒ Object

根据订单号查询订单,支持批量查询

Parameters:

  • order_numbers (String)

    订单号,多个订单用逗号隔开

See Also:



37
38
39
# File 'lib/renren2/interface/pay.rb', line 37

def query_orders(order_numbers)
  post 'pay.queryOrders', :body => {:order_numbers => order_numbers}      
end

#reg_order(order_id, amount, desc, opts = {}) ⇒ Object

预存入用户在应用中消费产生的订单数据,消费数额等信息

Parameters:

  • order_id (int64)

    用户消费校内豆订单号,参数必须保证唯一,每一次不能传递相同的参数

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :amount (int)

    校内豆消费数额, 取值范围为

  • :desc (String)

    用户使用校内豆购买的虚拟物品的名称

  • :type (int)

    0代表WEB支付订单,1代表WAP支付订单,默认值为0

See Also:



28
29
30
# File 'lib/renren2/interface/pay.rb', line 28

def reg_order(order_id, amount, desc, opts={})
  post 'pay.regOrder', :body => {:order_id => order_id, :amount => amount, :desc => desc}.merge(opts)
end

#test_is_completed(order_id) ⇒ Object

查询某个用户在一个应用中一次消费是否完成

Parameters:

  • order_id (int64)

    用户消费校内豆订单号

See Also:



46
47
48
# File 'lib/renren2/interface/pay.rb', line 46

def test_is_completed(order_id)
  post 'pay4Test.isCompleted', :body => {:order_id => order_id}
end

#test_reg_order(order_id, amount, desc, opts = {}) ⇒ Object

预存入用户在应用中消费产生的订单数据,消费数额等信息

Parameters:

  • order_id (int64)

    用户消费校内豆订单号,参数必须保证唯一,每一次不能传递相同的参数

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :amount (int)

    校内豆消费数额, 取值范围为

  • :desc (String)

    用户使用校内豆购买的虚拟物品的名称

  • :type (int)

    0代表WEB支付订单,1代表WAP支付订单,默认值为0

See Also:



59
60
61
# File 'lib/renren2/interface/pay.rb', line 59

def test_reg_order(order_id, amount, desc, opts={})
  post 'pay4Test.regOrder', :body => {:order_id => order_id, :amount => amount, :desc => desc}.merge(opts)
end