支付的支付接口应该是POST方式的,可是它文档的例子中给出的HTTP请求居然数据是放在URL里面的,而且没有编码,说不通啊?
https://openapi.alipay.com/gateway.do?timestamp=2013-01-01 08:08:08&method=alipay.trade.pay&app_id=2651&sign_type=RSA2&sign=ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE&version=1.0&biz_content=
  {
    "out_trade_no":"20150320010101001",
    "scene":"bar_code,wave_code",
    "auth_code":"28763443825664394",
    "product_code":"FACE_TO_FACE_PAYMENT",
    "subject":"Iphone6 16G",
    "buyer_id":"2088202954065786",
    "seller_id":"2088102146225135",
    "total_amount":88.88,
    "discountable_amount":8.88,
    "undiscountable_amount":80.00,
    "body":"Iphone6 16G",
      "goods_detail":[{
                "goods_id":"apple-01",
        "alipay_goods_id":"20010001",
        "goods_name":"ipad",
        "quantity":1,
        "price":2000,
        "goods_category":"34543238",
        "body":"特价手机",
        "show_url":"http://www.alipay.com/xxx.jpg"
        }],
    "operator_id":"yx_001",
    "store_id":"NJ_001",
    "terminal_id":"NJ_T_001",
    "alipay_store_id":"2016041400077000000003314986",
    "extend_params":{
      "sys_service_provider_id":"2088511833207846",
      "hb_fq_num":"3",
      "hb_fq_seller_percent":"100"
    },
    "timeout_express":"90m",
    "royalty_info":{
      "royalty_type":"ROYALTY",
        "royalty_detail_infos":[{
                    "serial_no":1,
          "trans_in_type":"userId",
          "batch_no":"123",
          "out_relation_id":"20131124001",
          "trans_out_type":"userId",
          "trans_out":"2088101126765726",
          "trans_in":"2088101126708402",
          "amount":0.1,
          "desc":"分账测试1",
          "amount_percentage":"100"
          }]
    },
    "sub_merchant":{
      "merchant_id":"19023454"
    },
    "disable_pay_channels":"credit_group",
    "auth_no":"2016110310002001760201905725",
    "ext_user_info":{
      "name":"李明",
      "mobile":"16587658765",
      "cert_type":"IDENTITY_CARD",
      "cert_no":"362334768769238881"
    }
  }
 
//为确保安全通信,需自行验证响应示例中的sign值是否为蚂蚁金服所提供。

