B2C订单 用PHP调用API 保存操作疑问
金蝶云社区-云社区用户9R301234
云社区用户9R301234
1人赞赏了该文章 962次浏览 未经作者许可,禁止转载编辑于2016年03月22日 15:54:59

一些字段信息都维护进去了,但是返回结果提醒是没有填,请大神帮忙看看
代码:
$data = array(
'provider'=>'credentials',
'UserName'=>'',
'Password'=>,
'RememberMe'=>FALSE,
'PasswordIsEncrypted'=>FALSE
);

$data_string = json_encode($data);
//定义记录Cloud服务端返回的Session
$cookie_jar = tempnam('./tmp','CloudSession');
$loginurl =
$ch = curl_init($loginurl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_COOKIEJAR,$cookie_jar);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);

$result = curl_exec($ch);
curl_close($ch);

$array = json_decode($result,true);
// echo '<pre>';print_r($data_string);
echo '<pre>';print_r($array);

$data = array(
'Creator' => '测试员',
'NeedUpDateFields' => array(''),
'Model' => array(
'FID' => NULL,
'FBillNo' => '20160321095121546',
'FShopSaleOrgId' => array(
'FOrgID' => 0,
'FNumber' => '',
'FName' => '',
),
'FNetOrderSource' => array(
'FID' => 120939,
'FNUMBER' => '007',
'FNAME' => '拿货去小五金商城',
),
'FNetOrderDate' => '',
'FUserName' => array(
'FID' => NULL,
'FNumber' => '1003163',
'FName' => '邓紫棋',
'FMobilePhone' => '13888888888',
),
'FMemberName' => 'GEM',
'FUserTel' => '13777777777',
'FReceivePerson' => 'gem',
'FMobilePhone' => '13666666666',
'FTelePhone' => '0757-88888888',
'FFullAddress' => '广东省佛山市南海区桂城街道宝石西路1号',
'FUserRemarks' => '请用申通快递',
'FPostCode' => '528237',
'FSourcePlatform' => '',
'FRemark' => '卖家备注',
'FDeliveryRemark' => '备注',
'FSettlementCurrency' => array(
'FCURRENCYID' => 1,
'FNumber' => 'PRE001',
'FName' => '人民币',
'FSYSMBOL' => '¥',
'FPRICEDIGITS' => 6,
'FAMOUNTDIGITS' => 2,
'FIsShowCSymbol' => true,
'FFormatOrder' => '',
),
'FPayMode' => '先款后货',
'FPaymentStatus' => '未付款',
'FDiscountFee' => '',
'FReceiveAmt' => 199,
'FBalance' => 0,
'FTotalFare' => 7,
'FTotalTaxAmt' => '',
'FISInvoice' => false,
'FInvoiceType' => '',
'FInvoiceTitle' => '',
'FInvoiceContent' => '',
'FExchangeTypeId' => array(
'FRATETYPEID' => 1,
'FNumber' => 'HLTX01_SYS',
'FName' => '固定汇率',
'FDIGITS' => 4,
'FREVERSEDIGITS' => 4,
),
'FExchangeRate' => '1.0000',
'FUserLogistics' => array(
'FID' => NULL,
'FNumber' => '',
'FName' => '',
),
'FDeliverDate' => '',
'FDeliverTimeFrame' => '',
'FIsCarry' => false,
'FReceiverAddress' => array(
'FID' => NULL,
'FReceivePerson' => '收货人',
'FFUllAddress' => '收货人地址',
'FTele' => '13111111111',
'FMobile' => '13444444444',
'FPostCode' => '528200',
),
'FReceiverAddressSelf' => '',
'FERPCustomerId' => array(
'FCUSTID' => 0,
'FNumber' => '',
'FName' => '',
'FTRADINGCURRID' => array(
'FCURRENCYID' => 0,
'FNumber' => '',
'FName' => '',
'FSYSMBOL' => '',
'FPRICEDIGITS' => '',
'FAMOUNTDIGITS' => '',
'FIsShowCSymbol' => false,
'FFormatOrder' => '',
),
'FTaxType' => array(
'FEntryId' => '',
'FNumber' => '',
'FDataValue' => '',
),
),
'FSourceOrderNum' => '',
'FCreatorId' => array(
'FUserID' => 0,
'FUserAccount' => '',
'FName' => '',
),
'FCreateDate' => '',
'FModifierId' => array(
'FUserID' => 0,
'FUserAccount' => '',
'FName' => '',
),
'FModifyDate' => '',
'FBaseCurrency' => array(
'FCURRENCYID' => 1,
'FNumber' => 'PRE001',
'FName' => '人民币',
'FSYSMBOL' => '',
'FPRICEDIGITS' => 0,
'FAMOUNTDIGITS' => 0,
'FIsShowCSymbol' => false,
'FFormatOrder' => '',
),
'FPayAmt' => 200,
'FIsContainTax' => false,
'FCommissionFee' => 0,
'FCodFee' => 0,
'FYfxId' => '',
'FYfxAmt' => 0,
'FIsIncloudYfx' => false,
'FWaitPayAmt' => 199,
'FNetOrderStatus' => '',
'FCreditCardFee' => 0,
'FReceiverName' => '',
'FReceiverMobile' => '',
'FMobile' => '',
'FDetailAddress' => '',
'FZipCode' => '',
'FTotalDiscountAmount' => 0,
'FTotalTaxAmount' => 0,
'FTotalAmount' => 0,
'FTotalBaseCurrencyAmt' => 0,
'FTotalBaseCurrencyTaxAmt' => 0,
'FCouponsAmount' => 0,
'FScoreAmount' => 0,
'FSettlementOrgId' => array(
'FOrgID' => 0,
'FNumber' => '',
'FName' => '',
),
'FCarryCode' => '',
'FBillStatus' => '',
'FIsFalse' => false,
'FIsPushSchedule' => false,
'FBillTypeID' => array(
'FBILLTYPEID' => '',
'FNumber' => '',
'FName' => '',
),
'FApproverId' => array(
'FUserID' => 0,
'FUserAcount' => '',
'FName' => '',
),
'FApproveDate' => '',
'FCloserId' => array(
'FUserID' => 0,
'FUserAccount' => '',
'FName' => '',
),
'FCloseDate' => '',
'FLOCALTOTALTAXAMOUNT' => 0,
'FSelfAddressId' => array(
'FID' => NULL,
'FNumber' => '',
'FName' => '',
'FADDRESSTYPE' => '',
'FDetailAddress' => '',
),
'FBaseProperty' => '',
'FIsHeadBill' => false,
'FNetOrderModifyDate' => '',
'FPayTime' => '',
'FCloseStatus' => '',
'FAllocationStatus' => '',
'FSendId' => '',
'FDistributor' => array(
'FID' => NULL,
'FNumber' => '',
'FName' => '',
),
'FRemarkFlag' => '',
'FEndTime' => '',
'FSendTime' => '',
'FProcessStatus' => '',
'FCancelStatus' => '',
'FTips' => '',
'FIsBillFreeze' => false,
'FIsHandModifyAddress' => false,
'FOrderDetailEntry' => array(
array(
'FMaterialId' => '1.01.100-0086-000',
'FQty' => 150,
'FTaxPrice' => 99.9,
),
),
),
);
$data_string = json_encode($data);
// echo $data_string;die;
$invokeurl = 'http://nahuoqu.ik3cloud.com/K3CloudServiceInterface/json/syncreply/ECC_AllThirdOrder_Save';
$ch = curl_init($invokeurl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_jar);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json'
,'Content-Length: ' . strlen($data_string)
)
);

$result = curl_exec($ch);
curl_close($ch);

$array = json_decode($result,true);
echo '<pre>';print_r($data_string);
echo '<pre>';print_r($array);
?>