Skip to content

Commit

Permalink
fix compact
Browse files Browse the repository at this point in the history
  • Loading branch information
fieyum committed Jul 5, 2024
1 parent db7a1a5 commit 0619c57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
21 changes: 3 additions & 18 deletions src/PrivateApi/Earn.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,7 @@ public function getKcsStakingProducts()
*/
public function subscribe($productId, $amount, $accountType = AccountType::MAIN)
{
$parameters = [
'productId' => $productId,
'amount' => $amount,
'accountType' => $accountType,
];

$parameters = compact('productId', 'amount', 'accountType');
return $this->call(Request::METHOD_POST, '/api/v1/earn/orders', $parameters)->getApiData();
}

Expand All @@ -112,13 +107,7 @@ public function subscribe($productId, $amount, $accountType = AccountType::MAIN)
*/
public function redeem($orderId, $amount, $fromAccountType = AccountType::MAIN, $confirmPunishRedeem = 0)
{
$parameters = [
'orderId' => $orderId,
'amount' => $amount,
'fromAccountType' => $fromAccountType,
'confirmPunishRedeem' => $confirmPunishRedeem,
];

$parameters = compact('orderId', 'amount', 'fromAccountType', 'confirmPunishRedeem');
return $this->call(Request::METHOD_DELETE, '/api/v1/earn/orders', $parameters)->getApiData();
}

Expand All @@ -134,11 +123,7 @@ public function redeem($orderId, $amount, $fromAccountType = AccountType::MAIN,
*/
public function redeemPreview($orderId, $fromAccountType = AccountType::MAIN)
{
$parameters = [
'orderId' => $orderId,
'fromAccountType' => $fromAccountType,
];

$parameters = compact('orderId', 'fromAccountType');
return $this->call(Request::METHOD_GET, '/api/v1/earn/redeem-preview', $parameters)->getApiData();
}

Expand Down
1 change: 0 additions & 1 deletion tests/PrivateApi/EarnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ public function testRedeem(Earn $earn)
$timeSubscribeOptions = $this->timeProductsSubscribeOption($earn);
$timeOrder = $earn->subscribe($timeSubscribeOptions['productId'], $timeSubscribeOptions['amount']);
$earlyRedeem = $earn->redeem($timeOrder['orderId'], $timeSubscribeOptions['amount'], AccountType::MAIN, 1);
var_dump($earlyRedeem);
$assertCallback($earlyRedeem);
}

Expand Down

0 comments on commit 0619c57

Please sign in to comment.