解决方案 »

  1.   


    curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Cache-Control: no-cache" -H "Postman-Token: faa49e51-dad5-5b2e-b9a9-40558f3f318b" -F "test=value" "https://openapi.alipay.com/gateway.do?timestamp=2013-01-01%2008:08:08&method=alipay.trade.pay&app_id=2651&sign_type=RSA2&sign=ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE&version=1.0&biz_content=%20%20%20{%20%20%20%20%20%22out_trade_no%22:%2220150320010101001%22%2C%20%20%20%20%20%22scene%22:%22bar_code%2Cwave_code%22%2C%20%20%20%20%20%22auth_code%22:%2228763443825664394%22%2C%20%20%20%20%20%22product_code%22:%22FACE_TO_FACE_PAYMENT%22%2C%20%20%20%20%20%22subject%22:%22Iphone6%2016G%22%2C%20%20%20%20%20%22buyer_id%22:%222088202954065786%22%2C%20%20%20%20%20%22seller_id%22:%222088102146225135%22%2C%20%20%20%20%20%22total_amount%22:88.88%2C%20%20%20%20%20%22discountable_amount%22:8.88%2C%20%20%20%20%20%22undiscountable_amount%22:80.00%2C%20%20%20%20%20%22body%22:%22Iphone6%2016G%22%2C%20%20%20%20%20%20%20%22goods_detail%22:[{%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22goods_id%22:%22apple-01%22%2C%20%20%20%20%20%20%20%20%20%22alipay_goods_id%22:%2220010001%22%2C%20%20%20%20%20%20%20%20%20%22goods_name%22:%22ipad%22%2C%20%20%20%20%20%20%20%20%20%22quantity%22:1%2C%20%20%20%20%20%20%20%20%20%22price%22:2000%2C%20%20%20%20%20%20%20%20%20%22goods_category%22:%2234543238%22%2C%20%20%20%20%20%20%20%20%20%22body%22:%22%E7%89%B9%E4%BB%B7%E6%89%8B%E6%9C%BA%22%2C%20%20%20%20%20%20%20%20%20%22show_url%22:%22http://www.alipay.com/xxx.jpg%22%20%20%20%20%20%20%20%20%20}]%2C%20%20%20%20%20%22operator_id%22:%22yx_001%22%2C%20%20%20%20%20%22store_id%22:%22NJ_001%22%2C%20%20%20%20%20%22terminal_id%22:%22NJ_T_001%22%2C%20%20%20%20%20%22alipay_store_id%22:%222016041400077000000003314986%22%2C%20%20%20%20%20%22extend_params%22:{%20%20%20%20%20%20%20%22sys_service_provider_id%22:%222088511833207846%22%2C%20%20%20%20%20%20%20%22hb_fq_num%22:%223%22%2C%20%20%20%20%20%20%20%22hb_fq_seller_percent%22:%22100%22%20%20%20%20%20}%2C%20%20%20%20%20%22timeout_express%22:%2290m%22%2C%20%20%20%20%20%22royalty_info%22:{%20%20%20%20%20%20%20%22royalty_type%22:%22ROYALTY%22%2C%20%20%20%20%20%20%20%20%20%22royalty_detail_infos%22:[{%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22serial_no%22:1%2C%20%20%20%20%20%20%20%20%20%20%20%22trans_in_type%22:%22userId%22%2C%20%20%20%20%20%20%20%20%20%20%20%22batch_no%22:%22123%22%2C%20%20%20%20%20%20%20%20%20%20%20%22out_relation_id%22:%2220131124001%22%2C%20%20%20%20%20%20%20%20%20%20%20%22trans_out_type%22:%22userId%22%2C%20%20%20%20%20%20%20%20%20%20%20%22trans_out%22:%222088101126765726%22%2C%20%20%20%20%20%20%20%20%20%20%20%22trans_in%22:%222088101126708402%22%2C%20%20%20%20%20%20%20%20%20%20%20%22amount%22:0.1%2C%20%20%20%20%20%20%20%20%20%20%20%22desc%22:%22%E5%88%86%E8%B4%A6%E6%B5%8B%E8%AF%951%22%2C%20%20%20%20%20%20%20%20%20%20%20%22amount_percentage%22:%22100%22%20%20%20%20%20%20%20%20%20%20%20}]%20%20%20%20%20}%2C%20%20%20%20%20%22sub_merchant%22:{%20%20%20%20%20%20%20%22merchant_id%22:%2219023454%22%20%20%20%20%20}%2C%20%20%20%20%20%22disable_pay_channels%22:%22credit_group%22%2C%20%20%20%20%20%22auth_no%22:%222016110310002001760201905725%22%2C%20%20%20%20%20%22ext_user_info%22:{%20%20%20%20%20%20%20%22name%22:%22%E6%9D%8E%E6%98%8E%22%2C%20%20%20%20%20%20%20%22mobile%22:%2216587658765%22%2C%20%20%20%20%20%20%20%22cert_type%22:%22IDENTITY_CARD%22%2C%20%20%20%20%20%20%20%22cert_no%22:%22362334768769238881%22%20%20%20%20%20}%20%20%20}"如果是post提交 url拼接的参数 也是-F 的。
      

  2.   

    post提交 到url 不是 采用 xx?xx=1&xx=2这种get提交的方式
    不知道你用什么语言写,java中,直接post url 不使用参数键值对的方式,直接放到body提交。
    php也是一样的原理,用的函数 curl直接post。
      

  3.   

    我知道怎么post, 我的问题是支付宝的官方文档是不是有问题?