Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alsharie committed May 16, 2023
1 parent aa4ac2c commit dc8abae
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ return [
'password' => env('CASHPAY_CERT_PASSWORD'),
],
'url' => [
'base' => env('CASHPAY_BASE_URL', 'https://www.tamkeen.com.ye:33291'),
'base' => env('CASHPAY_BASE_URL', 'https://www.tamkeen.com.ye:33291/CashPG'),
]
];
```
Expand Down
2 changes: 1 addition & 1 deletion config/cashPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
'password' => env('CASHPAY_CERT_PASSWORD'),
],
'url' => [
'base' => env('CASHPAY_BASE_URL', 'https://www.tamkeen.com.ye:33291'),
'base' => env('CASHPAY_BASE_URL', 'https://www.tamkeen.com.ye:33291/CashPG'),
]
];
17 changes: 11 additions & 6 deletions src/CashPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public function initPayment()
$this->setEncPassword();
$this->generateMDToken();

if(!isset($this->attributes['CurrencyId'])){
$this->attributes['CurrencyId']=2;//rial Yemeni
if (!isset($this->attributes['CurrencyId'])) {
$this->attributes['CurrencyId'] = 2;//rial Yemeni
}

try {
Expand All @@ -39,7 +39,9 @@ public function initPayment()

return new CashPayInitPaymentResponse((string)$response->getBody());
} catch (\GuzzleHttp\Exception\RequestException $e) {
return new CashPayErrorResponse($e->getResponse()->getBody(),$e->getResponse()->getStatusCode());
return new CashPayErrorResponse($e->getResponse()->getBody(), $e->getResponse()->getStatusCode());
} catch (\Exception $e) {
return new CashPayErrorResponse($e->getMessage(), $e->getCode());
}
}

Expand Down Expand Up @@ -67,12 +69,13 @@ public function confirmPayment()

return new CashPayConfirmPaymentResponse((string)$response->getBody());
} catch (\GuzzleHttp\Exception\RequestException $e) {
return new CashPayErrorResponse($e->getResponse()->getBody(),$e->getResponse()->getStatusCode());
return new CashPayErrorResponse($e->getResponse()->getBody(), $e->getResponse()->getStatusCode());
} catch (\Exception $e) {
return new CashPayErrorResponse($e->getMessage(), $e->getCode());
}
}



/**
* It is used to check the state of an operation ( It is useful in cases of time out).
* @return CashPayOperationStatusResponse|CashPayErrorResponse
Expand All @@ -96,7 +99,9 @@ public function operationStatus()

return new CashPayOperationStatusResponse((string)$response->getBody());
} catch (\GuzzleHttp\Exception\RequestException $e) {
return new CashPayErrorResponse($e->getResponse()->getBody(),$e->getResponse()->getStatusCode());
return new CashPayErrorResponse($e->getResponse()->getBody(), $e->getResponse()->getStatusCode());
} catch (\Exception $e) {
return new CashPayErrorResponse($e->getMessage(), $e->getCode());
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Guzzle.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ protected function sendRequest($path, $attributes, $headers, $security = [], str

protected function getInitPaymentPath(): string
{
return $this->basePath . '/' . "CashPG/api/CashPay/InitPayment";
return $this->basePath . '/' . "api/CashPay/InitPayment";
}


protected function getConfirmPaymentPath(): string
{
return $this->basePath . '/' . "CashPG/api/CashPay/ConfirmPayment";
return $this->basePath . '/' . "api/CashPay/ConfirmPayment";
}


protected function getOperationStatusPath(): string
{
return $this->basePath . '/' . "CashPG/api/Operation/OperationStatus";
return $this->basePath . '/' . "api/Operation/OperationStatus";
}


Expand Down

0 comments on commit dc8abae

Please sign in to comment.