dynegz / paper-alliance
PaperAlliance
v1.0.5
2023-05-17 01:14 UTC
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2024-10-17 04:25:31 UTC
README
Installation
install with composer
composer require dynegz/paper-alliance
Usage
example
$config = new Config();
$config->setAppId('');
$config->setSecretKey('');
//todo:测试环境下设置成true,上线请隐藏或者设置成false
$config->setIsFakeCheck(true);
$paperAllianceManager = new PaperAllianceManager($config);
/*$paper = new PaperParams();
$paper->setTitle("测试");
$paper->setAuthor("测试");*/
//$paper->setContent(file_get_contents('./Data/test.txt'));
//$paper->setPaperPath('./Data/test.txt');
/*$paper->setPaperPath('./Data/test.docx');*/
$paper2 = new PaperParams();
$paper2->setTitle("人类普遍认为语言中发音与含义之间的对应关系是任意的");
$paper2->setAuthor("人类");
$paper2->setPaperPath('./Data/0001.doc');
//$paper2->setContent(file_get_contents('./Data/test.txt'));
//$paper2->setPaperPath('./Data/test.txt');
//$paper2->setPaperPath('./Data/test.docx');
$jane_name = "checkpass";
/**************验证论文文件****************/
$res = $paperAllianceManager->validatePaper($paper2,$jane_name);
/**************预支付订单****************/
$res = $paperAllianceManager->preCreateOne($paper2,$jane_name,'2.0|0','background');
$paper_id = $res->getData()['data']['paper_id'];
//$res = $paperAllianceManager->preCreateMulti([$paper,$paper2],$jane_name,'2.0|0','background');
/**************支付订单****************/
$res = $paperAllianceManager->payOrder($res->getData()['data']['pay_id'],'money');//T2012758374089218537
/**************订单状态查询******************/
$res0 = $paperAllianceManager->payInfoStatus($res->getData()['data']['oid']);
/**************订单记录******************/
$res1 = $paperAllianceManager->findCheckRecord($paper_id);//D004218887155246711297
$res2 = $paperAllianceManager->findCheckRecords($paper_id);
$res3 = $paperAllianceManager->reUploadPaper($paper2,$paper_id);
/******************查询用户余额*******************/
//$res = $paperAllianceManager->inquireRestMoney();
var_dump($paper_id,$res,$res0,$res1,$res2,$res3);