lib/alipay/service.rb in alipay-0.11.0 vs lib/alipay/service.rb in alipay-0.12.0
- old
+ new
@@ -177,9 +177,24 @@
}.merge(params)
Net::HTTP.get(request_uri(params, options))
end
+ BATCH_TRANS_NOTIFY_REQUIRED_PARAMS = %w( notify_url account_name detail_data batch_no batch_num batch_fee email )
+ def self.batch_trans_notify_url(params, options = {})
+ params = Utils.stringify_keys(params)
+ check_required_params(params, BATCH_TRANS_NOTIFY_REQUIRED_PARAMS)
+
+ params = {
+ 'service' => 'batch_trans_notify',
+ '_input_charset' => 'utf-8',
+ 'partner' => options[:pid] || Alipay.pid,
+ 'pay_date' => Time.now.strftime("%Y%m%d")
+ }.merge(params)
+
+ request_uri(params, options).to_s
+ end
+
def self.request_uri(params, options = {})
uri = URI(GATEWAY_URL)
uri.query = URI.encode_www_form(sign_params(params, options))
uri
end