Skip to content

Commit

Permalink
remove nullable type
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed May 8, 2019
1 parent 60cf22f commit 6a81554
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/BehpardakhtGateWay.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

namespace AlaaTV\BehpardakhtDriver;

use AlaaTV\Gateways\Contracts\IranianCurrency;
use AlaaTV\Gateways\Contracts\OnlineGateway;
use AlaaTV\Gateways\Contracts\OnlinePaymentVerificationResponseInterface;
use AlaaTV\Gateways\RedirectData;
use DateTime;
use AlaaTV\Gateways\RedirectData;
use Illuminate\Support\Facades\Input;
use AlaaTV\Gateways\Contracts\{OnlineGateway, IranianCurrency, OnlinePaymentVerificationResponseInterface};

class BehpardakhtGateWay implements OnlineGateway
{
Expand All @@ -32,17 +30,16 @@ public function generateAuthorityCode(string $callbackUrl, IranianCurrency $cost
$response = $this->makeSoapClient()
->bpPayRequest($fields);
} catch (\SoapFault $e) {
return nullable(null);
return null;
}

$response = explode(',', $response->return);

if ($response[0] != '0') {
$msg = ErrorMsgRepository::getMsg($response[0]);
return nullable(null, [$msg]);
return null;
}

return nullable($response[1]);
return $response[1];
}

public function generatePaymentPageUriObject($refId): RedirectData
Expand Down

0 comments on commit 6a81554

Please sign in to comment.