我正在尝试自定义接口提供程序 qiwi 这是我的代码:
http = Net::HTTP.new('w.qiwi.com', 443)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
body = {
:bill_id => "BILL-#{payment.id}",
:user => 'tel:' + params[:qiwi][:phone],
:amount => payment.amount,
:ccy => 'RUB',
:comment => "",
:prv_name => 'Company'
}.to_param
key = "Basic " + Base64.encode64s("secret_key")
http.send_request('POST', "/qiwi-notify.php HTTP/1.1", body, {'Accept' => application/xml', 'Authorization' => key})
我需要执行以下操作:
POST /qiwi-notify.php HTTP/1.1
Accept: application/xml
Content-type: application/x-www-form-urlencoded
Authorization: Basic MjA0Mjp0ZXN0Cg==
bill_id=BILL-
1&status=paid&error=0&amount=1.00&user=tel%3A%2B79031811737&prv_nam
e=TEST&ccy=RUB&comment=test&command=bill
Response should XML-doc:
HTTP/1.1 200 OK
Content-Type: text/xml
<?xml version="1.0"?> <result><result_code>0</result_code></result>
如何在下面实现请求 privednny,我的代码不起作用 谢谢