Module: Paymax1::Charge

Defined in:
lib/paymax1/charge.rb

Class Method Summary collapse

Class Method Details

.createCharge(opts = {}) ⇒ Object

下单接口opts=

 :amount=>'0.01',
:subject=> 'test_subject_nodejs版本',
:body=> 'this is a body',
:order_no=> randomSerize(20),
:channel=> 'alipay_app',
:client_ip=> '127.0.0.1',
:app=> 'app_06m9Q26zL61ee55a',
:currency=> 'cny',
:extra=> {,
:description=> 'this is a description描述'

}



23
24
25
26
27
28
29
# File 'lib/paymax1/charge.rb', line 23

def createCharge (opts={})
  path='/v1/charges'
  data=opts.to_json
  url= Config.settings[:host]+path
  header= Header.new().getHeader('post',path,'',data);
  return  Http.post(url,header,data);
end

.queryCharge(orderNo) ⇒ Object

下单查询接口param orderNo



35
36
37
38
39
40
# File 'lib/paymax1/charge.rb', line 35

def queryCharge (orderNo)
  path='/v1/charges/'+orderNo
  url= Config.settings[:host]+path
  header= Header.new().getHeader('get',path,'','');
  return  Http.get(url,header);
end