123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <?php
- namespace BsPayDemo;
- require_once dirname(__FILE__) . "/loader.php";
- require_once dirname(__FILE__). "/../BsPaySdk/request/V2MerchantBasicdataIndvRequest.php";
- use BsPaySdk\core\BsPayClient;
- use BsPaySdk\request\V2MerchantBasicdataIndvRequest;
- $request = new V2MerchantBasicdataIndvRequest();
- $request->setReqSeqId(date("YmdHis").mt_rand());
- $request->setReqDate(date("Ymd"));
- $request->setUpperHuifuId("6666000107803321");
- $request->setRegName("张天德");
- $request->setProvId("310000");
- $request->setAreaId("310100");
- $request->setDistrictId("310105");
- $request->setDetailAddr("上海市长宁区定西路1310号");
- $request->setContactName("张天德");
- $request->setContactMobileNo("13111112222");
- $request->setContactEmail("jeff.peng@huifu.com");
- $request->setCardInfo(getCardInfo());
- $extendInfoMap = getExtendInfos();
- $request->setExtendInfo($extendInfoMap);
- $client = new BsPayClient();
- $result = $client->postRequest($request);
- if (!$result || $result->isError()) {
- var_dump($result -> getErrorInfo());
- } else {
- var_dump($result);
- }
- function getExtendInfos() {
-
- $extendInfoMap = array();
-
- $extendInfoMap["short_name"]= "张天德";
-
- $extendInfoMap["sms_send_flag"]= "1";
-
- $extendInfoMap["login_name"]= "tinysword0116";
-
- $extendInfoMap["cash_config"]= getCashConfig();
-
- $extendInfoMap["settle_config"]= getSettleConfig();
-
- $extendInfoMap["async_return_url"]= "http://192.168.85.157:30031/sspm/testVirgo";
-
- $extendInfoMap["settle_agree_pic"]= "119bc780-b1c5-3a9c-8b18-f911de6ff28c";
-
-
-
-
-
-
-
-
-
-
- return $extendInfoMap;
- }
- function getCardInfo() {
- $dto = array();
-
- $dto["card_name"] = "张天德";
-
- $dto["card_no"] = "4367421217494235081";
-
- $dto["prov_id"] = "310000";
-
- $dto["area_id"] = "310100";
-
- $dto["cert_type"] = "00";
-
- $dto["cert_no"] = "321084198912066512";
-
- $dto["cert_validity_type"] = "0";
-
- $dto["cert_begin_date"] = "20180824";
-
- $dto["cert_end_date"] = "20380824";
-
- $dto["mp"] = "13700000214";
-
- $dto["bank_code"] = "01030000";
- return json_encode($dto,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
- }
- function getCashConfig() {
- $dto = array();
-
- $dto["cash_type"] = "D1";
-
- $dto["fix_amt"] = "1.00";
-
- $dto["fee_rate"] = "";
-
-
-
-
-
-
- $dtoList = array();
- array_push($dtoList, $dto);
- return json_encode($dtoList,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
- }
- function getSettleConfig() {
- $dto = array();
-
- $dto["settle_cycle"] = "D1";
-
- $dto["out_settle_huifuid"] = "";
-
- $dto["min_amt"] = "1.00";
-
- $dto["remained_amt"] = "2.00";
-
- $dto["settle_abstract"] = "我这里显示结算摘要";
-
- $dto["out_settle_flag"] = "2";
-
-
-
- $dto["fixed_ratio"] = "5.00";
-
-
-
-
-
-
-
-
-
-
- return json_encode($dto,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
- }
|