Skip to content

Commit

Permalink
fix: live url fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipesh79 committed Jul 15, 2024
1 parent 44a4ebe commit 1814539
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions src/LaravelImepay.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ public function checkEnvData(): void
*/
public function generateToken(float $amount, string $refId): string
{
if (strtolower($this->environment) == 'live') {
$url = '';
} else {
$url = $this->baseUrl . 'Web/GetToken';
}

$url = $this->baseUrl . 'Web/GetToken';


$response = Http::withHeaders([
'Authorization' => 'Basic ' . base64_encode($this->apiUser . ':' . $this->apiPassword),
Expand All @@ -128,9 +126,9 @@ public function generateToken(float $amount, string $refId): string
/**
* Generates a checkout URL.
*
* @param string $token The token for the payment.
* @param string $refId The reference ID for the payment.
* @param double $amount The amount for the payment.
* @param string $token The token for the payment.
* @param string $refId The reference ID for the payment.
* @param double $amount The amount for the payment.
*
* @return string The generated checkout URL.
*/
Expand Down Expand Up @@ -197,11 +195,7 @@ public function callbackResponse(Request $request): array|Request
*/
public function confirmPayment(string $refId, string $tokenId, string $transactionId, string $msisdn): array
{
if (strtolower($this->environment) == 'live') {
$url = '';
} else {
$url = $this->baseUrl . 'Web/Confirm';
}
$url = $this->baseUrl . 'Web/Confirm';

$response = Http::withHeaders([
'Authorization' => 'Basic ' . base64_encode($this->apiUser . ':' . $this->apiPassword),
Expand Down Expand Up @@ -230,11 +224,7 @@ public function confirmPayment(string $refId, string $tokenId, string $transacti
*/
public function recheckPayment(string $refId, string $tokenId): array
{
if (strtolower($this->environment) == 'live') {
$url = '';
} else {
$url = $this->baseUrl . 'Web/Recheck';
}
$url = $this->baseUrl . 'Web/Recheck';

$response = Http::withHeaders([
'Authorization' => 'Basic ' . base64_encode($this->apiUser . ':' . $this->apiPassword),
Expand Down

0 comments on commit 1814539

Please sign in to comment.