You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
178 lines
8.2 KiB
178 lines
8.2 KiB
<?php
|
|
/**
|
|
*
|
|
*
|
|
* @author suning
|
|
* @date 2021-7-6
|
|
*/
|
|
// 引入主文件
|
|
require_once(dirname(__FILE__).'/../../SuningSdk.php');
|
|
require_once(dirname(__FILE__).'/../../DefaultSuningClient.php');
|
|
$req = new YskreceiveAddRequest();
|
|
//赋值……
|
|
$loweroedersquarebean = new Loweroedersquarebean();
|
|
$loweroedersquarebean->setClientId("123");
|
|
$loweroedersquarebean->setMemInCardNo("DA5563303");
|
|
$loweroedersquarebean->setMemOutCardNo("2876556788976");
|
|
$loweroedersquarebean->setMemType("AP");
|
|
$loweroedersquarebean->setParentMemberNo("M28655900009");
|
|
$req->setLoweroedersquarebean($loweroedersquarebean);
|
|
$orderbodybean = new Orderbodybean();
|
|
$orderbodybean->setAppointTransTime("20190608150000");
|
|
$orderbodybean->setBillType("-1");
|
|
$orderbodybean->setBtocOrderId("345677755");
|
|
$orderbodybean->setCartNo("C3487654D");
|
|
$orderbodybean->setDetailCount("10");
|
|
$orderbodybean->setEffectiveTime("20190608150000");
|
|
$orderbodybean->setOmsCreatedTime("20190608150000");
|
|
$orderbodybean->setOrderChannel("PC");
|
|
$orderbodybean->setOrderId("28223852028901");
|
|
$orderbodybean->setOrderSource("LCPOS");
|
|
$orderbodybean->setOrderType("A");
|
|
$orderbodybean->setSalePlatform("SAP");
|
|
$orderbodybean->setSapOrderId("210100025801582559");
|
|
$orderbodybean->setSposOrderId("DA5563303");
|
|
$orderbodybean->setTmOrderId("TM5563303");
|
|
$req->setOrderbodybean($orderbodybean);
|
|
$orderbodyinfobean = new Orderbodyinfobean();
|
|
$orderbodyinfobean->setAbBankFlag("A");
|
|
$orderbodyinfobean->setAttiOrg("3457");
|
|
$orderbodyinfobean->setAttiShopCode("DA5563303");
|
|
$orderbodyinfobean->setBalancePayTime("20021230115554");
|
|
$orderbodyinfobean->setBtocOrderItemId("DA5563303");
|
|
$orderbodyinfobean->setBusinessUnit("AP");
|
|
$orderbodyinfobean->setCasherId("Y00505000");
|
|
$orderbodyinfobean->setCasherTerminalId("23578");
|
|
$orderbodyinfobean->setCouponTotalMoney("10.00");
|
|
$orderbodyinfobean->setCprototypeEan("C3487654D");
|
|
$orderbodyinfobean->setCprototypeId("CS2345");
|
|
$orderbodyinfobean->setCscPrice("18.65");
|
|
$orderbodyinfobean->setCurrencyType("CNY");
|
|
$orderbodyinfobean->setDebtId("1");
|
|
$orderbodyinfobean->setDeliveryArea("330172");
|
|
$orderbodyinfobean->setDeliveryType("01");
|
|
$orderbodyinfobean->setDistChannel("50");
|
|
$orderbodyinfobean->setDistributeType("A");
|
|
$orderbodyinfobean->setIntegratedLog("1");
|
|
$orderbodyinfobean->setInvoicePrintAddress("D5678");
|
|
$orderbodyinfobean->setInvoicePrintAddressPs("A");
|
|
$orderbodyinfobean->setItemTaxFare("16.20");
|
|
$orderbodyinfobean->setManagerCardMoney("13");
|
|
$orderbodyinfobean->setManagerCardNo("weew335667232");
|
|
$orderbodyinfobean->setMerchantCode("DA55");
|
|
$orderbodyinfobean->setMnSupplierCode("210100025801582559");
|
|
$orderbodyinfobean->setNewPayAmount("15.00");
|
|
$orderbodyinfobean->setOperatorId("Y10001001");
|
|
$orderbodyinfobean->setOrderItemId("28223852533603");
|
|
$orderbodyinfobean->setOrderItemStepId("210100025801582559");
|
|
$orderbodyinfobean->setOrderItemType("10");
|
|
$orderbodyinfobean->setOrderTime("20190608150000");
|
|
$orderbodyinfobean->setOriSaleOrg("5005");
|
|
$orderbodyinfobean->setPartNumber("01002405");
|
|
$orderbodyinfobean->setPayAmount("15.00");
|
|
$orderbodyinfobean->setPayOrg("2365");
|
|
$orderbodyinfobean->setPayStore("2323");
|
|
$orderbodyinfobean->setPointAmount("10");
|
|
$orderbodyinfobean->setPointMoney("10.000");
|
|
$orderbodyinfobean->setPosOrderId("210100025801582559");
|
|
$orderbodyinfobean->setProductLevel("000029999");
|
|
$orderbodyinfobean->setProductName("洗衣机");
|
|
$orderbodyinfobean->setProvideAddress("D025");
|
|
$orderbodyinfobean->setPurchaseFlag("1");
|
|
$orderbodyinfobean->setRealPayAmount("10.80");
|
|
$orderbodyinfobean->setRealSalesPerson("Y00505000");
|
|
$orderbodyinfobean->setRealSupplierCode("33557890454433");
|
|
$orderbodyinfobean->setSaleAmount("20");
|
|
$orderbodyinfobean->setSaleOrg("5006");
|
|
$orderbodyinfobean->setSalesPerson("000000000");
|
|
$orderbodyinfobean->setSaleUnit("S01");
|
|
$orderbodyinfobean->setSapOrderType("YCXS");
|
|
$orderbodyinfobean->setSapProductCode("0000000004");
|
|
$orderbodyinfobean->setScsOrderItemId("DA5563303");
|
|
$orderbodyinfobean->setSerialNumber("C");
|
|
$orderbodyinfobean->setServiceFee("10.00");
|
|
$orderbodyinfobean->setShippingCondition("000000000");
|
|
$orderbodyinfobean->setShopCode("DA5563303");
|
|
$orderbodyinfobean->setSposOrderItemId("DA5563303");
|
|
$orderbodyinfobean->setStockArea("D345");
|
|
$orderbodyinfobean->setStockType("X");
|
|
$orderbodyinfobean->setStoreCode("DA5563303");
|
|
$orderbodyinfobean->setSubscription("12");
|
|
$orderbodyinfobean->setSupplierCode("10001356");
|
|
$orderbodyinfobean->setSupplierShopType("16");
|
|
$orderbodyinfobean->setSupProvideAddress("ZE11");
|
|
$orderbodyinfobean->setTmOrderitemId("1766557");
|
|
$orderbodyinfobean->setTotalAmount("17.55");
|
|
$orderbodyinfobean->setTranspInventoryFlag("Y");
|
|
$orderbodyinfobean->setTransportFee("16");
|
|
$orderbodyinfobean->setUnitPrice("10.80");
|
|
$orderbodyinfobean->setVirtualBalanceStartTime("20210309125732");
|
|
$orderbodyinfobean->setVoucherTotalMoney("15.00");
|
|
$orderbodyinfobean->setWbLeOrg("210100025801582559sjdh");
|
|
$orderbodyinfobean->setWbStoreCode("323435464575685ddfg");
|
|
$orderbodyinfobean->setZxxsl("0.16");
|
|
$req->setOrderbodyinfobean($orderbodyinfobean);
|
|
$orderlineusecouponsandpaymentbean = new Orderlineusecouponsandpaymentbean();
|
|
$orderlineusecouponsandpaymentbean->setActivityId("12134");
|
|
$orderlineusecouponsandpaymentbean->setAlipaypayno("232435345");
|
|
$orderlineusecouponsandpaymentbean->setBankTypeCode("01");
|
|
$orderlineusecouponsandpaymentbean->setBankTypeName("定金卡");
|
|
$orderlineusecouponsandpaymentbean->setBillNo("1234567786");
|
|
$orderlineusecouponsandpaymentbean->setBolnum("124125352342");
|
|
$orderlineusecouponsandpaymentbean->setCardNo("127182374681265781239581");
|
|
$orderlineusecouponsandpaymentbean->setCouponruleID("1111");
|
|
$orderlineusecouponsandpaymentbean->setDepositFlag("01");
|
|
$orderlineusecouponsandpaymentbean->setEnergizeType("1");
|
|
$orderlineusecouponsandpaymentbean->setFlowId("123456");
|
|
$orderlineusecouponsandpaymentbean->setHelpPaySign("AP");
|
|
$orderlineusecouponsandpaymentbean->setNewBankTypeCode("21");
|
|
$orderlineusecouponsandpaymentbean->setOldAccountType("1");
|
|
$orderlineusecouponsandpaymentbean->setParentPayCode("69");
|
|
$orderlineusecouponsandpaymentbean->setPayAmountZf("16.00");
|
|
$orderlineusecouponsandpaymentbean->setPayCode("6904");
|
|
$orderlineusecouponsandpaymentbean->setPayCompany("3456");
|
|
$orderlineusecouponsandpaymentbean->setPayName("云商卡");
|
|
$orderlineusecouponsandpaymentbean->setPayOffice("5577");
|
|
$orderlineusecouponsandpaymentbean->setPayTime("2020-01-16 15:00:00");
|
|
$orderlineusecouponsandpaymentbean->setPayType("CArd");
|
|
$orderlineusecouponsandpaymentbean->setPolicyflag("12");
|
|
$orderlineusecouponsandpaymentbean->setRepaymentCode("55555555");
|
|
$orderlineusecouponsandpaymentbean->setSellerCode("4356");
|
|
$orderlineusecouponsandpaymentbean->setSerialNo("01");
|
|
$orderlineusecouponsandpaymentbean->setStoreCodeSk("DA5563303");
|
|
$req->setOrderlineusecouponsandpaymentbean(array($orderlineusecouponsandpaymentbean));
|
|
$returnsorderbean = new Returnsorderbean();
|
|
$returnsorderbean->setChangeOrderNewItemId("3235346475675");
|
|
$returnsorderbean->setChangeOrderOldItemId("1232154364563467");
|
|
$returnsorderbean->setChgType("4");
|
|
$returnsorderbean->setCreatedTime("20210619120358");
|
|
$returnsorderbean->setOperatMum("32445");
|
|
$returnsorderbean->setPreOrderItemId("210100025801582559");
|
|
$returnsorderbean->setPrePosId("DA5563303");
|
|
$returnsorderbean->setReason("下错单");
|
|
$returnsorderbean->setRetType("2");
|
|
$returnsorderbean->setSpecialReturnFlag("X");
|
|
$req->setReturnsorderbean($returnsorderbean);
|
|
|
|
//api入参校验逻辑开关,当测试稳定之后建议设置为 false 或者删除该行
|
|
$req -> setCheckParam('true');
|
|
$serverUrl = "http://openpre.cnsuning.com/api/http/sopRequest";
|
|
$appKey = "a13b8bd0efb06a770c57d1c370ce8ee7";
|
|
$appSecret = "f08ce9836c4bcfc708194594081f6690";
|
|
$client = new DefaultSuningClient($serverUrl,$appKey,$appSecret,'json');
|
|
$resp = $client -> execute($req);
|
|
$reqJson = getReqJson($req);
|
|
print_r("请求报文:\n".$reqJson);
|
|
print_r("\n返回响应报文:\n".$resp);
|
|
|
|
function getReqJson($req){
|
|
$paramsArray = $req -> getApiParams();
|
|
if(empty($paramsArray)){
|
|
$paramsArray = '';
|
|
}
|
|
$paramsArray = array('sn_request' => array('sn_body' => array(
|
|
"{$req -> getBizName()}" => $paramsArray
|
|
)));
|
|
return json_encode($paramsArray);
|
|
}
|
|
?>
|