Skip to content

Commit

Permalink
Merge pull request #38 from decoderid/master
Browse files Browse the repository at this point in the history
signature unlockAndValidteTrxId transfer bank > 2x
  • Loading branch information
lintangtimur authored Apr 18, 2021
2 parents 488af99 + ce5afdc commit 12da5dd
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/Ovoid.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,41 @@ private function generateTrxId($amount, $actionMark)
return $ch->post(OVOID::BASE_ENDPOINT . 'v1.0/api/auth/customer/genTrxId', $data, $this->_aditionalHeader())->getResponse();
}

/**
* Signature unlockAndValidateTrxId
*
* @param \Stelin\Response\GenTrxIdResponse
* @param int $amount
* @return string
*/
private function signatureUnlockAndValidateTrxId($trxId, $amount)
{
return sha1(
$trxId . '||' . $amount . '||' . Meta::DEVICE_ID
);
}

/**
* unlockAndValidateTrxId
*
* @param int $amount
* @param \Stelin\Response\GenTrxIdResponse
* @param string $securityCode
* @return array
*/
protected function unlockAndValidateTrxId($trxId, $amount, $securityCode)
{
$ch = new Curl;

$data = [
'trxId' => $trxId,
'signature' => $this->signatureUnlockAndValidateTrxId($trxId, $amount),
'securityCode' => $securityCode
];

return $ch->post(OVOID::BASE_ENDPOINT, 'v1.0/api/auth/customer/unlockAndValidateTrxId', $data, $this->_aditionalHeader()->getResponse());
}

/**
* logout from OVO
*
Expand Down

0 comments on commit 12da5dd

Please sign in to comment.