123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?php
- namespace BsPayDemo;
- require_once dirname(__FILE__) . "/loader.php";
- require_once dirname(__FILE__). "/../BsPaySdk/request/V2PcreditFeeConfigRequest.php";
- use BsPaySdk\core\BsPayClient;
- use BsPaySdk\request\V2PcreditFeeConfigRequest;
- $request = new V2PcreditFeeConfigRequest();
- $request->setReqDate(date("Ymd"));
- $request->setReqSeqId(date("YmdHis").mt_rand());
- $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["async_return_url"]= "http://192.168.85.157:30031/sspm/testVirgo";
-
- $extendInfoMap["bank_fq_list"]= getBankFqList();
-
- $extendInfoMap["hb_fq_fee_list"]= getHbFqFeeList();
- return $extendInfoMap;
- }
- function getBankFqFeeList() {
- $dto = array();
-
- $dto["bank_code"] = "01040000";
-
- $dto["bank_name"] = "";
-
- $dto["bank_acq_period"] = "6";
-
- $dto["bank_fee_rate"] = "2";
-
- $dto["out_fee_flag"] = "";
-
- $dto["out_fee_huifu_id"] = "";
-
- $dto["three_period_switch"] = "Y";
-
- $dto["three_period"] = "10";
-
- $dto["six_period_switch"] = "Y";
-
- $dto["six_period"] = "16";
-
- $dto["twelve_period_switch"] = "Y";
-
- $dto["twelve_period"] = "0.0001";
- $dtoList = array();
- array_push($dtoList, $dto);
- return $dtoList;
- }
- function getBankFqList() {
- $dto = array();
-
- $dto["ent_way"] = "1";
-
- $dto["huifu_id"] = "6666000003156435";
-
- $dto["bank_card_fq_status"] = "1";
-
- $dto["bank_fq_fee_list"] = getBankFqFeeList();
-
- $dto["fee_model"] = "1";
- $dtoList = array();
- array_push($dtoList, $dto);
- return json_encode($dtoList,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
- }
- function getHbFqFeeList() {
- $dto = array();
-
- $dto["huifu_id"] = "6666000003156435";
-
-
-
- $dto["hb_three_period_switch"] = "Y";
-
- $dto["hb_three_acq_period"] = "5";
-
- $dto["hb_three_period"] = "10";
-
- $dto["hb_six_period_switch"] = "Y";
-
- $dto["hb_six_acq_period"] = "5";
-
- $dto["hb_six_period"] = "10";
-
- $dto["hb_twelve_period_switch"] = "Y";
-
- $dto["hb_twelve_acq_period"] = "15";
-
- $dto["hb_twelve_period"] = "11";
-
- $dto["out_fee_flag"] = "";
-
- $dto["out_fee_huifu_id"] = "";
- $dtoList = array();
- array_push($dtoList, $dto);
- return json_encode($dtoList,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
- }
|