,提示是ACQ.TRADE_SETTLE_ERROR【分账处理失败】,然而这是可选字段,也不知道商户号什么,删掉分账部分后,提示ACQ.SELLER_NOT_EXIST【卖家不存在】,不知道问题出现在哪里,求了解这方面的朋友能帮帮在下,不胜感激,谢谢~
global $config;
require './alipay/config.php';
require_once './alipay/aop/AopClient.php';
require_once './alipay/aop/request/AlipayTradePrecreateRequest.php';
$aop = new \AopClient ();
$aop->gatewayUrl = $config ['gatewayUrl'];
$aop->appId = $config ['app_id'];
$aop->rsaPrivateKeyFilePath = $config ['merchant_private_key_file'];
$aop->alipayrsaPublicKey=$config['alipay_public_key_file'];
$aop->apiVersion = '1.0';
//$aop->postCharset='GBK';
$aop->format='json';
$request = new \AlipayTradePrecreateRequest ();
//获取订单金额
$fee=M('order')->where("id=" . $orderid)->getField("fee");
$ordersn=M('order')->where("id=" . $orderid)->getField("ordersn");
$request->setBizContent("{" .
" \"out_trade_no\":\"20150320010101001\"," .
" \"seller_id\":\"2088102146225135\"," .
" \"total_amount\":88.88," .
" \"discountable_amount\":8.88," .
" \"undiscountable_amount\":80," .
" \"buyer_logon_id\":\"18320965081\"," .
" \"subject\":\"Iphone6 16G\"," .
" \"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\":\"A00001\"," .
" \"store_id\":\"NJ_001\"," .
" \"terminal_id\":\"NJ_T_001\"," .
" \"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\"" .
" }" .
" }");
dump($request);
// die();
$result = $aop->execute ( $request);
dump($result); 最佳答案