lib/alipay/client.rb in alipay-0.15.0 vs lib/alipay/client.rb in alipay-0.15.1
- old
+ new
@@ -42,17 +42,17 @@
# Generate a query string that use for APP SDK excute.
#
# Example:
#
# alipay_client.sdk_execute(
- # method: 'alipay.trade.page.pay',
+ # method: 'alipay.trade.app.pay',
# biz_content: {
# out_trade_no: '20160401000000',
# product_code: 'QUICK_MSECURITY_PAY',
# total_amount: '0.01',
# subject: 'test'
- # }.to_json,
+ # }.to_json(ascii_only: true),
# timestamp: '2016-04-01 00:00:00'
# )
# # => 'app_id=2016000000000000&charset=utf-8&sig....'
def sdk_execute(params)
params = prepare_params(params)
@@ -62,18 +62,18 @@
# Generate a url that use to redirect user to Alipay payment page.
#
# Example:
#
- # assert_equal url, @client.page_execute_url(
+ # alipay_client.page_execute_url(
# method: 'alipay.trade.page.pay',
# biz_content: {
# out_trade_no: '20160401000000',
# product_code: 'FAST_INSTANT_TRADE_PAY',
# total_amount: '0.01',
# subject: 'test'
- # }.to_json,
+ # }.to_json(ascii_only: true),
# timestamp: '2016-04-01 00:00:00'
# )
# # => 'https://openapi.alipaydev.com/gateway.do?app_id=2016...'
def page_execute_url(params)
params = prepare_params(params)
@@ -86,18 +86,18 @@
# Generate a form string that use to render in view and auto POST to
# Alipay server.
#
# Example:
#
- # assert_equal url, @client.page_execute_form(
+ # alipay_client.page_execute_form(
# method: 'alipay.trade.page.pay',
# biz_content: {
# out_trade_no: '20160401000000',
# product_code: 'FAST_INSTANT_TRADE_PAY',
# total_amount: '0.01',
# subject: 'test'
- # }.to_json,
+ # }.to_json(ascii_only: true),
# timestamp: '2016-04-01 00:00:00'
# )
# # => '<form id='alipaysubmit' name='alipaysubmit' action=...'
def page_execute_form(params)
params = prepare_params(params)
@@ -113,15 +113,15 @@
# Immediately make a API request to Alipay and return response body.
#
# Example:
#
- # @client.execute(
+ # alipay_client.execute(
# method: 'alipay.data.dataservice.bill.downloadurl.query',
# biz_content: {
# bill_type: 'trade',
# bill_date: '2016-04-01'
- # }.to_json
+ # }.to_json(ascii_only: true)
# )
# # => '{ "alipay_data_dataservice_bill_downloadurl_query_response":{...'
def execute(params)
params = prepare_params(params)