|
@@ -1,5 +1,6 @@
|
|
|
<?php
|
|
<?php
|
|
|
declare(strict_types=1);
|
|
declare(strict_types=1);
|
|
|
|
|
+
|
|
|
namespace SixShop\Lakala\Service;
|
|
namespace SixShop\Lakala\Service;
|
|
|
|
|
|
|
|
use SixShop\Lakala\Config;
|
|
use SixShop\Lakala\Config;
|
|
@@ -12,6 +13,7 @@ use SixShop\Lakala\OpenAPISDK\V2\Model\V2ModelRequest;
|
|
|
class LedgerService
|
|
class LedgerService
|
|
|
{
|
|
{
|
|
|
private V2LakalaApi $v2LakalaApi;
|
|
private V2LakalaApi $v2LakalaApi;
|
|
|
|
|
+
|
|
|
public function __construct(Config $config)
|
|
public function __construct(Config $config)
|
|
|
{
|
|
{
|
|
|
$this->v2LakalaApi = new V2LakalaApi($config->getV2Config());
|
|
$this->v2LakalaApi = new V2LakalaApi($config->getV2Config());
|
|
@@ -22,19 +24,15 @@ class LedgerService
|
|
|
*
|
|
*
|
|
|
* @link https://o.lakala.com/#/home/document/detail?id=382
|
|
* @link https://o.lakala.com/#/home/document/detail?id=382
|
|
|
*/
|
|
*/
|
|
|
- public function applyLedgerReceiver()
|
|
|
|
|
|
|
+ public function applyLedgerReceiver(array $reqData)
|
|
|
{
|
|
{
|
|
|
$request = new V2ModelRequest();
|
|
$request = new V2ModelRequest();
|
|
|
- $request->setReqData([
|
|
|
|
|
-
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+ $reqData['version'] = '1.0';
|
|
|
|
|
+ $request->setReqData($reqData);
|
|
|
$response = $this->v2LakalaApi->tradeApi('/api/v2/mms/openApi/ledger/applyLedgerReceiver', $request);
|
|
$response = $this->v2LakalaApi->tradeApi('/api/v2/mms/openApi/ledger/applyLedgerReceiver', $request);
|
|
|
- dd($response);
|
|
|
|
|
if ($response->getRespData()) {
|
|
if ($response->getRespData()) {
|
|
|
print_r($response->getRespData());
|
|
print_r($response->getRespData());
|
|
|
- print_r($response->getAccRespFields());
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
|
|
+ } else {
|
|
|
print_r($response);
|
|
print_r($response);
|
|
|
}
|
|
}
|
|
|
echo $response->getRetCode();
|
|
echo $response->getRetCode();
|