mobile.securitypay.pay
Alipay::Mobile::Service.mobile_securitypay_pay_string({ARGUMENTS}, {OPTIONS})
Alipay::Mobile::Service.mobile_securitypay_pay_string( out_trade_no: '20150401000-0001', notify_url: 'https://example.com/orders/20150401000-0001/notify' subject: 'subject', total_fee: '10.00', body: 'text' )
没有。我 clone 过 rei 这个修改过,没有弄完,近期没有支付需求要做。你可以先 clone 下来自己改改,或者将就用用支付宝废弃的接口。
目前参数
Alipay.key = Base64.decode64(privatekey)
Alipay.pid = "#{result[:partner]}"
Alipay.sign_type = 'RSA'
content = Alipay::Mobile::Service.mobile_securitypay_pay_string(
seller_id: "#{result[:seller_id]}",
out_trade_no: "#{result[:out_trade_no]}",
subject: "#{result[:subject]}",
body: "#{result[:body]}",
total_fee: "#{result[:total_fee]}",
notify_url: "#{result[:notify_url]}",
it_b_pay: "#{result[:it_b_pay]}",
sign_type: "#{result[:sign_type]}"
)
Alipay.key = Base64.decode64(privatekey)
Alipay.pid = "#{result[:partner]}"
Alipay.sign_type = 'RSA'
content = Alipay::Mobile::Service.mobile_securitypay_pay_string(
seller_id: "#{result[:seller_id]}",
out_trade_no: "#{result[:out_trade_no]}",
subject: "#{result[:subject]}",
body: "#{result[:body]}",
total_fee: "#{result[:total_fee]}",
notify_url: "#{result[:notify_url]}",
it_b_pay: "#{result[:it_b_pay]}",
sign_type: "#{result[:sign_type]}"
)
文档写的就是最简例子 https://github.com/chloerei/alipay#mobileservice
你为什么要把 privatekey decode64?
私钥是要pkcs8还是要pkcs1,你看我下面写的可以用吗
Alipay.key = File.read("#{Rails.root}/rsa_private_key_1.pem")
Alipay.pid = "#{result[:partner]}"
Alipay.sign_type = 'RSA'
content = Alipay::Mobile::Service.mobile_securitypay_pay_string(
seller_id: "#{result[:seller_id]}",
out_trade_no: "#{result[:out_trade_no]}",
subject: "#{result[:subject]}",
body: "#{result[:body]}",
total_fee: "#{result[:total_fee]}",
notify_url: "#{result[:notify_url]}",
it_b_pay: "#{result[:it_b_pay]}",
show_url: "#{result[:show_url]}",
sign_type: "#{result[:sign_type]}"
)